@mx-cartographer/experiences 9.7.137 → 9.7.138

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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [9.7.138] - 11-11-2026
2
+
3
+ - **FIXED** - Set Up / Switch Direct Deposit complete tile: the wash is Figma's `linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(173, 248, 44, 0.2) 101.54%)` (`DIRECT_DEPOSIT_COMPLETE_GRADIENT`); the warm-lime accent other blocks use is unchanged (WEC-2289)
4
+ - **FIXED** - "Not Interested" feedback dialog (Figma 1941:192803): the account name in the description is semibold, 16px separate the description from the radio group (was 8px), and the selected radio is `primary` (was forced to grey `action.active`, which now applies to unselected radios only). Shared by every `FeedbackDialog` (WEC-2289)
5
+ - **CHANGED** - Storybook: the Set Up Direct Deposit tile reads "Checking Account" (as mrs_content localizes it, was `CHECKING`), and its notification row uses the short "Set up direct deposit for **{account}** to simplify your finances." (WEC-2289)
6
+
1
7
  ## [9.7.137] - 11-11-2026
2
8
 
3
9
  - **FIXED** - `svg_image_block` resolves the Federal Bank Holiday illustration under the snake_case variant `holiday` that ditto emits (was `Holiday`, falling back to the emergency-savings art); the old `Holiday` name is no longer accepted (WEC-2037)
@@ -1,19 +1,24 @@
1
- import { buildDynamicCopy as p } from "../../core/utils/Localization.es.js";
2
- import { useGlobalCopyStore as b, useInsightsV2Store as _ } from "../../common/context/hooks.es.js";
3
- import { slot as f } from "../../core/types/Insights.es.js";
4
- import { useBeatActions as y } from "../beatActions.es.js";
5
- import { ANALYTICS_EVENTS_CONFIG as g } from "../analytics/analyticsEventsConfig.es.js";
6
- import { useAnalyticsEvent as S } from "../analytics/useAnalyticsEvent.es.js";
7
- import h from "../components/FeedbackModal.es.js";
8
- import { useRef as A } from "react";
9
- import { observer as k } from "mobx-react-lite";
10
- import { jsx as F } from "react/jsx-runtime";
11
- var N = k(function({ beat: i }) {
12
- const { closeActionDrawer: r } = _(), { onDismissInsight: o, onFeedbackTextFocus: n, onSubmitFeedback: c } = y(), l = b(), m = S(), s = A(!1), t = i.insights_payload, e = l.insights_feed?.feedback_modal;
1
+ import { buildDynamicCopy as f } from "../../core/utils/Localization.es.js";
2
+ import { useGlobalCopyStore as _, useInsightsV2Store as g } from "../../common/context/hooks.es.js";
3
+ import { slot as y } from "../../core/types/Insights.es.js";
4
+ import { useBeatActions as h } from "../beatActions.es.js";
5
+ import { ANALYTICS_EVENTS_CONFIG as S } from "../analytics/analyticsEventsConfig.es.js";
6
+ import { useAnalyticsEvent as A } from "../analytics/useAnalyticsEvent.es.js";
7
+ import k from "../components/FeedbackModal.es.js";
8
+ import { useRef as x } from "react";
9
+ import { observer as F } from "mobx-react-lite";
10
+ import { jsx as n } from "react/jsx-runtime";
11
+ import T from "@mui/material/Box";
12
+ var V = F(function({ beat: c }) {
13
+ const { closeActionDrawer: r } = g(), { onDismissInsight: o, onFeedbackTextFocus: m, onSubmitFeedback: l } = h(), u = _(), d = A(), s = x(!1), t = c.insights_payload, e = u.insights_feed?.feedback_modal;
13
14
  if (!t || !e) return null;
14
- const u = {
15
+ const a = y(t.instance_slot?.data, "account_name") ?? t.instance_slot?.account_name ?? "", p = {
15
16
  title: e.title,
16
- description: p(e.description, f(t.instance_slot?.data, "account_name") ?? t.instance_slot?.account_name ?? ""),
17
+ description: f(e.description, a ? /* @__PURE__ */ n(T, {
18
+ component: "span",
19
+ sx: { fontWeight: 600 },
20
+ children: a
21
+ }) : ""),
17
22
  options: Object.values(e.options ?? {}),
18
23
  submitText: e.submit,
19
24
  cancelText: e.no_thanks,
@@ -24,30 +29,30 @@ var N = k(function({ beat: i }) {
24
29
  tryAgainText: e.try_again,
25
30
  toastCloseAriaLabel: e.toast_close_aria
26
31
  };
27
- return /* @__PURE__ */ F(h, {
28
- copy: u,
32
+ return /* @__PURE__ */ n(k, {
33
+ copy: p,
29
34
  isOpen: !0,
30
35
  onClose: () => r(),
31
- onSubmit: async (a, d) => {
36
+ onSubmit: async (i, b) => {
32
37
  s.current || (s.current = !0, o?.({
33
38
  beatGuid: t.guid,
34
39
  type: "always"
35
- }), m({
36
- ...g.BEAT_DISMISSED,
37
- value: a
38
- })), await c?.({
40
+ }), d({
41
+ ...S.BEAT_DISMISSED,
42
+ value: i
43
+ })), await l?.({
39
44
  beatGuid: t.guid,
40
45
  source: "not_interested",
41
- option: a,
42
- detail: d
46
+ option: i,
47
+ detail: b
43
48
  });
44
49
  },
45
- onTextInputFocus: n,
50
+ onTextInputFocus: m,
46
51
  showSuccessMessage: !o
47
52
  });
48
53
  });
49
54
  export {
50
- N as FeedbackModalActionBlock
55
+ V as FeedbackModalActionBlock
51
56
  };
52
57
 
53
58
  //# sourceMappingURL=FeedbackModalActionBlock.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackModalActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/FeedbackModalActionBlock.tsx"],"sourcesContent":["import { useRef } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport { slot } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport FeedbackModal, { type FeedbackModalContent } from '../components/FeedbackModal'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../analytics'\nimport { useBeatActions } from '../beatActions'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `feedback_modal_block` — a CTA drilldown registered like any other drawer\n * block; its content is a MODAL (the dialog portals over the drawer).\n *\n * Flow: the CTA (e.g. Set Up Direct Deposit's \"Not Interested\") opens the\n * \"Can you tell us why?\" survey (Figma `1941:192803`). Submit dismisses the insight\n * (`onDismissInsight`), then forwards the selection via `onSubmitFeedback` (source\n * `hide`). A host that can dismiss shows its own confirmation; otherwise the dialog\n * swaps for the success snackbar (Figma `1941:167636`). Closing ends the drawer session.\n *\n * Copy comes from `insights_feed.feedback_modal` in GlobalCopy; the\n * description interpolates the beat's account name (`_1{account_name}`).\n */\nexport const FeedbackModalActionBlock = observer(function FeedbackModalActionBlock({\n beat,\n}: ActionBlockProps) {\n const { closeActionDrawer } = useInsightsV2Store()\n const { onDismissInsight, onFeedbackTextFocus, onSubmitFeedback } = useBeatActions()\n const copyStore = useGlobalCopyStore()\n const fireAnalyticsEvent = useAnalyticsEvent()\n // So a retry does not dismiss twice.\n const hasDismissed = useRef(false)\n\n const insights_payload = beat.insights_payload\n const modalCopy = copyStore.insights_feed?.feedback_modal\n\n if (!insights_payload || !modalCopy) return null\n\n const copy: FeedbackModalContent = {\n title: modalCopy.title,\n description: buildDynamicCopy(\n modalCopy.description,\n // `data` first, the flat name is the earlier shape.\n slot<string>(insights_payload.instance_slot?.data, 'account_name') ??\n insights_payload.instance_slot?.account_name ??\n '',\n ) as string,\n options: Object.values(modalCopy.options ?? {}),\n submitText: modalCopy.submit,\n cancelText: modalCopy.no_thanks,\n closeAriaLabel: modalCopy.close_aria,\n characterLimitLabel: modalCopy.character_limit,\n successMessage: modalCopy.success_message,\n errorMessage: modalCopy.error_message,\n tryAgainText: modalCopy.try_again,\n toastCloseAriaLabel: modalCopy.toast_close_aria,\n }\n\n // As legacy: dismiss first (once), then send the survey. A failed send keeps the beat dismissed and\n // Try Again re-sends only the feedback. Awaited so a rejection drives the error snackbar.\n const handleSubmit = async (option: string, detail?: string) => {\n if (!hasDismissed.current) {\n hasDismissed.current = true\n onDismissInsight?.({ beatGuid: insights_payload.guid, type: 'always' })\n // The reason is the event's value, as legacy.\n fireAnalyticsEvent({ ...ANALYTICS_EVENTS_CONFIG.BEAT_DISMISSED, value: option })\n }\n\n await onSubmitFeedback?.({\n beatGuid: insights_payload.guid,\n source: 'not_interested',\n option,\n detail,\n })\n }\n\n return (\n <FeedbackModal\n copy={copy}\n isOpen={true}\n onClose={() => closeActionDrawer()}\n onSubmit={handleSubmit}\n onTextInputFocus={onFeedbackTextFocus}\n // A host that dismisses shows its own confirmation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AAA,QACA,QAAA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IAQI,kBAAkB;AAAA,IAElB,oBAAoB,CAAC;AAAA,EACtB,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"FeedbackModalActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/FeedbackModalActionBlock.tsx"],"sourcesContent":["import { useRef, type ReactNode } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport { slot } from '../../core'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport FeedbackModal, { type FeedbackModalContent } from '../components/FeedbackModal'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../analytics'\nimport { useBeatActions } from '../beatActions'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `feedback_modal_block` — a CTA drilldown registered like any other drawer\n * block; its content is a MODAL (the dialog portals over the drawer).\n *\n * Flow: the CTA (e.g. Set Up Direct Deposit's \"Not Interested\") opens the\n * \"Can you tell us why?\" survey (Figma `1941:192803`). Submit dismisses the insight\n * (`onDismissInsight`), then forwards the selection via `onSubmitFeedback` (source\n * `hide`). A host that can dismiss shows its own confirmation; otherwise the dialog\n * swaps for the success snackbar (Figma `1941:167636`). Closing ends the drawer session.\n *\n * Copy comes from `insights_feed.feedback_modal` in GlobalCopy; the\n * description interpolates the beat's account name (`_1{account_name}`).\n */\nexport const FeedbackModalActionBlock = observer(function FeedbackModalActionBlock({\n beat,\n}: ActionBlockProps) {\n const { closeActionDrawer } = useInsightsV2Store()\n const { onDismissInsight, onFeedbackTextFocus, onSubmitFeedback } = useBeatActions()\n const copyStore = useGlobalCopyStore()\n const fireAnalyticsEvent = useAnalyticsEvent()\n // So a retry does not dismiss twice.\n const hasDismissed = useRef(false)\n\n const insights_payload = beat.insights_payload\n const modalCopy = copyStore.insights_feed?.feedback_modal\n\n if (!insights_payload || !modalCopy) return null\n\n // `data` first, the flat name is the earlier shape.\n const accountName =\n slot<string>(insights_payload.instance_slot?.data, 'account_name') ??\n insights_payload.instance_slot?.account_name ??\n ''\n\n const copy: FeedbackModalContent = {\n title: modalCopy.title,\n // Figma 1941:192803: the account name is semibold within the regular sentence.\n description: buildDynamicCopy(\n modalCopy.description,\n accountName ? (\n <Box component=\"span\" sx={{ fontWeight: 600 }}>\n {accountName}\n </Box>\n ) : (\n ''\n ),\n ) as ReactNode,\n options: Object.values(modalCopy.options ?? {}),\n submitText: modalCopy.submit,\n cancelText: modalCopy.no_thanks,\n closeAriaLabel: modalCopy.close_aria,\n characterLimitLabel: modalCopy.character_limit,\n successMessage: modalCopy.success_message,\n errorMessage: modalCopy.error_message,\n tryAgainText: modalCopy.try_again,\n toastCloseAriaLabel: modalCopy.toast_close_aria,\n }\n\n // As legacy: dismiss first (once), then send the survey. A failed send keeps the beat dismissed and\n // Try Again re-sends only the feedback. Awaited so a rejection drives the error snackbar.\n const handleSubmit = async (option: string, detail?: string) => {\n if (!hasDismissed.current) {\n hasDismissed.current = true\n onDismissInsight?.({ beatGuid: insights_payload.guid, type: 'always' })\n // The reason is the event's value, as legacy.\n fireAnalyticsEvent({ ...ANALYTICS_EVENTS_CONFIG.BEAT_DISMISSED, value: option })\n }\n\n await onSubmitFeedback?.({\n beatGuid: insights_payload.guid,\n source: 'not_interested',\n option,\n detail,\n })\n }\n\n return (\n <FeedbackModal\n copy={copy}\n isOpen={true}\n onClose={() => closeActionDrawer()}\n onSubmit={handleSubmit}\n onTextInputFocus={onFeedbackTextFocus}\n // A host that dismisses shows its own confirmation; the micro widget keeps the snackbar.\n showSuccessMessage={!onDismissInsight}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;AA2BA,IAAa,IAA2B,EAAS,SAAkC,EACjF,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,EAAE,kBAAA,GAAkB,qBAAA,GAAqB,kBAAA,EAAA,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AAA;AAEL,CAAC"}
@@ -1,4 +1,4 @@
1
- import { PRIMARY_TILE_GRADIENTS as n, SUCCESS_TILE_GRADIENTS as d, WARM_LIME_ACCENT_GRADIENT as p } from "../../../components/celebrationGradients.es.js";
1
+ import { DIRECT_DEPOSIT_COMPLETE_GRADIENT as n, PRIMARY_TILE_GRADIENTS as d, SUCCESS_TILE_GRADIENTS as p } from "../../../components/celebrationGradients.es.js";
2
2
  var t = {
3
3
  Neutral: "detailed_neutral",
4
4
  Primary: "detailed_primary",
@@ -30,17 +30,17 @@ var t = {
30
30
  nameVariant: "body2",
31
31
  pill: u(r)
32
32
  }, i = {
33
- backgroundImage: n[r],
33
+ backgroundImage: d[r],
34
34
  bgcolor: "background.paper",
35
35
  nameVariant: "body1",
36
36
  pill: g
37
37
  }, l = {
38
- backgroundImage: d[r],
38
+ backgroundImage: p[r],
39
39
  bgcolor: "background.paper",
40
40
  nameVariant: "body1",
41
41
  pill: s
42
42
  }, c = {
43
- backgroundImage: p,
43
+ backgroundImage: n,
44
44
  bgcolor: "background.paper",
45
45
  nameVariant: "body2",
46
46
  pill: {
@@ -1 +1 @@
1
- {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n PRIMARY_TILE_GRADIENTS,\n SUCCESS_TILE_GRADIENTS,\n WARM_LIME_ACCENT_GRADIENT,\n} from '../../../components/celebrationGradients'\nimport type {\n DirectDepositCardStyleProps,\n DirectDepositPillConfig,\n} from '../../../components/DirectDepositCard'\n\nexport const detailedAccountVariant = {\n Neutral: 'detailed_neutral',\n Primary: 'detailed_primary',\n Success: 'detailed_success',\n Celebration: 'detailed_celebration',\n} as const\n\nexport type DetailedAccountVariant =\n (typeof detailedAccountVariant)[keyof typeof detailedAccountVariant]\n\nexport const directDepositVariant = {\n SetUpDirectDeposit: 'set_up_direct_deposit',\n DirectDepositComplete: 'direct_deposit_complete',\n MissingInterestRate: 'missing_interest_rate',\n InterestRateAdded: 'interest_rate_added',\n} as const\n\nexport type DirectDepositVariant = (typeof directDepositVariant)[keyof typeof directDepositVariant]\n\nconst VARIANTS = new Set<string>([\n ...Object.values(detailedAccountVariant),\n ...Object.values(directDepositVariant),\n])\n\nexport const isDetailedAccountVariant = (\n variant?: string | null,\n): variant is DetailedAccountVariant | DirectDepositVariant =>\n variant != null && VARIANTS.has(variant)\n\n// Grey tokens don't change with the mode, so pick the one `text.primary` reads on.\nconst neutralPill = (mode: Theme['palette']['mode']): DirectDepositPillConfig => {\n const bgcolor = mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return { bgcolor, borderColor: bgcolor, labelColor: 'text.primary' }\n}\n\nconst PRIMARY_TINT_PILL: DirectDepositPillConfig = {\n bgcolor: 'primary.lighter',\n borderColor: 'primary.lighter',\n labelColor: 'text.primary',\n}\n\nconst SUCCESS_PILL: DirectDepositPillConfig = {\n bgcolor: 'success.main',\n borderColor: 'success.main',\n labelColor: 'success.contrastText',\n}\n\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<DetailedAccountVariant | DirectDepositVariant, DirectDepositCardStyleProps> => {\n const mode = theme.palette.mode\n const neutral: DirectDepositCardStyleProps = {\n bgcolor: 'primary.lighter',\n nameVariant: 'body2',\n pill: neutralPill(mode),\n }\n const primary: DirectDepositCardStyleProps = {\n backgroundImage: PRIMARY_TILE_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: PRIMARY_TINT_PILL,\n }\n const success: DirectDepositCardStyleProps = {\n backgroundImage: SUCCESS_TILE_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: SUCCESS_PILL,\n }\n const celebration: DirectDepositCardStyleProps = {\n backgroundImage: WARM_LIME_ACCENT_GRADIENT,\n bgcolor: 'background.paper',\n nameVariant: 'body2',\n pill: { ...SUCCESS_PILL, icon: 'check_circle' },\n showConfetti: true,\n }\n\n return {\n [detailedAccountVariant.Neutral]: neutral,\n [detailedAccountVariant.Primary]: primary,\n [detailedAccountVariant.Success]: success,\n [detailedAccountVariant.Celebration]: celebration,\n [directDepositVariant.SetUpDirectDeposit]: neutral,\n [directDepositVariant.MissingInterestRate]: primary,\n [directDepositVariant.InterestRateAdded]: success,\n [directDepositVariant.DirectDepositComplete]: celebration,\n }\n}\n"],"mappings":";AAYA,IAAa,IAAyB;AAAA,EACpC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf,GAKa,IAAuB;AAAA,EAClC,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AACrB,GAIM,IAAW,oBAAI,IAAY,CAC/B,GAAG,OAAO,OAAO,CAAsB,GACvC,GAAG,OAAO,OAAO,CAAoB,CACvC,CAAC,GAEY,IAAA,CACX,MAEA,KAAW,QAAQ,EAAS,IAAI,CAAO,GAGnC,IAAA,CAAe,MAA4D;AAC/E,QAAM,IAAU,MAAS,SAAS,aAAa;AAE/C,SAAO;AAAA,IAAE,SAAA;AAAA,IAAS,aAAa;AAAA,IAAS,YAAY;AAAA,EAAe;AACrE,GAEM,IAA6C;AAAA,EACjD,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AACd,GAEM,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AACd,GAEa,IAAA,CACX,MACuF;AACvF,QAAM,IAAO,EAAM,QAAQ,MACrB,IAAuC;AAAA,IAC3C,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM,EAAY,CAAI;AAAA,EACxB,GACM,IAAuC;AAAA,IAC3C,iBAAiB,EAAuB,CAAA;AAAA,IACxC,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,GACM,IAAuC;AAAA,IAC3C,iBAAiB,EAAuB,CAAA;AAAA,IACxC,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,GACM,IAA2C;AAAA,IAC/C,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,MAAE,GAAG;AAAA,MAAc,MAAM;AAAA,IAAe;AAAA,IAC9C,cAAc;AAAA,EAChB;AAEA,SAAO;AAAA,IACJ,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,WAAA,GAAc;AAAA,IACrC,CAAA,EAAqB,kBAAA,GAAqB;AAAA,IAC1C,CAAA,EAAqB,mBAAA,GAAsB;AAAA,IAC3C,CAAA,EAAqB,iBAAA,GAAoB;AAAA,IACzC,CAAA,EAAqB,qBAAA,GAAwB;AAAA,EAChD;AACF"}
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport {\n DIRECT_DEPOSIT_COMPLETE_GRADIENT,\n PRIMARY_TILE_GRADIENTS,\n SUCCESS_TILE_GRADIENTS,\n} from '../../../components/celebrationGradients'\nimport type {\n DirectDepositCardStyleProps,\n DirectDepositPillConfig,\n} from '../../../components/DirectDepositCard'\n\nexport const detailedAccountVariant = {\n Neutral: 'detailed_neutral',\n Primary: 'detailed_primary',\n Success: 'detailed_success',\n Celebration: 'detailed_celebration',\n} as const\n\nexport type DetailedAccountVariant =\n (typeof detailedAccountVariant)[keyof typeof detailedAccountVariant]\n\nexport const directDepositVariant = {\n SetUpDirectDeposit: 'set_up_direct_deposit',\n DirectDepositComplete: 'direct_deposit_complete',\n MissingInterestRate: 'missing_interest_rate',\n InterestRateAdded: 'interest_rate_added',\n} as const\n\nexport type DirectDepositVariant = (typeof directDepositVariant)[keyof typeof directDepositVariant]\n\nconst VARIANTS = new Set<string>([\n ...Object.values(detailedAccountVariant),\n ...Object.values(directDepositVariant),\n])\n\nexport const isDetailedAccountVariant = (\n variant?: string | null,\n): variant is DetailedAccountVariant | DirectDepositVariant =>\n variant != null && VARIANTS.has(variant)\n\n// Grey tokens don't change with the mode, so pick the one `text.primary` reads on.\nconst neutralPill = (mode: Theme['palette']['mode']): DirectDepositPillConfig => {\n const bgcolor = mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return { bgcolor, borderColor: bgcolor, labelColor: 'text.primary' }\n}\n\nconst PRIMARY_TINT_PILL: DirectDepositPillConfig = {\n bgcolor: 'primary.lighter',\n borderColor: 'primary.lighter',\n labelColor: 'text.primary',\n}\n\nconst SUCCESS_PILL: DirectDepositPillConfig = {\n bgcolor: 'success.main',\n borderColor: 'success.main',\n labelColor: 'success.contrastText',\n}\n\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<DetailedAccountVariant | DirectDepositVariant, DirectDepositCardStyleProps> => {\n const mode = theme.palette.mode\n const neutral: DirectDepositCardStyleProps = {\n bgcolor: 'primary.lighter',\n nameVariant: 'body2',\n pill: neutralPill(mode),\n }\n const primary: DirectDepositCardStyleProps = {\n backgroundImage: PRIMARY_TILE_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: PRIMARY_TINT_PILL,\n }\n const success: DirectDepositCardStyleProps = {\n backgroundImage: SUCCESS_TILE_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: SUCCESS_PILL,\n }\n const celebration: DirectDepositCardStyleProps = {\n backgroundImage: DIRECT_DEPOSIT_COMPLETE_GRADIENT,\n bgcolor: 'background.paper',\n nameVariant: 'body2',\n pill: { ...SUCCESS_PILL, icon: 'check_circle' },\n showConfetti: true,\n }\n\n return {\n [detailedAccountVariant.Neutral]: neutral,\n [detailedAccountVariant.Primary]: primary,\n [detailedAccountVariant.Success]: success,\n [detailedAccountVariant.Celebration]: celebration,\n [directDepositVariant.SetUpDirectDeposit]: neutral,\n [directDepositVariant.MissingInterestRate]: primary,\n [directDepositVariant.InterestRateAdded]: success,\n [directDepositVariant.DirectDepositComplete]: celebration,\n }\n}\n"],"mappings":";AAYA,IAAa,IAAyB;AAAA,EACpC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf,GAKa,IAAuB;AAAA,EAClC,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AACrB,GAIM,IAAW,oBAAI,IAAY,CAC/B,GAAG,OAAO,OAAO,CAAsB,GACvC,GAAG,OAAO,OAAO,CAAoB,CACvC,CAAC,GAEY,IAAA,CACX,MAEA,KAAW,QAAQ,EAAS,IAAI,CAAO,GAGnC,IAAA,CAAe,MAA4D;AAC/E,QAAM,IAAU,MAAS,SAAS,aAAa;AAE/C,SAAO;AAAA,IAAE,SAAA;AAAA,IAAS,aAAa;AAAA,IAAS,YAAY;AAAA,EAAe;AACrE,GAEM,IAA6C;AAAA,EACjD,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AACd,GAEM,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AACd,GAEa,IAAA,CACX,MACuF;AACvF,QAAM,IAAO,EAAM,QAAQ,MACrB,IAAuC;AAAA,IAC3C,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM,EAAY,CAAI;AAAA,EACxB,GACM,IAAuC;AAAA,IAC3C,iBAAiB,EAAuB,CAAA;AAAA,IACxC,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,GACM,IAAuC;AAAA,IAC3C,iBAAiB,EAAuB,CAAA;AAAA,IACxC,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,GACM,IAA2C;AAAA,IAC/C,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,MAAE,GAAG;AAAA,MAAc,MAAM;AAAA,IAAe;AAAA,IAC9C,cAAc;AAAA,EAChB;AAEA,SAAO;AAAA,IACJ,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,WAAA,GAAc;AAAA,IACrC,CAAA,EAAqB,kBAAA,GAAqB;AAAA,IAC1C,CAAA,EAAqB,mBAAA,GAAsB;AAAA,IAC3C,CAAA,EAAqB,iBAAA,GAAoB;AAAA,IACzC,CAAA,EAAqB,qBAAA,GAAwB;AAAA,EAChD;AACF"}
@@ -1,10 +1,14 @@
1
+ import { ReactNode } from 'react';
1
2
  export type FeedbackDialogCloseReason = 'closeButton' | 'backdropClick' | 'escapeKeyDown';
2
3
  export interface FeedbackDialogProps {
3
4
  title: string;
4
5
  options: string[];
5
6
  characterLimit?: number;
6
- /** Optional paragraph rendered between the title and the options (Figma feedback survey). */
7
- description?: string;
7
+ /**
8
+ * Optional paragraph rendered between the title and the options (Figma feedback survey). A node, so
9
+ * the caller can emphasise part of it (Set Up Direct Deposit's semibold account name).
10
+ */
11
+ description?: ReactNode;
8
12
  characterLimitLabel?: string;
9
13
  isOpen: boolean;
10
14
  onSubmit: (option: string, detail?: string) => void;
@@ -2,42 +2,42 @@ import j from "../../common/components/dialog/Dialog.es.js";
2
2
  import { useEffect as z, useRef as b, useState as h } from "react";
3
3
  import E from "@mui/material/Stack";
4
4
  import { Text as g } from "@mxenabled/mxui";
5
- import { jsx as o, jsxs as x } from "react/jsx-runtime";
5
+ import { jsx as e, jsxs as v } from "react/jsx-runtime";
6
6
  import L from "@mui/material/FormControlLabel";
7
7
  import G from "@mui/material/TextField";
8
8
  import H from "@mui/material/Radio";
9
9
  import K from "@mui/material/FormControl";
10
10
  import W from "@mui/material/RadioGroup";
11
- var $ = 250, oe = ({ isOpen: a, onClose: v, onSubmit: C, title: s, options: r, characterLimit: y = $, description: u, characterLimitLabel: m, secondaryText: S, primaryText: k, closeAriaLabel: F, onBackClick: R, onTextInputFocus: D, showDetailField: M = !0 }) => {
11
+ var $ = 250, eo = ({ isOpen: a, onClose: x, onSubmit: C, title: s, options: r, characterLimit: y = $, description: u, characterLimitLabel: m, secondaryText: S, primaryText: k, closeAriaLabel: F, onBackClick: M, onTextInputFocus: R, showDetailField: D = !0 }) => {
12
12
  const [t, d] = h(""), [l, f] = h(""), i = b(!1), n = b(!1);
13
13
  if (z(() => {
14
14
  a && (i.current = !1, n.current = !1);
15
15
  }, [a]), r.length === 0) return null;
16
- const c = M && t === r[r.length - 1], T = !t || c && !l.trim(), p = () => {
16
+ const c = D && t === r[r.length - 1], T = !t || c && !l.trim(), p = () => {
17
17
  d(""), f("");
18
- }, A = (e) => {
19
- if (e === "backdropClick" || e === "escapeKeyDown") return e;
18
+ }, A = (o) => {
19
+ if (o === "backdropClick" || o === "escapeKeyDown") return o;
20
20
  if (!n.current) return "closeButton";
21
- }, B = (e, w) => {
21
+ }, I = (o, w) => {
22
22
  const _ = A(w);
23
- p(), v(_);
24
- }, I = () => {
25
- n.current = !0, R?.();
23
+ p(), x(_);
24
+ }, B = () => {
25
+ n.current = !0, M?.();
26
26
  }, P = () => {
27
- i.current || (i.current = !0, D?.());
27
+ i.current || (i.current = !0, R?.());
28
28
  };
29
- return /* @__PURE__ */ x(j, {
29
+ return /* @__PURE__ */ v(j, {
30
30
  copy: {
31
31
  title: s,
32
32
  close_aria: F
33
33
  },
34
34
  disablePrimaryButton: T,
35
35
  isOpen: a,
36
- onClose: B,
36
+ onClose: I,
37
37
  onPrimaryAction: () => {
38
38
  n.current = !0, C(t, c ? l.trim() : void 0), p();
39
39
  },
40
- onSecondaryAction: I,
40
+ onSecondaryAction: B,
41
41
  primaryText: k,
42
42
  secondaryText: S,
43
43
  sx: {
@@ -59,44 +59,47 @@ var $ = 250, oe = ({ isOpen: a, onClose: v, onSubmit: C, title: s, options: r, c
59
59
  }
60
60
  },
61
61
  children: [
62
- u && /* @__PURE__ */ o(g, {
63
- sx: { mb: 8 },
62
+ u && /* @__PURE__ */ e(g, {
63
+ sx: { mb: 16 },
64
64
  variant: "body1",
65
65
  children: u
66
66
  }),
67
- /* @__PURE__ */ o(K, { children: /* @__PURE__ */ o(W, {
67
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(W, {
68
68
  "aria-label": s,
69
69
  name: "feedback-radio-group",
70
- onChange: (e) => d(e.target.value),
70
+ onChange: (o) => d(o.target.value),
71
71
  value: t,
72
- children: r.map((e) => /* @__PURE__ */ o(L, {
73
- control: /* @__PURE__ */ o(H, { sx: { "& .MuiSvgIcon-root": {
74
- fontSize: 22,
75
- color: "action.active"
76
- } } }),
77
- label: e,
72
+ children: r.map((o) => /* @__PURE__ */ e(L, {
73
+ control: /* @__PURE__ */ e(H, {
74
+ color: "primary",
75
+ sx: {
76
+ "& .MuiSvgIcon-root": { fontSize: 22 },
77
+ "&:not(.Mui-checked) .MuiSvgIcon-root": { color: "action.active" }
78
+ }
79
+ }),
80
+ label: o,
78
81
  sx: { "& .MuiFormControlLabel-label": {
79
82
  color: "text.primary",
80
83
  fontSize: 15
81
84
  } },
82
- value: e
83
- }, e))
85
+ value: o
86
+ }, o))
84
87
  }) }),
85
- c && /* @__PURE__ */ x(E, {
88
+ c && /* @__PURE__ */ v(E, {
86
89
  sx: {
87
90
  gap: 3,
88
91
  mt: 4
89
92
  },
90
- children: [/* @__PURE__ */ o(G, {
93
+ children: [/* @__PURE__ */ e(G, {
91
94
  autoFocus: !0,
92
95
  maxRows: 4,
93
96
  minRows: 4,
94
97
  multiline: !0,
95
- onChange: (e) => f(e.target.value),
98
+ onChange: (o) => f(o.target.value),
96
99
  onFocus: P,
97
100
  slotProps: { htmlInput: { maxLength: y } },
98
101
  value: l
99
- }), m && /* @__PURE__ */ o(g, {
102
+ }), m && /* @__PURE__ */ e(g, {
100
103
  sx: {
101
104
  color: "text.secondary",
102
105
  fontWeight: 400
@@ -109,7 +112,7 @@ var $ = 250, oe = ({ isOpen: a, onClose: v, onSubmit: C, title: s, options: r, c
109
112
  });
110
113
  };
111
114
  export {
112
- oe as default
115
+ eo as default
113
116
  };
114
117
 
115
118
  //# sourceMappingURL=FeedbackDialog.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackDialog.es.js","names":[],"sources":["../../../src/insights-v2/components/FeedbackDialog.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\n\nimport FormControl from '@mui/material/FormControl'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport Radio from '@mui/material/Radio'\nimport RadioGroup from '@mui/material/RadioGroup'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { Dialog } from '../../common'\n\nconst CHARACTER_LIMIT = 250\n\nexport type FeedbackDialogCloseReason = 'closeButton' | 'backdropClick' | 'escapeKeyDown'\n\nexport interface FeedbackDialogProps {\n title: string\n options: string[]\n characterLimit?: number\n /** Optional paragraph rendered between the title and the options (Figma feedback survey). */\n description?: string\n characterLimitLabel?: string\n isOpen: boolean\n onSubmit: (option: string, detail?: string) => void\n /** Called on every close; `reason` is set for user-initiated closes (X/backdrop/escape), undefined on submit/back. */\n onClose: (reason?: FeedbackDialogCloseReason) => void\n onBackClick?: () => void\n onTextInputFocus?: () => void\n secondaryText: string\n primaryText: string\n closeAriaLabel: string\n /** Whether the last option reveals a required free-text field (default true). */\n showDetailField?: boolean\n}\n\n/** Generic feedback survey dialog. Last option shows detail text field. */\nconst FeedbackDialog = ({\n isOpen,\n onClose,\n onSubmit,\n title,\n options,\n characterLimit = CHARACTER_LIMIT,\n description,\n characterLimitLabel,\n secondaryText,\n primaryText,\n closeAriaLabel,\n onBackClick,\n onTextInputFocus,\n showDetailField = true,\n}: FeedbackDialogProps) => {\n const [selected, setSelected] = useState('')\n const [detail, setDetail] = useState('')\n const hasTrackedFocus = useRef(false)\n const skipCloseAnalytics = useRef(false)\n\n useEffect(() => {\n if (isOpen) {\n hasTrackedFocus.current = false\n skipCloseAnalytics.current = false\n }\n }, [isOpen])\n\n if (options.length === 0) return null\n\n const isOther = showDetailField && selected === options[options.length - 1]\n const isSubmitDisabled = !selected || (isOther && !detail.trim())\n\n const reset = () => {\n setSelected('')\n setDetail('')\n }\n\n const resolveCloseReason = (reason?: string): FeedbackDialogCloseReason | undefined => {\n if (reason === 'backdropClick' || reason === 'escapeKeyDown') return reason\n if (!skipCloseAnalytics.current) return 'closeButton'\n return undefined\n }\n\n const handleClose = (_event?: unknown, reason?: string) => {\n const closeReason = resolveCloseReason(reason)\n reset()\n onClose(closeReason)\n }\n\n const handleBack = () => {\n skipCloseAnalytics.current = true\n onBackClick?.()\n }\n\n const handleTextFocus = () => {\n if (!hasTrackedFocus.current) {\n hasTrackedFocus.current = true\n onTextInputFocus?.()\n }\n }\n\n const handleSubmit = () => {\n skipCloseAnalytics.current = true\n onSubmit(selected, isOther ? detail.trim() : undefined)\n reset()\n }\n\n return (\n <Dialog\n copy={{ title, close_aria: closeAriaLabel }}\n disablePrimaryButton={isSubmitDisabled}\n isOpen={isOpen}\n onClose={handleClose}\n onPrimaryAction={handleSubmit}\n onSecondaryAction={handleBack}\n primaryText={primaryText}\n secondaryText={secondaryText}\n sx={{\n '& .MuiDialogContent-root': { py: 0 },\n '& .MuiDialog-paperScrollPaper': { bgcolor: 'background.paper' },\n '& .MuiDialog-paper': {\n outline: 'none',\n '&:focus-visible': {\n outline: '2px solid',\n outlineColor: 'primary.main',\n },\n },\n '& .MuiButton-outlined': {\n border: 'none',\n '&:hover': { bgcolor: 'transparent', border: 'none' },\n },\n }}\n >\n {description && (\n <Text sx={{ mb: 8 }} variant=\"body1\">\n {description}\n </Text>\n )}\n <FormControl>\n <RadioGroup\n aria-label={title}\n name=\"feedback-radio-group\"\n onChange={(e) => setSelected(e.target.value)}\n value={selected}\n >\n {options.map((option) => (\n <FormControlLabel\n control={\n <Radio\n sx={{\n '& .MuiSvgIcon-root': {\n fontSize: 22,\n color: 'action.active',\n },\n }}\n />\n }\n key={option}\n label={option}\n sx={{\n '& .MuiFormControlLabel-label': {\n color: 'text.primary',\n fontSize: 15,\n },\n }}\n value={option}\n />\n ))}\n </RadioGroup>\n </FormControl>\n\n {isOther && (\n <Stack sx={{ gap: 3, mt: 4 }}>\n <TextField\n autoFocus\n maxRows={4}\n minRows={4}\n multiline={true}\n onChange={(e) => setDetail(e.target.value)}\n onFocus={handleTextFocus}\n slotProps={{ htmlInput: { maxLength: characterLimit } }}\n value={detail}\n />\n {characterLimitLabel && (\n <Text sx={{ color: 'text.secondary', fontWeight: 400 }} variant=\"subtitle2\">\n {characterLimitLabel}\n </Text>\n )}\n </Stack>\n )}\n </Dialog>\n )\n}\n\nexport default FeedbackDialog\n"],"mappings":";;;;;;;;;;AAaA,IAAM,IAAkB,KAyBlB,KAAA,CAAkB,EACtB,QAAA,GACA,SAAA,GACA,UAAA,GACA,OAAA,GACA,SAAA,GACA,gBAAA,IAAiB,GACjB,aAAA,GACA,qBAAA,GACA,eAAA,GACA,aAAA,GACA,gBAAA,GACA,aAAA,GACA,kBAAA,GACA,iBAAA,IAAkB,GAAA,MACO;AACzB,QAAM,CAAC,GAAU,CAAA,IAAe,EAAS,EAAE,GACrC,CAAC,GAAQ,CAAA,IAAa,EAAS,EAAE,GACjC,IAAkB,EAAO,EAAK,GAC9B,IAAqB,EAAO,EAAK;AASvC,MAPA,EAAA,MAAgB;AACd,IAAI,MACF,EAAgB,UAAU,IAC1B,EAAmB,UAAU;AAAA,EAEjC,GAAG,CAAC,CAAM,CAAC,GAEP,EAAQ,WAAW,EAAG,QAAO;AAEjC,QAAM,IAAU,KAAmB,MAAa,EAAQ,EAAQ,SAAS,CAAA,GACnE,IAAmB,CAAC,KAAa,KAAW,CAAC,EAAO,KAAK,GAEzD,IAAA,MAAc;AAClB,IAAA,EAAY,EAAE,GACd,EAAU,EAAE;AAAA,EACd,GAEM,IAAA,CAAsB,MAA2D;AACrF,QAAI,MAAW,mBAAmB,MAAW,gBAAiB,QAAO;AACrE,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,UAAA,CAAW,MAAM,EAAY,EAAE,OAAO,KAAK;AAAA,QAC3C,OAAO;AAAA,QAEN,UAAA,EAAQ,IAAA,CAAK,MACZ,gBAAA,EAAC,GAAD;AAAA,UACE,SACE,gBAAA,EAAC,GAAD,EACE,IAAI,EACF,sBAAsB;AAAA,YACpB,UAAU;AAAA,YACV,OAAO;AAAA,UACT,EACF,EACD,CAAA;AAAA,UAGH,OAAO;AAAA,UACP,IAAI,EACF,gCAAgC;AAAA,YAC9B,OAAO;AAAA,YACP,UAAU;AAAA,UACZ,EACF;AAAA,UACA,OAAO;AAAA,QACR,GATM,CASN,CACF;AAAA,MACS,CAAA,EACD,CAAA;AAAA,MAEZ,KACC,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,KAAK;AAAA,UAAG,IAAI;AAAA,QAAE;AAAA,QAA3B,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UACE,WAAA;AAAA,UACA,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,UACX,UAAA,CAAW,MAAM,EAAU,EAAE,OAAO,KAAK;AAAA,UACzC,SAAS;AAAA,UACT,WAAW,EAAE,WAAW,EAAE,WAAW,EAAe,EAAE;AAAA,UACtD,OAAO;AAAA,QACR,CAAA,GACA,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,IAAI;AAAA,YAAE,OAAO;AAAA,YAAkB,YAAY;AAAA,UAAI;AAAA,UAAG,SAAQ;AAAA,UAC7D,UAAA;AAAA,QACG,CAAA,CAEH;AAAA;IAEH;AAAA;AAEZ"}
1
+ {"version":3,"file":"FeedbackDialog.es.js","names":[],"sources":["../../../src/insights-v2/components/FeedbackDialog.tsx"],"sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from 'react'\n\nimport FormControl from '@mui/material/FormControl'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport Radio from '@mui/material/Radio'\nimport RadioGroup from '@mui/material/RadioGroup'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { Dialog } from '../../common'\n\nconst CHARACTER_LIMIT = 250\n\nexport type FeedbackDialogCloseReason = 'closeButton' | 'backdropClick' | 'escapeKeyDown'\n\nexport interface FeedbackDialogProps {\n title: string\n options: string[]\n characterLimit?: number\n /**\n * Optional paragraph rendered between the title and the options (Figma feedback survey). A node, so\n * the caller can emphasise part of it (Set Up Direct Deposit's semibold account name).\n */\n description?: ReactNode\n characterLimitLabel?: string\n isOpen: boolean\n onSubmit: (option: string, detail?: string) => void\n /** Called on every close; `reason` is set for user-initiated closes (X/backdrop/escape), undefined on submit/back. */\n onClose: (reason?: FeedbackDialogCloseReason) => void\n onBackClick?: () => void\n onTextInputFocus?: () => void\n secondaryText: string\n primaryText: string\n closeAriaLabel: string\n /** Whether the last option reveals a required free-text field (default true). */\n showDetailField?: boolean\n}\n\n/** Generic feedback survey dialog. Last option shows detail text field. */\nconst FeedbackDialog = ({\n isOpen,\n onClose,\n onSubmit,\n title,\n options,\n characterLimit = CHARACTER_LIMIT,\n description,\n characterLimitLabel,\n secondaryText,\n primaryText,\n closeAriaLabel,\n onBackClick,\n onTextInputFocus,\n showDetailField = true,\n}: FeedbackDialogProps) => {\n const [selected, setSelected] = useState('')\n const [detail, setDetail] = useState('')\n const hasTrackedFocus = useRef(false)\n const skipCloseAnalytics = useRef(false)\n\n useEffect(() => {\n if (isOpen) {\n hasTrackedFocus.current = false\n skipCloseAnalytics.current = false\n }\n }, [isOpen])\n\n if (options.length === 0) return null\n\n const isOther = showDetailField && selected === options[options.length - 1]\n const isSubmitDisabled = !selected || (isOther && !detail.trim())\n\n const reset = () => {\n setSelected('')\n setDetail('')\n }\n\n const resolveCloseReason = (reason?: string): FeedbackDialogCloseReason | undefined => {\n if (reason === 'backdropClick' || reason === 'escapeKeyDown') return reason\n if (!skipCloseAnalytics.current) return 'closeButton'\n return undefined\n }\n\n const handleClose = (_event?: unknown, reason?: string) => {\n const closeReason = resolveCloseReason(reason)\n reset()\n onClose(closeReason)\n }\n\n const handleBack = () => {\n skipCloseAnalytics.current = true\n onBackClick?.()\n }\n\n const handleTextFocus = () => {\n if (!hasTrackedFocus.current) {\n hasTrackedFocus.current = true\n onTextInputFocus?.()\n }\n }\n\n const handleSubmit = () => {\n skipCloseAnalytics.current = true\n onSubmit(selected, isOther ? detail.trim() : undefined)\n reset()\n }\n\n return (\n <Dialog\n copy={{ title, close_aria: closeAriaLabel }}\n disablePrimaryButton={isSubmitDisabled}\n isOpen={isOpen}\n onClose={handleClose}\n onPrimaryAction={handleSubmit}\n onSecondaryAction={handleBack}\n primaryText={primaryText}\n secondaryText={secondaryText}\n sx={{\n '& .MuiDialogContent-root': { py: 0 },\n '& .MuiDialog-paperScrollPaper': { bgcolor: 'background.paper' },\n '& .MuiDialog-paper': {\n outline: 'none',\n '&:focus-visible': {\n outline: '2px solid',\n outlineColor: 'primary.main',\n },\n },\n '& .MuiButton-outlined': {\n border: 'none',\n '&:hover': { bgcolor: 'transparent', border: 'none' },\n },\n }}\n >\n {/* Figma 1941:192803: 16px between the description and the radio group. */}\n {description && (\n <Text sx={{ mb: 16 }} variant=\"body1\">\n {description}\n </Text>\n )}\n <FormControl>\n <RadioGroup\n aria-label={title}\n name=\"feedback-radio-group\"\n onChange={(e) => setSelected(e.target.value)}\n value={selected}\n >\n {options.map((option) => (\n <FormControlLabel\n control={\n // Figma: an unselected radio is `action.active`, the selected one `primary`.\n <Radio\n color=\"primary\"\n sx={{\n '& .MuiSvgIcon-root': { fontSize: 22 },\n '&:not(.Mui-checked) .MuiSvgIcon-root': { color: 'action.active' },\n }}\n />\n }\n key={option}\n label={option}\n sx={{\n '& .MuiFormControlLabel-label': {\n color: 'text.primary',\n fontSize: 15,\n },\n }}\n value={option}\n />\n ))}\n </RadioGroup>\n </FormControl>\n\n {isOther && (\n <Stack sx={{ gap: 3, mt: 4 }}>\n <TextField\n autoFocus\n maxRows={4}\n minRows={4}\n multiline={true}\n onChange={(e) => setDetail(e.target.value)}\n onFocus={handleTextFocus}\n slotProps={{ htmlInput: { maxLength: characterLimit } }}\n value={detail}\n />\n {characterLimitLabel && (\n <Text sx={{ color: 'text.secondary', fontWeight: 400 }} variant=\"subtitle2\">\n {characterLimitLabel}\n </Text>\n )}\n </Stack>\n )}\n </Dialog>\n )\n}\n\nexport default FeedbackDialog\n"],"mappings":";;;;;;;;;;AAaA,IAAM,IAAkB,KA4BlB,KAAA,CAAkB,EACtB,QAAA,GACA,SAAA,GACA,UAAA,GACA,OAAA,GACA,SAAA,GACA,gBAAA,IAAiB,GACjB,aAAA,GACA,qBAAA,GACA,eAAA,GACA,aAAA,GACA,gBAAA,GACA,aAAA,GACA,kBAAA,GACA,iBAAA,IAAkB,GAAA,MACO;AACzB,QAAM,CAAC,GAAU,CAAA,IAAe,EAAS,EAAE,GACrC,CAAC,GAAQ,CAAA,IAAa,EAAS,EAAE,GACjC,IAAkB,EAAO,EAAK,GAC9B,IAAqB,EAAO,EAAK;AASvC,MAPA,EAAA,MAAgB;AACd,IAAI,MACF,EAAgB,UAAU,IAC1B,EAAmB,UAAU;AAAA,EAEjC,GAAG,CAAC,CAAM,CAAC,GAEP,EAAQ,WAAW,EAAG,QAAO;AAEjC,QAAM,IAAU,KAAmB,MAAa,EAAQ,EAAQ,SAAS,CAAA,GACnE,IAAmB,CAAC,KAAa,KAAW,CAAC,EAAO,KAAK,GAEzD,IAAA,MAAc;AAClB,IAAA,EAAY,EAAE,GACd,EAAU,EAAE;AAAA,EACd,GAEM,IAAA,CAAsB,MAA2D;AACrF,QAAI,MAAW,mBAAmB,MAAW,gBAAiB,QAAO;AACrE,QAAI,CAAC,EAAmB,QAAS,QAAO;AAAA,EAE1C,GAEM,IAAA,CAAe,GAAkB,MAAoB;AACzD,UAAM,IAAc,EAAmB,CAAM;AAC7C,IAAA,EAAM,GACN,EAAQ,CAAW;AAAA,EACrB,GAEM,IAAA,MAAmB;AACvB,IAAA,EAAmB,UAAU,IAC7B,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AsB,EAAE,UAAU,GAAG;AAAA,cACrC,wCAAwC,EAAE,OAAO,gBAAgB;AAAA,YACnE;AAAA,UACD,CAAA;AAAA,UAGH,OAAO;AAAA,UACP,IAAI,EACF,gCAAgC;AAAA,YAC9B,OAAO;AAAA,YACP,UAAU;AAAA,UACZ,EACF;AAAA,UACA,OAAO;AAAA,QACR,GATM,CASN,CACF;AAAA,MACS,CAAA,EACD,CAAA;AAAA,MAEZ,KACC,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,KAAK;AAAA,UAAG,IAAI;AAAA,QAAE;AAAA,QAA3B,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UACE,WAAA;AAAA,UACA,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,UACX,UAAA,CAAW,MAAM,EAAU,EAAE,OAAO,KAAK;AAAA,UACzC,SAAS;AAAA,UACT,WAAW,EAAE,WAAW,EAAE,WAAW,EAAe,EAAE;AAAA,UACtD,OAAO;AAAA,QACR,CAAA,GACA,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,IAAI;AAAA,YAAE,OAAO;AAAA,YAAkB,YAAY;AAAA,UAAI;AAAA,UAAG,SAAQ;AAAA,UAC7D,UAAA;AAAA,QACG,CAAA,CAEH;AAAA;IAEH;AAAA;AAEZ"}
@@ -1,10 +1,11 @@
1
+ import { ReactNode } from 'react';
1
2
  import { FeedbackDialogCloseReason } from './FeedbackDialog';
2
3
  /** Localized strings the modal renders — resolved by the caller (see FeedbackModalActionBlock). */
3
4
  export interface FeedbackModalContent {
4
5
  /** Dialog title, e.g. "Can you tell us why?". */
5
6
  title: string;
6
- /** Optional paragraph under the title, e.g. "We'd love to hear why…". */
7
- description?: string;
7
+ /** Optional paragraph under the title, e.g. "We'd love to hear why…"; may emphasise part of it. */
8
+ description?: ReactNode;
8
9
  /** Survey reasons; the last option reveals the free-text detail field. */
9
10
  options: string[];
10
11
  /** Primary (Submit) button label. */
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackModal.es.js","names":[],"sources":["../../../src/insights-v2/components/FeedbackModal.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\n\nimport StatusSnackbar from './shared/StatusSnackbar'\n\nimport FeedbackDialog, { type FeedbackDialogCloseReason } from './FeedbackDialog'\n\n/** Localized strings the modal renders — resolved by the caller (see FeedbackModalActionBlock). */\nexport interface FeedbackModalContent {\n /** Dialog title, e.g. \"Can you tell us why?\". */\n title: string\n /** Optional paragraph under the title, e.g. \"We'd love to hear why…\". */\n description?: string\n /** Survey reasons; the last option reveals the free-text detail field. */\n options: string[]\n /** Primary (Submit) button label. */\n submitText: string\n /** Secondary (No thanks) button label. */\n cancelText: string\n /** ARIA label for the dialog close button. */\n closeAriaLabel: string\n /** Helper text under the detail field, e.g. \"250 character limit\". */\n characterLimitLabel?: string\n /** Success snackbar message, e.g. \"Your feedback has been submitted.\". */\n successMessage: string\n /** Error snackbar message, e.g. \"Your feedback could not be submitted.\". */\n errorMessage: string\n /** Error snackbar action label, e.g. \"Try Again\". */\n tryAgainText: string\n /** ARIA label for the snackbar close button. */\n toastCloseAriaLabel: string\n}\n\ninterface FeedbackModalProps {\n isOpen: boolean\n copy: FeedbackModalContent\n /**\n * Fired when the survey is submitted. May return a promise: a rejection\n * switches to the error snackbar (Figma `1941:167637`), whose Try Again\n * action re-submits the same selection. Sync/resolved submissions show the\n * success snackbar.\n */\n onSubmit: (option: string, detail?: string) => void | Promise<void>\n /**\n * Fired when the whole flow ends: the dialog is dismissed without submitting\n * (reason set), or either snackbar is closed / auto-hides (no reason).\n */\n onClose: (reason?: FeedbackDialogCloseReason) => void\n /**\n * When provided, the secondary button acts as \"Back\" — it fires this instead\n * of ending the flow via `onClose` (e.g. SurveyModal returning to its survey\n * step). When absent, the secondary (\"No thanks\") ends the flow as before.\n */\n onBack?: () => void\n /** First focus of the free-text box (analytics). */\n onTextInputFocus?: () => void\n /** Default true. When false a successful submit calls `onClose` (the host confirms); errors still show. */\n showSuccessMessage?: boolean\n /** Default true. When false the last option is a plain choice, with no free-text field. */\n showDetailField?: boolean\n}\n\ntype Phase = 'survey' | 'success' | 'error'\n\n/**\n * The CTA feedback drilldown (Figma `1941:192803`): a \"Can you tell us why?\"\n * survey dialog followed by a success snackbar (Figma `1941:167636`) — or an\n * error snackbar with a Try Again action (Figma `1941:167637`) when the\n * submission fails.\n *\n * Purely presentational — copy arrives resolved via `FeedbackModalContent`;\n * the `feedback_modal_block` action block wires it to the copy store, the beat\n * actions, and the action-drawer session.\n */\nconst FeedbackModal = ({\n copy,\n isOpen,\n onBack,\n onClose,\n onSubmit,\n onTextInputFocus,\n showSuccessMessage = true,\n showDetailField = true,\n}: FeedbackModalProps) => {\n const [phase, setPhase] = useState<Phase>('survey')\n // Ref, not state: the shared Dialog fires `onClose()` synchronously right\n // after `onPrimaryAction()`, before the state update lands. Without the ref\n // that close would end the whole flow and the snackbar could never show.\n const hasSubmitted = useRef(false)\n // Kept for the error snackbar's Try Again, which re-submits the selection.\n const lastSubmission = useRef<{ option: string; detail?: string } | null>(null)\n\n // A new flow session starts from the survey, not a stale snackbar.\n useEffect(() => {\n if (isOpen) {\n setPhase('survey')\n hasSubmitted.current = false\n lastSubmission.current = null\n }\n }, [isOpen])\n\n const submit = async (option: string, detail?: string) => {\n hasSubmitted.current = true\n lastSubmission.current = { option, detail }\n try {\n await onSubmit(option, detail)\n if (showSuccessMessage) setPhase('success')\n else onClose()\n } catch {\n setPhase('error')\n }\n }\n\n const retry = () => {\n if (lastSubmission.current) {\n void submit(lastSubmission.current.option, lastSubmission.current.detail)\n }\n }\n\n // Ref for the same reason as hasSubmitted: the back-click's trailing Dialog\n // close fires synchronously, before any state lands.\n const backTaken = useRef(false)\n\n const handleBack = onBack\n ? () => {\n backTaken.current = true\n onBack()\n }\n : undefined\n\n // Only user-initiated closes (X / backdrop / escape / No thanks) end the\n // flow — the post-submit close hands over to the snackbar, and a back-click's\n // trailing close belongs to the caller's back navigation.\n const handleDialogClose = (reason?: FeedbackDialogCloseReason) => {\n if (hasSubmitted.current) return\n if (backTaken.current) {\n backTaken.current = false\n return\n }\n onClose(reason)\n }\n\n return (\n <>\n <FeedbackDialog\n characterLimitLabel={copy.characterLimitLabel}\n closeAriaLabel={copy.closeAriaLabel}\n description={copy.description}\n isOpen={isOpen && phase === 'survey' && !hasSubmitted.current}\n onBackClick={handleBack}\n onClose={handleDialogClose}\n onSubmit={(option, detail) => void submit(option, detail)}\n onTextInputFocus={onTextInputFocus}\n options={copy.options}\n primaryText={copy.submitText}\n secondaryText={copy.cancelText}\n showDetailField={showDetailField}\n title={copy.title}\n />\n <StatusSnackbar\n actionText={phase === 'error' ? copy.tryAgainText : undefined}\n closeAriaLabel={copy.toastCloseAriaLabel}\n message={phase === 'error' ? copy.errorMessage : copy.successMessage}\n onActionClick={retry}\n onClose={() => onClose()}\n open={isOpen && phase !== 'survey'}\n severity={phase === 'error' ? 'error' : 'success'}\n />\n </>\n )\n}\n\nexport default FeedbackModal\n"],"mappings":";;;;AAyEA,IAAM,IAAA,CAAiB,EACrB,MAAA,GACA,QAAA,GACA,QAAA,GACA,SAAA,GACA,UAAA,GACA,kBAAA,GACA,oBAAA,IAAqB,IACrB,iBAAA,IAAkB,GAAA,MACM;AACxB,QAAM,CAAC,GAAO,CAAA,IAAY,EAAgB,QAAQ,GAI5C,IAAe,EAAO,EAAK,GAE3B,IAAiB,EAAmD,IAAI;AAG9E,EAAA,EAAA,MAAgB;AACd,IAAI,MACF,EAAS,QAAQ,GACjB,EAAa,UAAU,IACvB,EAAe,UAAU;AAAA,EAE7B,GAAG,CAAC,CAAM,CAAC;AAEX,QAAM,IAAS,OAAO,GAAgB,MAAoB;AACxD,IAAA,EAAa,UAAU,IACvB,EAAe,UAAU;AAAA,MAAE,QAAA;AAAA,MAAQ,QAAA;AAAA,IAAO;AAC1C,QAAI;AACF,YAAM,EAAS,GAAQ,CAAM,GACzB,IAAoB,EAAS,SAAS,IACrC,EAAQ;AAAA,IACf,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tsx"],"sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from 'react'\n\nimport StatusSnackbar from './shared/StatusSnackbar'\n\nimport FeedbackDialog, { type FeedbackDialogCloseReason } from './FeedbackDialog'\n\n/** Localized strings the modal renders — resolved by the caller (see FeedbackModalActionBlock). */\nexport interface FeedbackModalContent {\n /** Dialog title, e.g. \"Can you tell us why?\". */\n title: string\n /** Optional paragraph under the title, e.g. \"We'd love to hear why…\"; may emphasise part of it. */\n description?: ReactNode\n /** Survey reasons; the last option reveals the free-text detail field. */\n options: string[]\n /** Primary (Submit) button label. */\n submitText: string\n /** Secondary (No thanks) button label. */\n cancelText: string\n /** ARIA label for the dialog close button. */\n closeAriaLabel: string\n /** Helper text under the detail field, e.g. \"250 character limit\". */\n characterLimitLabel?: string\n /** Success snackbar message, e.g. \"Your feedback has been submitted.\". */\n successMessage: string\n /** Error snackbar message, e.g. \"Your feedback could not be submitted.\". */\n errorMessage: string\n /** Error snackbar action label, e.g. \"Try Again\". */\n tryAgainText: string\n /** ARIA label for the snackbar close button. */\n toastCloseAriaLabel: string\n}\n\ninterface FeedbackModalProps {\n isOpen: boolean\n copy: FeedbackModalContent\n /**\n * Fired when the survey is submitted. May return a promise: a rejection\n * switches to the error snackbar (Figma `1941:167637`), whose Try Again\n * action re-submits the same selection. Sync/resolved submissions show the\n * success snackbar.\n */\n onSubmit: (option: string, detail?: string) => void | Promise<void>\n /**\n * Fired when the whole flow ends: the dialog is dismissed without submitting\n * (reason set), or either snackbar is closed / auto-hides (no reason).\n */\n onClose: (reason?: FeedbackDialogCloseReason) => void\n /**\n * When provided, the secondary button acts as \"Back\" — it fires this instead\n * of ending the flow via `onClose` (e.g. SurveyModal returning to its survey\n * step). When absent, the secondary (\"No thanks\") ends the flow as before.\n */\n onBack?: () => void\n /** First focus of the free-text box (analytics). */\n onTextInputFocus?: () => void\n /** Default true. When false a successful submit calls `onClose` (the host confirms); errors still show. */\n showSuccessMessage?: boolean\n /** Default true. When false the last option is a plain choice, with no free-text field. */\n showDetailField?: boolean\n}\n\ntype Phase = 'survey' | 'success' | 'error'\n\n/**\n * The CTA feedback drilldown (Figma `1941:192803`): a \"Can you tell us why?\"\n * survey dialog followed by a success snackbar (Figma `1941:167636`) — or an\n * error snackbar with a Try Again action (Figma `1941:167637`) when the\n * submission fails.\n *\n * Purely presentational — copy arrives resolved via `FeedbackModalContent`;\n * the `feedback_modal_block` action block wires it to the copy store, the beat\n * actions, and the action-drawer session.\n */\nconst FeedbackModal = ({\n copy,\n isOpen,\n onBack,\n onClose,\n onSubmit,\n onTextInputFocus,\n showSuccessMessage = true,\n showDetailField = true,\n}: FeedbackModalProps) => {\n const [phase, setPhase] = useState<Phase>('survey')\n // Ref, not state: the shared Dialog fires `onClose()` synchronously right\n // after `onPrimaryAction()`, before the state update lands. Without the ref\n // that close would end the whole flow and the snackbar could never show.\n const hasSubmitted = useRef(false)\n // Kept for the error snackbar's Try Again, which re-submits the selection.\n const lastSubmission = useRef<{ option: string; detail?: string } | null>(null)\n\n // A new flow session starts from the survey, not a stale snackbar.\n useEffect(() => {\n if (isOpen) {\n setPhase('survey')\n hasSubmitted.current = false\n lastSubmission.current = null\n }\n }, [isOpen])\n\n const submit = async (option: string, detail?: string) => {\n hasSubmitted.current = true\n lastSubmission.current = { option, detail }\n try {\n await onSubmit(option, detail)\n if (showSuccessMessage) setPhase('success')\n else onClose()\n } catch {\n setPhase('error')\n }\n }\n\n const retry = () => {\n if (lastSubmission.current) {\n void submit(lastSubmission.current.option, lastSubmission.current.detail)\n }\n }\n\n // Ref for the same reason as hasSubmitted: the back-click's trailing Dialog\n // close fires synchronously, before any state lands.\n const backTaken = useRef(false)\n\n const handleBack = onBack\n ? () => {\n backTaken.current = true\n onBack()\n }\n : undefined\n\n // Only user-initiated closes (X / backdrop / escape / No thanks) end the\n // flow — the post-submit close hands over to the snackbar, and a back-click's\n // trailing close belongs to the caller's back navigation.\n const handleDialogClose = (reason?: FeedbackDialogCloseReason) => {\n if (hasSubmitted.current) return\n if (backTaken.current) {\n backTaken.current = false\n return\n }\n onClose(reason)\n }\n\n return (\n <>\n <FeedbackDialog\n characterLimitLabel={copy.characterLimitLabel}\n closeAriaLabel={copy.closeAriaLabel}\n description={copy.description}\n isOpen={isOpen && phase === 'survey' && !hasSubmitted.current}\n onBackClick={handleBack}\n onClose={handleDialogClose}\n onSubmit={(option, detail) => void submit(option, detail)}\n onTextInputFocus={onTextInputFocus}\n options={copy.options}\n primaryText={copy.submitText}\n secondaryText={copy.cancelText}\n showDetailField={showDetailField}\n title={copy.title}\n />\n <StatusSnackbar\n actionText={phase === 'error' ? copy.tryAgainText : undefined}\n closeAriaLabel={copy.toastCloseAriaLabel}\n message={phase === 'error' ? copy.errorMessage : copy.successMessage}\n onActionClick={retry}\n onClose={() => onClose()}\n open={isOpen && phase !== 'survey'}\n severity={phase === 'error' ? 'error' : 'success'}\n />\n </>\n )\n}\n\nexport default FeedbackModal\n"],"mappings":";;;;AAyEA,IAAM,IAAA,CAAiB,EACrB,MAAA,GACA,QAAA,GACA,QAAA,GACA,SAAA,GACA,UAAA,GACA,kBAAA,GACA,oBAAA,IAAqB,IACrB,iBAAA,IAAkB,GAAA,MACM;AACxB,QAAM,CAAC,GAAO,CAAA,IAAY,EAAgB,QAAQ,GAI5C,IAAe,EAAO,EAAK,GAE3B,IAAiB,EAAmD,IAAI;AAG9E,EAAA,EAAA,MAAgB;AACd,IAAI,MACF,EAAS,QAAQ,GACjB,EAAa,UAAU,IACvB,EAAe,UAAU;AAAA,EAE7B,GAAG,CAAC,CAAM,CAAC;AAEX,QAAM,IAAS,OAAO,GAAgB,MAAoB;AACxD,IAAA,EAAa,UAAU,IACvB,EAAe,UAAU;AAAA,MAAE,QAAA;AAAA,MAAQ,QAAA;AAAA,IAAO;AAC1C,QAAI;AACF,YAAM,EAAS,GAAQ,CAAM,GACzB,IAAoB,EAAS,SAAS,IACrC,EAAQ;AAAA,IACf,QAAQ;AACN,MAAA,EAAS,OAAO;AAAA,IAClB;AAAA,EACF,GAEM,IAAA,MAAc;AAClB,IAAI,EAAe,WACjB,EAAY,EAAe,QAAQ,QAAQ,EAAe,QAAQ,MAAM;AAAA,EAE5E,GAIM,IAAY,EAAO,EAAK,GAExB,IAAa,IAAA,MACT;AACJ,IAAA,EAAU,UAAU,IACpB,EAAO;AAAA,EACT,IACA,QAKE,IAAA,CAAqB,MAAuC;AAChE,QAAI,CAAA,EAAa,SACjB;AAAA,UAAI,EAAU,SAAS;AACrB,QAAA,EAAU,UAAU;AACpB;AAAA,MACF;AACA,MAAA,EAAQ,CAAM;AAAA;AAAA,EAChB;AAEA,SACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,qBAAqB,EAAK;AAAA,IAC1B,gBAAgB,EAAK;AAAA,IACrB,aAAa,EAAK;AAAA,IAClB,QAAQ,KAAU,MAAU,YAAY,CAAC,EAAa;AAAA,IACtD,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAA,CAAW,GAAQ,MAAA;AAAW,MAAK,EAAO,GAAQ,CAAM;AAAA;AAAA,IACtC,kBAAA;AAAA,IAClB,SAAS,EAAK;AAAA,IACd,aAAa,EAAK;AAAA,IAClB,eAAe,EAAK;AAAA,IACH,iBAAA;AAAA,IACjB,OAAO,EAAK;AAAA,EACb,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,IACE,YAAY,MAAU,UAAU,EAAK,eAAe;AAAA,IACpD,gBAAgB,EAAK;AAAA,IACrB,SAAS,MAAU,UAAU,EAAK,eAAe,EAAK;AAAA,IACtD,eAAe;AAAA,IACf,SAAA,MAAe,EAAQ;AAAA,IACvB,MAAM,KAAU,MAAU;AAAA,IAC1B,UAAU,MAAU,UAAU,UAAU;AAAA,EACzC,CAAA,CACD,EAAA,CAAA;AAEN"}
@@ -5,6 +5,7 @@ import { Theme } from '@mui/material/styles';
5
5
  * `backgroundImage`; `DISCOVERED_ACCOUNTS_GRADIENT` and the tile gradients are opaque and stand alone.
6
6
  *
7
7
  * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.
8
+ * - DIRECT_DEPOSIT_COMPLETE_GRADIENT: the direct deposit complete tile.
8
9
  * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.
9
10
  * - celebrateGradient(angle): Figma's Celebrate Gradient at any angle.
10
11
  * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).
@@ -18,6 +19,11 @@ import { Theme } from '@mui/material/styles';
18
19
  * merchant categorization highlights and deposit celebration callouts.
19
20
  */
20
21
  export declare const WARM_LIME_ACCENT_GRADIENT = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)";
22
+ /**
23
+ * Warm → lime wash at 20% behind the Direct Deposit complete tile (Set Up / Switch Direct Deposit).
24
+ * Figma gives it its own angle and stops, so it does not reuse WARM_LIME_ACCENT_GRADIENT.
25
+ */
26
+ export declare const DIRECT_DEPOSIT_COMPLETE_GRADIENT = "linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(173, 248, 44, 0.2) 101.54%)";
21
27
  /** Warm → pink wash behind balance/savings milestones. */
22
28
  export declare const CELEBRATION_GRADIENT = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)";
23
29
  /** Figma Celebrate Gradient; its angle varies per slot. */
@@ -1,22 +1,23 @@
1
1
  import { alpha as a } from "@mui/material/styles";
2
- var i = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)", d = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)", e = (r) => `linear-gradient(${r}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)`, n = e(200.73), E = "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%)", t = "linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)", R = {
2
+ var i = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(173, 248, 43, 0.2) 101.54%)", d = "linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(173, 248, 44, 0.2) 101.54%)", E = "linear-gradient(200.73deg, rgba(255, 223, 152, 0.2) 1.86%, rgba(255, 128, 229, 0.2) 101.54%)", g = (r) => `linear-gradient(${r}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 0.2) 101.54%)`, n = g(200.73), A = "linear-gradient(201deg, rgba(255, 170, 0, 0.25) 1.86%, rgba(255, 68, 0, 0.25) 101.54%)", t = "linear-gradient(256.82deg, rgba(255, 47, 40, 0.2) 1.86%, rgba(255, 0, 72, 0.2) 101.54%)", _ = "linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)", R = {
3
3
  light: "linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)",
4
4
  dark: "linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)"
5
- }, _ = {
5
+ }, T = {
6
6
  light: "linear-gradient(180deg, #94C9B7 0%, #12875E 100%)",
7
7
  dark: "linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)"
8
- }, l = ({ palette: r }) => `linear-gradient(173deg, ${a(r.primary.light, 0.75)} 46.41%, ${a(r.primary.main, 0.75)} 78.14%)`;
8
+ }, I = ({ palette: r }) => `linear-gradient(173deg, ${a(r.primary.light, 0.75)} 46.41%, ${a(r.primary.main, 0.75)} 78.14%)`;
9
9
  export {
10
10
  n as ACCOUNT_CONNECTED_GRADIENT,
11
- d as CELEBRATION_GRADIENT,
12
- A as ERROR_WASH_GRADIENT,
13
- t as FEES_WASH_GRADIENT,
11
+ E as CELEBRATION_GRADIENT,
12
+ d as DIRECT_DEPOSIT_COMPLETE_GRADIENT,
13
+ t as ERROR_WASH_GRADIENT,
14
+ _ as FEES_WASH_GRADIENT,
14
15
  R as PRIMARY_TILE_GRADIENTS,
15
- _ as SUCCESS_TILE_GRADIENTS,
16
+ T as SUCCESS_TILE_GRADIENTS,
16
17
  i as WARM_LIME_ACCENT_GRADIENT,
17
- E as WARNING_WASH_GRADIENT,
18
- e as celebrateGradient,
19
- l as getPrimaryWashGradient
18
+ A as WARNING_WASH_GRADIENT,
19
+ g as celebrateGradient,
20
+ I as getPrimaryWashGradient
20
21
  };
21
22
 
22
23
  //# 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` and the tile gradients are opaque and stand alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.\n * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.\n * - celebrateGradient(angle): Figma's Celebrate Gradient at any angle.\n * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).\n * - ERROR_WASH_GRADIENT: low balance, off-track status.\n * - FEES_WASH_GRADIENT: fees and interest charges.\n * - PRIMARY_TILE_GRADIENTS / SUCCESS_TILE_GRADIENTS: blue and green tiles, per theme mode.\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/** Figma Celebrate Gradient; its angle varies per slot. */\nexport const celebrateGradient = (angleDeg: number) =>\n `linear-gradient(${angleDeg}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 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 = celebrateGradient(200.73)\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%: low balance, off-track status. */\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/** Red → orange wash at 20%: fees and interest charges. */\nexport const FEES_WASH_GRADIENT =\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)'\n\n/** Blue tile, per theme mode (Missing Interest Rate before the rate is added). */\nexport const PRIMARY_TILE_GRADIENTS = {\n light: 'linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)',\n dark: 'linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)',\n} as const\n\n/** Green tile, per theme mode (Missing Interest Rate once the rate is added). */\nexport const SUCCESS_TILE_GRADIENTS = {\n light: 'linear-gradient(180deg, #94C9B7 0%, #12875E 100%)',\n dark: 'linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)',\n} as const\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":";AAqBA,IAAa,IACX,+FAGW,IACX,gGAGW,IAAA,CAAqB,MAChC,mBAAmB,CAAA,0EAWR,IAA6B,EAAkB,MAAM,GAOrD,IACX,0FAGW,IACX,2FAGW,IACX,4FAGW,IAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR,GAGa,IAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR,GAMa,IAAA,CAA0B,EAAE,SAAA,EAAA,MACvC,2BAA2B,EAAM,EAAQ,QAAQ,OAAO,IAAI,CAAA,YAAa,EAAM,EAAQ,QAAQ,MAAM,IAAI,CAAA"}
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` and the tile gradients are opaque and stand alone.\n *\n * - WARM_LIME_ACCENT_GRADIENT: merchant categorization and deposit celebration states.\n * - DIRECT_DEPOSIT_COMPLETE_GRADIENT: the direct deposit complete tile.\n * - CELEBRATION_GRADIENT / ACCOUNT_CONNECTED_GRADIENT: balance milestones, account connected.\n * - celebrateGradient(angle): Figma's Celebrate Gradient at any angle.\n * - WARNING_WASH_GRADIENT: a flagged charge (Unexpected Subscription Payment).\n * - ERROR_WASH_GRADIENT: low balance, off-track status.\n * - FEES_WASH_GRADIENT: fees and interest charges.\n * - PRIMARY_TILE_GRADIENTS / SUCCESS_TILE_GRADIENTS: blue and green tiles, per theme mode.\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/**\n * Warm → lime wash at 20% behind the Direct Deposit complete tile (Set Up / Switch Direct Deposit).\n * Figma gives it its own angle and stops, so it does not reuse WARM_LIME_ACCENT_GRADIENT.\n */\nexport const DIRECT_DEPOSIT_COMPLETE_GRADIENT =\n 'linear-gradient(257deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(173, 248, 44, 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/** Figma Celebrate Gradient; its angle varies per slot. */\nexport const celebrateGradient = (angleDeg: number) =>\n `linear-gradient(${angleDeg}deg, rgba(255, 224, 153, 0.2) 1.86%, rgba(255, 129, 230, 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 = celebrateGradient(200.73)\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%: low balance, off-track status. */\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/** Red → orange wash at 20%: fees and interest charges. */\nexport const FEES_WASH_GRADIENT =\n 'linear-gradient(256.82deg, rgba(227, 39, 39, 0.2) 1.86%, rgba(255, 123, 0, 0.2) 101.54%)'\n\n/** Blue tile, per theme mode (Missing Interest Rate before the rate is added). */\nexport const PRIMARY_TILE_GRADIENTS = {\n light: 'linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)',\n dark: 'linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)',\n} as const\n\n/** Green tile, per theme mode (Missing Interest Rate once the rate is added). */\nexport const SUCCESS_TILE_GRADIENTS = {\n light: 'linear-gradient(180deg, #94C9B7 0%, #12875E 100%)',\n dark: 'linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)',\n} as const\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":";AAsBA,IAAa,IACX,+FAMW,IACX,4FAGW,IACX,gGAGW,IAAA,CAAqB,MAChC,mBAAmB,CAAA,0EAWR,IAA6B,EAAkB,MAAM,GAOrD,IACX,0FAGW,IACX,2FAGW,IACX,4FAGW,IAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR,GAGa,IAAyB;AAAA,EACpC,OAAO;AAAA,EACP,MAAM;AACR,GAMa,IAAA,CAA0B,EAAE,SAAA,EAAA,MACvC,2BAA2B,EAAM,EAAQ,QAAQ,OAAO,IAAI,CAAA,YAAa,EAAM,EAAQ,QAAQ,MAAM,IAAI,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.137",
3
+ "version": "9.7.138",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",