@mx-cartographer/experiences 9.7.117 → 9.7.119
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 +12 -0
- package/dist/cashflow/CashflowMiniWidget.es.js +53 -19
- package/dist/cashflow/CashflowMiniWidget.es.js.map +1 -1
- package/dist/cashflow/components/CashflowWidgetContent.d.ts +1 -0
- package/dist/cashflow/components/CashflowWidgetContent.es.js +173 -137
- package/dist/cashflow/components/CashflowWidgetContent.es.js.map +1 -1
- package/dist/cashflow/components/RemainingCash.d.ts +1 -0
- package/dist/cashflow/components/RemainingCash.es.js +10 -9
- package/dist/cashflow/components/RemainingCash.es.js.map +1 -1
- package/dist/common/components/InformationTooltip.d.ts +1 -0
- package/dist/common/components/InformationTooltip.es.js +16 -16
- package/dist/common/components/InformationTooltip.es.js.map +1 -1
- package/dist/common/components/MiniWidgetContainer.d.ts +13 -0
- package/dist/common/components/MiniWidgetContainer.es.js +63 -55
- package/dist/common/components/MiniWidgetContainer.es.js.map +1 -1
- package/dist/common/components/charts/LineChart.d.ts +5 -1
- package/dist/common/components/charts/LineChart.es.js +124 -122
- package/dist/common/components/charts/LineChart.es.js.map +1 -1
- package/dist/common/components/charts/linechart/CustomLegend.es.js +53 -46
- package/dist/common/components/charts/linechart/CustomLegend.es.js.map +1 -1
- package/dist/common/components/charts/linechart/CustomMark.d.ts +2 -0
- package/dist/common/components/charts/linechart/CustomMark.es.js +72 -35
- package/dist/common/components/charts/linechart/CustomMark.es.js.map +1 -1
- package/dist/common/components/drawer/Drawer.d.ts +3 -0
- package/dist/common/components/drawer/Drawer.es.js +30 -29
- package/dist/common/components/drawer/Drawer.es.js.map +1 -1
- package/dist/common/components/drawer/Header.d.ts +3 -0
- package/dist/common/components/drawer/Header.es.js +51 -45
- package/dist/common/components/drawer/Header.es.js.map +1 -1
- package/dist/core/stores/InsightsV2Store.d.ts +10 -0
- package/dist/core/stores/InsightsV2Store.es.js +15 -7
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/core/types/localization/CashflowCopy.d.ts +1 -0
- package/dist/core/types/localization/TrendsCopy.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +44 -33
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.d.ts +1 -9
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +96 -83
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.d.ts +5 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js +62 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/CreateBudgetDialog.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +212 -145
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.d.ts +3 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js +36 -36
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetSummary.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.d.ts +32 -2
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js +68 -22
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare.d.ts +3 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare.es.js +34 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +61 -61
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js +42 -40
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
- package/dist/insights-v2/actionBlocks/util.d.ts +2 -11
- package/dist/insights-v2/actionBlocks/util.es.js +16 -6
- package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
- package/dist/insights-v2/analytics/analyticsEventsConfig.d.ts +16 -0
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js +19 -2
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +8 -8
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.d.ts +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js +28 -27
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js +4 -4
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +4 -4
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +4 -4
- package/dist/insights-v2/components/BaseLayout.es.js +137 -118
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.d.ts +1 -0
- package/dist/insights-v2/mappings/blocks.es.js +131 -121
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/trends/TrendsMiniWidget.es.js +29 -22
- package/dist/trends/TrendsMiniWidget.es.js.map +1 -1
- package/dist/trends/components/SpendingChart.es.js +53 -17
- package/dist/trends/components/SpendingChart.es.js.map +1 -1
- package/dist/trends/utils/SpendingData.d.ts +2 -0
- package/dist/trends/utils/SpendingData.es.js +70 -43
- package/dist/trends/utils/SpendingData.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,10 +5,12 @@ export type MarkHandlers = {
|
|
|
5
5
|
onMouseEnter?: (dataIndex: number) => void;
|
|
6
6
|
onMouseLeave?: () => void;
|
|
7
7
|
};
|
|
8
|
+
export type MarkVariant = 'default' | 'compact';
|
|
8
9
|
interface CustomMarkProps extends MarkElementProps {
|
|
9
10
|
handlers?: MarkHandlers;
|
|
10
11
|
showLabel: boolean;
|
|
11
12
|
showMark?: boolean;
|
|
13
|
+
variant?: MarkVariant;
|
|
12
14
|
yData: number[];
|
|
13
15
|
style?: React.CSSProperties & {
|
|
14
16
|
markLabelStyles?: React.CSSProperties;
|
|
@@ -1,56 +1,93 @@
|
|
|
1
|
-
import { formatCurrency as
|
|
2
|
-
import { MARKER_SHAPE_PATHS as
|
|
3
|
-
import "react";
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import
|
|
7
|
-
var
|
|
8
|
-
const a =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { formatCurrency as F } from "../../../../core/utils/NumberFormatting.es.js";
|
|
2
|
+
import { MARKER_SHAPE_PATHS as T } from "./utils/markerShapes.es.js";
|
|
3
|
+
import x from "react";
|
|
4
|
+
import { Fragment as k, jsx as h, jsxs as S } from "react/jsx-runtime";
|
|
5
|
+
import { useTheme as B } from "@mui/material/styles";
|
|
6
|
+
import I from "@mui/material/useMediaQuery";
|
|
7
|
+
var P = "M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0", s = 5, R = 12, u = 16, K = (t) => {
|
|
8
|
+
const a = B(), o = t.showLabel, e = t.style, A = e?.markLabelStyles, l = Number(t.x), d = Number(t.y), r = t.variant === "compact", y = t.handlers?.onMarkClick, L = t.handlers?.onMouseEnter, v = t.handlers?.onMouseLeave, _ = I(a.breakpoints.up("sm")), f = x.useRef(null), [w, E] = x.useState(0), b = t.valueFormatterString ? F(t.yData[t.dataIndex], t.valueFormatterString) : String(t.yData[t.dataIndex]), M = _ ? a.typography.body2?.fontSize : a.typography.caption?.fontSize;
|
|
9
|
+
x.useLayoutEffect(() => {
|
|
10
|
+
r && o && E(f.current?.getBBox?.().width ?? 0);
|
|
11
|
+
}, [
|
|
12
|
+
r,
|
|
13
|
+
o,
|
|
14
|
+
b,
|
|
15
|
+
M,
|
|
16
|
+
t.labelFontSize
|
|
17
|
+
]);
|
|
18
|
+
let n = {
|
|
19
|
+
height: 24,
|
|
20
|
+
rx: 3,
|
|
21
|
+
width: 30,
|
|
22
|
+
x: l - 15,
|
|
23
|
+
y: d - 30
|
|
24
|
+
}, c = {
|
|
25
|
+
x: l,
|
|
26
|
+
y: d - 16
|
|
27
|
+
};
|
|
28
|
+
if (r) {
|
|
29
|
+
const m = t.dataIndex === 0 ? "start" : t.dataIndex === t.yData.length - 1 ? "end" : "middle", i = w + 4, g = {
|
|
30
|
+
start: l - s,
|
|
31
|
+
middle: l - i / 2,
|
|
32
|
+
end: l + s - i
|
|
33
|
+
}[m], C = d - s - R;
|
|
34
|
+
n = {
|
|
35
|
+
height: u,
|
|
36
|
+
rx: 2,
|
|
37
|
+
width: i,
|
|
38
|
+
x: g,
|
|
39
|
+
y: C - u
|
|
40
|
+
}, c = {
|
|
41
|
+
x: g + i / 2,
|
|
42
|
+
y: C - u / 2
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ S(k, { children: [o && /* @__PURE__ */ S(k, { children: [t.labelBackgroundColor && /* @__PURE__ */ h("rect", {
|
|
46
|
+
fill: t.labelBackgroundColor,
|
|
47
|
+
height: n.height,
|
|
48
|
+
rx: n.rx,
|
|
49
|
+
width: n.width,
|
|
50
|
+
x: n.x,
|
|
51
|
+
y: n.y
|
|
52
|
+
}), /* @__PURE__ */ h("text", {
|
|
17
53
|
className: "MuiLineChart-markLabel",
|
|
18
54
|
dominantBaseline: "middle",
|
|
19
|
-
fill:
|
|
55
|
+
fill: t.labelFontColor ? t.labelFontColor : a.palette.text.primary,
|
|
56
|
+
ref: f,
|
|
20
57
|
style: {
|
|
21
|
-
fontSize:
|
|
22
|
-
...
|
|
58
|
+
fontSize: t.labelFontSize ? t.labelFontSize : M,
|
|
59
|
+
...A
|
|
23
60
|
},
|
|
24
61
|
textAnchor: "middle",
|
|
25
|
-
x:
|
|
26
|
-
y:
|
|
27
|
-
children:
|
|
28
|
-
})] }),
|
|
29
|
-
cursor:
|
|
30
|
-
d:
|
|
62
|
+
x: c.x,
|
|
63
|
+
y: c.y,
|
|
64
|
+
children: b
|
|
65
|
+
})] }), t.showMark && /* @__PURE__ */ h("path", {
|
|
66
|
+
cursor: y ? "pointer" : "unset",
|
|
67
|
+
d: r ? P : T[t.shape ?? "circle"],
|
|
31
68
|
height: "20px",
|
|
32
|
-
onClick: (
|
|
33
|
-
|
|
69
|
+
onClick: (m) => {
|
|
70
|
+
y?.(m, t.dataIndex);
|
|
34
71
|
},
|
|
35
72
|
onMouseEnter: () => {
|
|
36
|
-
|
|
73
|
+
L?.(t.dataIndex);
|
|
37
74
|
},
|
|
38
75
|
onMouseLeave: () => {
|
|
39
|
-
|
|
76
|
+
v?.();
|
|
40
77
|
},
|
|
41
78
|
style: {
|
|
42
|
-
fill:
|
|
43
|
-
stroke:
|
|
79
|
+
fill: e?.fill ? e.fill : a.palette.background.paper,
|
|
80
|
+
stroke: e?.stroke ? e.stroke : a.palette.primary.main,
|
|
44
81
|
strokeWidth: 2,
|
|
45
|
-
transform: `translate(${
|
|
46
|
-
transformOrigin: `${
|
|
47
|
-
filter:
|
|
82
|
+
transform: `translate(${t.x}px, ${t.y}px)`,
|
|
83
|
+
transformOrigin: `${t.x}px, ${t.y}px`,
|
|
84
|
+
filter: e?.filter ? e.filter : "none"
|
|
48
85
|
},
|
|
49
86
|
width: "20px"
|
|
50
87
|
})] });
|
|
51
88
|
};
|
|
52
89
|
export {
|
|
53
|
-
|
|
90
|
+
K as CustomMark
|
|
54
91
|
};
|
|
55
92
|
|
|
56
93
|
//# sourceMappingURL=CustomMark.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomMark.es.js","names":[],"sources":["../../../../../src/common/components/charts/linechart/CustomMark.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport useMediaQuery from '@mui/material/useMediaQuery'\n\nimport type { MarkElementProps } from '@mui/x-charts'\n\nimport { MARKER_SHAPE_PATHS } from './utils/markerShapes'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nexport type MarkHandlers = {\n onMarkClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter?: (dataIndex: number) => void\n onMouseLeave?: () => void\n}\n\ninterface CustomMarkProps extends MarkElementProps {\n handlers?: MarkHandlers\n showLabel: boolean\n showMark?: boolean\n yData: number[]\n style?: React.CSSProperties & {\n markLabelStyles?: React.CSSProperties\n }\n labelBackgroundColor?: string\n labelFontColor?: string\n labelFontSize?: number\n valueFormatterString?: string\n}\n\nexport const CustomMark: React.FC<CustomMarkProps> = (props) => {\n const theme = useTheme()\n const showLabel = props.showLabel\n const styles = props.style\n const markLabelStyles = styles?.markLabelStyles\n const xNumber = Number(props.x)\n const yNumber = Number(props.y)\n\n const handleMarkClick = props.handlers?.onMarkClick\n const handleMouseEnter = props.handlers?.onMouseEnter\n const handleMouseLeave = props.handlers?.onMouseLeave\n\n const isSmallScreenUp = useMediaQuery(theme.breakpoints.up('sm'))\n\n // Calculate text dimensions for proper background sizing\n const formattedValue = props.valueFormatterString\n ? formatCurrency(props.yData[props.dataIndex], props.valueFormatterString)\n : String(props.yData[props.dataIndex])\n const fontSize = isSmallScreenUp\n ? theme.typography.body2?.fontSize\n : theme.typography.caption?.fontSize\n
|
|
1
|
+
{"version":3,"file":"CustomMark.es.js","names":[],"sources":["../../../../../src/common/components/charts/linechart/CustomMark.tsx"],"sourcesContent":["import React from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport useMediaQuery from '@mui/material/useMediaQuery'\n\nimport type { MarkElementProps } from '@mui/x-charts'\n\nimport { MARKER_SHAPE_PATHS } from './utils/markerShapes'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nexport type MarkHandlers = {\n onMarkClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>, dataIndex: number) => void\n onMouseEnter?: (dataIndex: number) => void\n onMouseLeave?: () => void\n}\n\n// compact: a 10px mark, and a 16px label box that fits its text, 12px above the mark.\n// The first and last label alignment assumes a single series.\nexport type MarkVariant = 'default' | 'compact'\n\nconst COMPACT_MARK_PATH = 'M4,0A4,4,0,1,1,-4,0A4,4,0,1,1,4,0'\nconst COMPACT_MARK_RADIUS = 5\nconst COMPACT_LABEL_GAP = 12\nconst COMPACT_LABEL_HEIGHT = 16\nconst COMPACT_LABEL_PADDING = 2\n\ninterface CustomMarkProps extends MarkElementProps {\n handlers?: MarkHandlers\n showLabel: boolean\n showMark?: boolean\n variant?: MarkVariant\n yData: number[]\n style?: React.CSSProperties & {\n markLabelStyles?: React.CSSProperties\n }\n labelBackgroundColor?: string\n labelFontColor?: string\n labelFontSize?: number\n valueFormatterString?: string\n}\n\nexport const CustomMark: React.FC<CustomMarkProps> = (props) => {\n const theme = useTheme()\n const showLabel = props.showLabel\n const styles = props.style\n const markLabelStyles = styles?.markLabelStyles\n const xNumber = Number(props.x)\n const yNumber = Number(props.y)\n const isCompact = props.variant === 'compact'\n\n const handleMarkClick = props.handlers?.onMarkClick\n const handleMouseEnter = props.handlers?.onMouseEnter\n const handleMouseLeave = props.handlers?.onMouseLeave\n\n const isSmallScreenUp = useMediaQuery(theme.breakpoints.up('sm'))\n const textRef = React.useRef<SVGTextElement>(null)\n const [textWidth, setTextWidth] = React.useState(0)\n\n // Calculate text dimensions for proper background sizing\n const formattedValue = props.valueFormatterString\n ? formatCurrency(props.yData[props.dataIndex], props.valueFormatterString)\n : String(props.yData[props.dataIndex])\n const fontSize = isSmallScreenUp\n ? theme.typography.body2?.fontSize\n : theme.typography.caption?.fontSize\n\n React.useLayoutEffect(() => {\n if (isCompact && showLabel) setTextWidth(textRef.current?.getBBox?.().width ?? 0)\n }, [isCompact, showLabel, formattedValue, fontSize, props.labelFontSize])\n\n let rect = { height: 24, rx: 3, width: 30, x: xNumber - 15, y: yNumber - 30 }\n let text = { x: xNumber, y: yNumber - 16 }\n\n if (isCompact) {\n // The first and last labels line up with the outer edge of their mark, so they stay inside the plot.\n const align =\n props.dataIndex === 0\n ? 'start'\n : props.dataIndex === props.yData.length - 1\n ? 'end'\n : 'middle'\n const width = textWidth + COMPACT_LABEL_PADDING * 2\n const boxX = {\n start: xNumber - COMPACT_MARK_RADIUS,\n middle: xNumber - width / 2,\n end: xNumber + COMPACT_MARK_RADIUS - width,\n }[align]\n const boxBottom = yNumber - COMPACT_MARK_RADIUS - COMPACT_LABEL_GAP\n\n rect = {\n height: COMPACT_LABEL_HEIGHT,\n rx: 2,\n width,\n x: boxX,\n y: boxBottom - COMPACT_LABEL_HEIGHT,\n }\n text = { x: boxX + width / 2, y: boxBottom - COMPACT_LABEL_HEIGHT / 2 }\n }\n\n return (\n <>\n {showLabel && (\n <>\n {props.labelBackgroundColor && (\n <rect\n fill={props.labelBackgroundColor}\n height={rect.height}\n rx={rect.rx}\n width={rect.width}\n x={rect.x}\n y={rect.y}\n />\n )}\n\n <text\n className=\"MuiLineChart-markLabel\"\n dominantBaseline=\"middle\"\n fill={props.labelFontColor ? props.labelFontColor : theme.palette.text.primary}\n ref={textRef}\n style={{\n fontSize: props.labelFontSize ? props.labelFontSize : fontSize,\n ...markLabelStyles,\n }}\n textAnchor=\"middle\"\n x={text.x}\n y={text.y}\n >\n {formattedValue}\n </text>\n </>\n )}\n {props.showMark && (\n <path\n cursor={handleMarkClick ? 'pointer' : 'unset'}\n d={isCompact ? COMPACT_MARK_PATH : MARKER_SHAPE_PATHS[props.shape ?? 'circle']}\n height=\"20px\"\n onClick={(event) => {\n handleMarkClick?.(event, props.dataIndex)\n }}\n onMouseEnter={() => {\n handleMouseEnter?.(props.dataIndex)\n }}\n onMouseLeave={() => {\n handleMouseLeave?.()\n }}\n style={{\n fill: styles?.fill ? styles.fill : theme.palette.background.paper,\n stroke: styles?.stroke ? styles.stroke : theme.palette.primary.main,\n strokeWidth: 2,\n transform: `translate(${props.x}px, ${props.y}px)`,\n transformOrigin: `${props.x}px, ${props.y}px`,\n filter: styles?.filter ? styles.filter : 'none',\n }}\n width=\"20px\"\n />\n )}\n </>\n )\n}\n"],"mappings":";;;;;;AAoBA,IAAM,IAAoB,qCACpB,IAAsB,GACtB,IAAoB,IACpB,IAAuB,IAkBhB,IAAA,CAAyC,MAAU;AAC9D,QAAM,IAAQ,EAAS,GACjB,IAAY,EAAM,WAClB,IAAS,EAAM,OACf,IAAkB,GAAQ,iBAC1B,IAAU,OAAO,EAAM,CAAC,GACxB,IAAU,OAAO,EAAM,CAAC,GACxB,IAAY,EAAM,YAAY,WAE9B,IAAkB,EAAM,UAAU,aAClC,IAAmB,EAAM,UAAU,cACnC,IAAmB,EAAM,UAAU,cAEnC,IAAkB,EAAc,EAAM,YAAY,GAAG,IAAI,CAAC,GAC1D,IAAU,EAAM,OAAuB,IAAI,GAC3C,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,CAAC,GAG5C,IAAiB,EAAM,uBACzB,EAAe,EAAM,MAAM,EAAM,SAAA,GAAY,EAAM,oBAAoB,IACvE,OAAO,EAAM,MAAM,EAAM,SAAA,CAAU,GACjC,IAAW,IACb,EAAM,WAAW,OAAO,WACxB,EAAM,WAAW,SAAS;AAE9B,EAAA,EAAM,gBAAA,MAAsB;AAC1B,IAAI,KAAa,KAAW,EAAa,EAAQ,SAAS,UAAU,EAAE,SAAS,CAAC;AAAA,EAClF,GAAG;AAAA,IAAC;AAAA,IAAW;AAAA,IAAW;AAAA,IAAgB;AAAA,IAAU,EAAM;AAAA,EAAa,CAAC;AAExE,MAAI,IAAO;AAAA,IAAE,QAAQ;AAAA,IAAI,IAAI;AAAA,IAAG,OAAO;AAAA,IAAI,GAAG,IAAU;AAAA,IAAI,GAAG,IAAU;AAAA,EAAG,GACxE,IAAO;AAAA,IAAE,GAAG;AAAA,IAAS,GAAG,IAAU;AAAA,EAAG;AAEzC,MAAI,GAAW;AAEb,UAAM,IACJ,EAAM,cAAc,IAChB,UACA,EAAM,cAAc,EAAM,MAAM,SAAS,IACvC,QACA,UACF,IAAQ,IAAY,GACpB,IAAO;AAAA,MACX,OAAO,IAAU;AAAA,MACjB,QAAQ,IAAU,IAAQ;AAAA,MAC1B,KAAK,IAAU,IAAsB;AAAA,IACvC,EAAE,CAAA,GACI,IAAY,IAAU,IAAsB;AAElD,IAAA,IAAO;AAAA,MACL,QAAQ;AAAA,MACR,IAAI;AAAA,MACJ,OAAA;AAAA,MACA,GAAG;AAAA,MACH,GAAG,IAAY;AAAA,IACjB,GACA,IAAO;AAAA,MAAE,GAAG,IAAO,IAAQ;AAAA,MAAG,GAAG,IAAY,IAAuB;AAAA,IAAE;AAAA,EACxE;AAEA,SACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,KACC,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,EAAM,wBACL,gBAAA,EAAC,QAAD;AAAA,IACE,MAAM,EAAM;AAAA,IACZ,QAAQ,EAAK;AAAA,IACb,IAAI,EAAK;AAAA,IACT,OAAO,EAAK;AAAA,IACZ,GAAG,EAAK;AAAA,IACR,GAAG,EAAK;AAAA,EACT,CAAA,GAGH,gBAAA,EAAC,QAAD;AAAA,IACE,WAAU;AAAA,IACV,kBAAiB;AAAA,IACjB,MAAM,EAAM,iBAAiB,EAAM,iBAAiB,EAAM,QAAQ,KAAK;AAAA,IACvE,KAAK;AAAA,IACL,OAAO;AAAA,MACL,UAAU,EAAM,gBAAgB,EAAM,gBAAgB;AAAA,MACtD,GAAG;AAAA,IACL;AAAA,IACA,YAAW;AAAA,IACX,GAAG,EAAK;AAAA,IACR,GAAG,EAAK;AAAA,IAEP,UAAA;AAAA,EACG,CAAA,CACN,EAAA,CAAA,GAEH,EAAM,YACL,gBAAA,EAAC,QAAD;AAAA,IACE,QAAQ,IAAkB,YAAY;AAAA,IACtC,GAAG,IAAY,IAAoB,EAAmB,EAAM,SAAS,QAAA;AAAA,IACrE,QAAO;AAAA,IACP,SAAA,CAAU,MAAU;AAClB,MAAA,IAAkB,GAAO,EAAM,SAAS;AAAA,IAC1C;AAAA,IACA,cAAA,MAAoB;AAClB,MAAA,IAAmB,EAAM,SAAS;AAAA,IACpC;AAAA,IACA,cAAA,MAAoB;AAClB,MAAA,IAAmB;AAAA,IACrB;AAAA,IACA,OAAO;AAAA,MACL,MAAM,GAAQ,OAAO,EAAO,OAAO,EAAM,QAAQ,WAAW;AAAA,MAC5D,QAAQ,GAAQ,SAAS,EAAO,SAAS,EAAM,QAAQ,QAAQ;AAAA,MAC/D,aAAa;AAAA,MACb,WAAW,aAAa,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MAC5C,iBAAiB,GAAG,EAAM,CAAA,OAAQ,EAAM,CAAA;AAAA,MACxC,QAAQ,GAAQ,SAAS,EAAO,SAAS;AAAA,IAC3C;AAAA,IACA,OAAM;AAAA,EACP,CAAA,CAEH,EAAA,CAAA;AAEN"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { default as Button } from '@mui/material/Button';
|
|
3
3
|
import { SxProps } from '@mui/material/styles';
|
|
4
|
+
import { DrawerHeaderAction } from './Header';
|
|
4
5
|
export type CopyObject = {
|
|
5
6
|
close_drawer_aria: string;
|
|
6
7
|
};
|
|
7
8
|
interface DrawerProps {
|
|
8
9
|
ariaLabelClose?: string;
|
|
10
|
+
/** `back` (default) or `close`, see DrawerHeader. */
|
|
11
|
+
headerAction?: DrawerHeaderAction;
|
|
9
12
|
className?: string;
|
|
10
13
|
footerStyles?: SxProps;
|
|
11
14
|
hasSecondaryAction?: boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useFocusReturn as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { useFocusReturn as D } from "../../hooks/useFocusReturn.es.js";
|
|
2
|
+
import F from "./Footer.es.js";
|
|
3
|
+
import j from "./Header.es.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import
|
|
6
|
-
import { Drawer as
|
|
7
|
-
import { jsx as r, jsxs as
|
|
8
|
-
import
|
|
9
|
-
var
|
|
10
|
-
const { onExited:
|
|
11
|
-
return /* @__PURE__ */ r(
|
|
12
|
-
id:
|
|
5
|
+
import C from "@mui/material/Stack";
|
|
6
|
+
import { Drawer as v } from "@mxenabled/mxui";
|
|
7
|
+
import { jsx as r, jsxs as B } from "react/jsx-runtime";
|
|
8
|
+
import M from "@mui/material/Box";
|
|
9
|
+
var I = ({ ariaLabelClose: i = "Close", children: s, headerAction: u, footerStyles: d = {}, hasSecondaryAction: p = !0, id: m, isOpen: e, isPrimaryDisabled: c, onClose: o, onPrimaryAction: t, onSecondaryAction: l, primaryButtonProps: f, primaryColor: n = "primary", primaryText: h, secondaryColor: b = "primary", secondaryText: w, shouldShowHeaderBorders: g = !0, shouldShowHeaderShadow: x = !1, title: a, ...k }) => {
|
|
10
|
+
const { onExited: R, onFocus: S, rootRef: y } = D(e);
|
|
11
|
+
return /* @__PURE__ */ r(v, {
|
|
12
|
+
id: m,
|
|
13
13
|
isOpen: e,
|
|
14
14
|
onClose: o,
|
|
15
15
|
sx: {
|
|
@@ -20,48 +20,49 @@ var G = ({ ariaLabelClose: i = "Close", children: s, footerStyles: u = {}, hasSe
|
|
|
20
20
|
height: "100%",
|
|
21
21
|
"& .MuiToolbar-root": { backgroundColor: "background.paper" }
|
|
22
22
|
},
|
|
23
|
-
...
|
|
23
|
+
...k,
|
|
24
24
|
disableRestoreFocus: !0,
|
|
25
|
-
onFocus:
|
|
26
|
-
ref:
|
|
25
|
+
onFocus: S,
|
|
26
|
+
ref: y,
|
|
27
27
|
slotProps: {
|
|
28
28
|
paper: { "aria-labelledby": `${a?.replace(/\s+/g, "-").toLowerCase()}-header-title` },
|
|
29
|
-
transition: { onExited:
|
|
29
|
+
transition: { onExited: R }
|
|
30
30
|
},
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ B(C, {
|
|
32
32
|
height: "100%",
|
|
33
33
|
justifyContent: "space-between",
|
|
34
34
|
children: [
|
|
35
|
-
/* @__PURE__ */ r(
|
|
35
|
+
/* @__PURE__ */ r(j, {
|
|
36
|
+
action: u,
|
|
36
37
|
ariaLabelClose: i,
|
|
37
38
|
onClose: o,
|
|
38
|
-
shouldShowBorders:
|
|
39
|
-
shouldShowShadow:
|
|
39
|
+
shouldShowBorders: g,
|
|
40
|
+
shouldShowShadow: x,
|
|
40
41
|
title: a
|
|
41
42
|
}),
|
|
42
|
-
/* @__PURE__ */ r(
|
|
43
|
+
/* @__PURE__ */ r(M, {
|
|
43
44
|
height: "100%",
|
|
44
45
|
overflow: "auto",
|
|
45
46
|
children: s
|
|
46
47
|
}),
|
|
47
|
-
t && /* @__PURE__ */ r(
|
|
48
|
-
footerStyles:
|
|
49
|
-
hasSecondaryAction:
|
|
50
|
-
isPrimaryDisabled:
|
|
48
|
+
t && /* @__PURE__ */ r(F, {
|
|
49
|
+
footerStyles: d,
|
|
50
|
+
hasSecondaryAction: p,
|
|
51
|
+
isPrimaryDisabled: c,
|
|
51
52
|
onPrimaryAction: t,
|
|
52
53
|
onSecondaryAction: l ?? o,
|
|
53
|
-
primaryButtonProps:
|
|
54
|
-
primaryColor:
|
|
54
|
+
primaryButtonProps: f,
|
|
55
|
+
primaryColor: n,
|
|
55
56
|
primaryText: h,
|
|
56
|
-
secondaryColor:
|
|
57
|
-
secondaryText:
|
|
57
|
+
secondaryColor: b,
|
|
58
|
+
secondaryText: w
|
|
58
59
|
})
|
|
59
60
|
]
|
|
60
61
|
})
|
|
61
62
|
});
|
|
62
63
|
};
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
I as default
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
//# sourceMappingURL=Drawer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.es.js","names":[],"sources":["../../../../src/common/components/drawer/Drawer.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Drawer as KMuiDrawer } from '@mxenabled/mxui'\n\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nimport Footer from './Footer'\nimport Header from './Header'\n\nexport type CopyObject = {\n close_drawer_aria: string\n}\n\ninterface DrawerProps {\n ariaLabelClose?: string\n className?: string\n footerStyles?: SxProps\n hasSecondaryAction?: boolean\n id?: string\n isOpen: boolean\n isPrimaryDisabled?: boolean\n onClose: () => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryButtonProps?: React.ComponentProps<typeof Button>\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n shouldShowHeaderBorders?: boolean\n shouldShowHeaderShadow?: boolean\n sx?: SxProps\n title: string\n}\n\nconst Drawer: React.FC<React.PropsWithChildren<DrawerProps>> = ({\n ariaLabelClose = 'Close',\n children,\n footerStyles = {},\n hasSecondaryAction = true,\n id,\n isOpen,\n isPrimaryDisabled,\n onClose,\n onPrimaryAction,\n onSecondaryAction,\n primaryButtonProps,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'primary',\n secondaryText,\n shouldShowHeaderBorders = true,\n shouldShowHeaderShadow = false,\n title,\n ...rest\n}) => {\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen)\n\n return (\n <KMuiDrawer\n id={id}\n isOpen={isOpen}\n onClose={onClose}\n sx={{\n '& .MuiDrawer-paper': {\n backgroundColor: 'background.default',\n borderRadius: 0,\n },\n height: '100%',\n '& .MuiToolbar-root': {\n backgroundColor: 'background.paper',\n },\n }}\n {...rest}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{\n paper: {\n 'aria-labelledby': `${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`,\n },\n transition: { onExited },\n }}\n >\n <Stack height=\"100%\" justifyContent=\"space-between\">\n <Header\n ariaLabelClose={ariaLabelClose}\n onClose={onClose}\n shouldShowBorders={shouldShowHeaderBorders}\n shouldShowShadow={shouldShowHeaderShadow}\n title={title}\n />\n\n <Box height=\"100%\" overflow=\"auto\">\n {children}\n </Box>\n\n {onPrimaryAction && (\n <Footer\n footerStyles={footerStyles}\n hasSecondaryAction={hasSecondaryAction}\n isPrimaryDisabled={isPrimaryDisabled}\n onPrimaryAction={onPrimaryAction}\n onSecondaryAction={onSecondaryAction ?? onClose}\n primaryButtonProps={primaryButtonProps}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n )}\n </Stack>\n </KMuiDrawer>\n )\n}\n\nexport default Drawer\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"Drawer.es.js","names":[],"sources":["../../../../src/common/components/drawer/Drawer.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Drawer as KMuiDrawer } from '@mxenabled/mxui'\n\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nimport Footer from './Footer'\nimport Header, { type DrawerHeaderAction } from './Header'\n\nexport type CopyObject = {\n close_drawer_aria: string\n}\n\ninterface DrawerProps {\n ariaLabelClose?: string\n /** `back` (default) or `close`, see DrawerHeader. */\n headerAction?: DrawerHeaderAction\n className?: string\n footerStyles?: SxProps\n hasSecondaryAction?: boolean\n id?: string\n isOpen: boolean\n isPrimaryDisabled?: boolean\n onClose: () => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryButtonProps?: React.ComponentProps<typeof Button>\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n shouldShowHeaderBorders?: boolean\n shouldShowHeaderShadow?: boolean\n sx?: SxProps\n title: string\n}\n\nconst Drawer: React.FC<React.PropsWithChildren<DrawerProps>> = ({\n ariaLabelClose = 'Close',\n children,\n headerAction,\n footerStyles = {},\n hasSecondaryAction = true,\n id,\n isOpen,\n isPrimaryDisabled,\n onClose,\n onPrimaryAction,\n onSecondaryAction,\n primaryButtonProps,\n primaryColor = 'primary',\n primaryText,\n secondaryColor = 'primary',\n secondaryText,\n shouldShowHeaderBorders = true,\n shouldShowHeaderShadow = false,\n title,\n ...rest\n}) => {\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen)\n\n return (\n <KMuiDrawer\n id={id}\n isOpen={isOpen}\n onClose={onClose}\n sx={{\n '& .MuiDrawer-paper': {\n backgroundColor: 'background.default',\n borderRadius: 0,\n },\n height: '100%',\n '& .MuiToolbar-root': {\n backgroundColor: 'background.paper',\n },\n }}\n {...rest}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{\n paper: {\n 'aria-labelledby': `${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`,\n },\n transition: { onExited },\n }}\n >\n <Stack height=\"100%\" justifyContent=\"space-between\">\n <Header\n action={headerAction}\n ariaLabelClose={ariaLabelClose}\n onClose={onClose}\n shouldShowBorders={shouldShowHeaderBorders}\n shouldShowShadow={shouldShowHeaderShadow}\n title={title}\n />\n\n <Box height=\"100%\" overflow=\"auto\">\n {children}\n </Box>\n\n {onPrimaryAction && (\n <Footer\n footerStyles={footerStyles}\n hasSecondaryAction={hasSecondaryAction}\n isPrimaryDisabled={isPrimaryDisabled}\n onPrimaryAction={onPrimaryAction}\n onSecondaryAction={onSecondaryAction ?? onClose}\n primaryButtonProps={primaryButtonProps}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n )}\n </Stack>\n </KMuiDrawer>\n )\n}\n\nexport default Drawer\n"],"mappings":";;;;;;;;AA0CA,IAAM,IAAA,CAA0D,EAC9D,gBAAA,IAAiB,SACjB,UAAA,GACA,cAAA,GACA,cAAA,IAAe,CAAC,GAChB,oBAAA,IAAqB,IACrB,IAAA,GACA,QAAA,GACA,mBAAA,GACA,SAAA,GACA,iBAAA,GACA,mBAAA,GACA,oBAAA,GACA,cAAA,IAAe,WACf,aAAA,GACA,gBAAA,IAAiB,WACjB,eAAA,GACA,yBAAA,IAA0B,IAC1B,wBAAA,IAAyB,IACzB,OAAA,GACA,GAAG,EAAA,MACC;AACJ,QAAM,EAAE,UAAA,GAAU,SAAA,GAAS,SAAA,EAAA,IAAY,EAAe,CAAM;AAE5D,SACE,gBAAA,EAAC,GAAD;AAAA,IACM,IAAA;AAAA,IACI,QAAA;AAAA,IACC,SAAA;AAAA,IACT,IAAI;AAAA,MACF,sBAAsB;AAAA,QACpB,iBAAiB;AAAA,QACjB,cAAc;AAAA,MAChB;AAAA,MACA,QAAQ;AAAA,MACR,sBAAsB,EACpB,iBAAiB,mBACnB;AAAA,IACF;AAAA,IACA,GAAI;AAAA,IACJ,qBAAqB;AAAA,IACZ,SAAA;AAAA,IACT,KAAK;AAAA,IACL,WAAW;AAAA,MACT,OAAO,EACL,mBAAmB,GAAG,GAAO,QAAQ,QAAQ,GAAG,EAAE,YAAY,CAAA,gBAChE;AAAA,MACA,YAAY,EAAE,UAAA,EAAS;AAAA,IACzB;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,QAAO;AAAA,MAAO,gBAAe;AAAA,MAApC,UAAA;AAAA,QACE,gBAAA,EAAC,GAAD;AAAA,UACE,QAAQ;AAAA,UACQ,gBAAA;AAAA,UACP,SAAA;AAAA,UACT,mBAAmB;AAAA,UACnB,kBAAkB;AAAA,UACX,OAAA;AAAA,QACR,CAAA;AAAA,QAED,gBAAA,EAAC,GAAD;AAAA,UAAK,QAAO;AAAA,UAAO,UAAS;AAAA,UACzB,UAAA;AAAA,QACE,CAAA;AAAA,QAEJ,KACC,gBAAA,EAAC,GAAD;AAAA,UACgB,cAAA;AAAA,UACM,oBAAA;AAAA,UACD,mBAAA;AAAA,UACF,iBAAA;AAAA,UACjB,mBAAmB,KAAqB;AAAA,UACpB,oBAAA;AAAA,UACN,cAAA;AAAA,UACD,aAAA;AAAA,UACG,gBAAA;AAAA,UACD,eAAA;AAAA,QAChB,CAAA;AAAA,MAEE;AAAA;EACG,CAAA;AAEhB"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/** `back` (default): an arrow on the left. `close`: an X on the right, as Figma's Budget Details. */
|
|
3
|
+
export type DrawerHeaderAction = 'back' | 'close';
|
|
2
4
|
interface DrawerHeaderProps {
|
|
5
|
+
action?: DrawerHeaderAction;
|
|
3
6
|
ariaLabelClose: string;
|
|
4
7
|
onClose: () => void;
|
|
5
8
|
shouldShowBorders: boolean;
|
|
@@ -1,52 +1,58 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import
|
|
3
|
-
import { H2 as
|
|
4
|
-
import { ArrowBack as
|
|
5
|
-
import { jsx as r, jsxs as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
var
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
borderBottom: 1,
|
|
16
|
-
borderColor: "divider"
|
|
17
|
-
},
|
|
18
|
-
...p && { boxShadow: "0px 2px 8px 0px #6A73811F" },
|
|
19
|
-
padding: "8px 8px 8px 8px"
|
|
20
|
-
},
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ r(n, {
|
|
23
|
-
"aria-label": a,
|
|
24
|
-
autoFocus: !0,
|
|
2
|
+
import s from "@mui/material/Stack";
|
|
3
|
+
import { H2 as x } from "@mxenabled/mxui";
|
|
4
|
+
import { ArrowBack as m, Close as b } from "@mxenabled/mx-icons";
|
|
5
|
+
import { jsx as r, jsxs as f } from "react/jsx-runtime";
|
|
6
|
+
import i from "@mui/material/Box";
|
|
7
|
+
import u from "@mui/material/IconButton";
|
|
8
|
+
var S = ({ action: c = "back", ariaLabelClose: n, onClose: p, shouldShowBorders: d, shouldShowShadow: l, title: e }) => {
|
|
9
|
+
const o = c === "back", a = /* @__PURE__ */ r(u, {
|
|
10
|
+
"aria-label": n,
|
|
11
|
+
autoFocus: !0,
|
|
12
|
+
color: o ? "primary" : "default",
|
|
13
|
+
onClick: p,
|
|
14
|
+
children: o ? /* @__PURE__ */ r(m, {
|
|
25
15
|
color: "primary",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
sx: { fontSize: 22 }
|
|
17
|
+
}) : /* @__PURE__ */ r(b, { sx: {
|
|
18
|
+
color: "action.active",
|
|
19
|
+
fontSize: 22
|
|
20
|
+
} })
|
|
21
|
+
}), t = /* @__PURE__ */ r(i, { width: "44px" });
|
|
22
|
+
return /* @__PURE__ */ f(s, {
|
|
23
|
+
"aria-labelledby": `${e?.replace(/\s+/g, "-").toLowerCase()}-header-title`,
|
|
24
|
+
direction: "row",
|
|
25
|
+
sx: {
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
backgroundColor: "background.paper",
|
|
28
|
+
...d && {
|
|
29
|
+
borderBottom: 1,
|
|
30
|
+
borderColor: "divider"
|
|
37
31
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
...l && { boxShadow: "0px 2px 8px 0px #6A73811F" },
|
|
33
|
+
padding: "8px 8px 8px 8px"
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
o ? a : t,
|
|
37
|
+
/* @__PURE__ */ r(i, {
|
|
38
|
+
sx: {
|
|
39
|
+
flexGrow: 1,
|
|
40
|
+
margin: "auto",
|
|
41
|
+
textAlign: "center"
|
|
42
|
+
},
|
|
43
|
+
children: /* @__PURE__ */ r(x, {
|
|
44
|
+
bold: !0,
|
|
45
|
+
id: `${e?.replace(/\s+/g, "-").toLowerCase()}-header-title`,
|
|
46
|
+
variant: "body1",
|
|
47
|
+
children: e
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
o ? t : a
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
48
54
|
export {
|
|
49
|
-
|
|
55
|
+
S as default
|
|
50
56
|
};
|
|
51
57
|
|
|
52
58
|
//# sourceMappingURL=Header.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.es.js","names":[],"sources":["../../../../src/common/components/drawer/Header.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport IconButton from '@mui/material/IconButton'\n\nimport { ArrowBack } from '@mxenabled/mx-icons'\n\nimport { H2 } from '@mxenabled/mxui'\n\ninterface DrawerHeaderProps {\n ariaLabelClose: string\n onClose: () => void\n shouldShowBorders: boolean\n shouldShowShadow?: boolean\n title: string\n}\n\nconst DrawerHeader: React.FC<DrawerHeaderProps> = ({\n ariaLabelClose,\n onClose,\n shouldShowBorders,\n shouldShowShadow,\n title,\n}) => {\n return (\n <Stack\n aria-labelledby={`${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`}\n direction=\"row\"\n sx={{\n alignItems: 'center',\n backgroundColor: 'background.paper',\n ...(shouldShowBorders && {\n borderBottom: 1,\n borderColor: 'divider',\n }),\n ...(shouldShowShadow && {\n boxShadow: '0px 2px 8px 0px #6A73811F',\n }),\n padding: '8px 8px 8px 8px',\n }}\n >\n
|
|
1
|
+
{"version":3,"file":"Header.es.js","names":[],"sources":["../../../../src/common/components/drawer/Header.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport IconButton from '@mui/material/IconButton'\n\nimport { ArrowBack, Close } from '@mxenabled/mx-icons'\n\nimport { H2 } from '@mxenabled/mxui'\n\n/** `back` (default): an arrow on the left. `close`: an X on the right, as Figma's Budget Details. */\nexport type DrawerHeaderAction = 'back' | 'close'\n\ninterface DrawerHeaderProps {\n action?: DrawerHeaderAction\n ariaLabelClose: string\n onClose: () => void\n shouldShowBorders: boolean\n shouldShowShadow?: boolean\n title: string\n}\n\nconst DrawerHeader: React.FC<DrawerHeaderProps> = ({\n action = 'back',\n ariaLabelClose,\n onClose,\n shouldShowBorders,\n shouldShowShadow,\n title,\n}) => {\n const isBack = action === 'back'\n const button = (\n <IconButton\n aria-label={ariaLabelClose}\n autoFocus={true}\n color={isBack ? 'primary' : 'default'}\n onClick={onClose}\n >\n {isBack ? (\n <ArrowBack color=\"primary\" sx={{ fontSize: 22 }} />\n ) : (\n <Close sx={{ color: 'action.active', fontSize: 22 }} />\n )}\n </IconButton>\n )\n // Keeps the title centred opposite the button.\n const spacer = <Box width=\"44px\" />\n\n return (\n <Stack\n aria-labelledby={`${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`}\n direction=\"row\"\n sx={{\n alignItems: 'center',\n backgroundColor: 'background.paper',\n ...(shouldShowBorders && {\n borderBottom: 1,\n borderColor: 'divider',\n }),\n ...(shouldShowShadow && {\n boxShadow: '0px 2px 8px 0px #6A73811F',\n }),\n padding: '8px 8px 8px 8px',\n }}\n >\n {isBack ? button : spacer}\n <Box\n sx={{\n flexGrow: 1,\n margin: 'auto',\n textAlign: 'center',\n }}\n >\n <H2\n bold={true}\n id={`${title?.replace(/\\s+/g, '-').toLowerCase()}-header-title`}\n variant=\"body1\"\n >\n {title}\n </H2>\n </Box>\n {isBack ? spacer : button}\n </Stack>\n )\n}\n\nexport default DrawerHeader\n"],"mappings":";;;;;;;AAsBA,IAAM,IAAA,CAA6C,EACjD,QAAA,IAAS,QACT,gBAAA,GACA,SAAA,GACA,mBAAA,GACA,kBAAA,GACA,OAAA,EAAA,MACI;AACJ,QAAM,IAAS,MAAW,QACpB,IACJ,gBAAA,EAAC,GAAD;AAAA,IACE,cAAY;AAAA,IACZ,WAAW;AAAA,IACX,OAAO,IAAS,YAAY;AAAA,IAC5B,SAAS;AAAA,IAER,UAAA,IACC,gBAAA,EAAC,GAAD;AAAA,MAAW,OAAM;AAAA,MAAU,IAAI,EAAE,UAAU,GAAG;AAAA,IAAI,CAAA,IAElD,gBAAA,EAAC,GAAD,EAAO,IAAI;AAAA,MAAE,OAAO;AAAA,MAAiB,UAAU;AAAA,IAAG,EAAI,CAAA;AAAA,EAE9C,CAAA,GAGR,IAAS,gBAAA,EAAC,GAAD,EAAK,OAAM,OAAQ,CAAA;AAElC,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,mBAAiB,GAAG,GAAO,QAAQ,QAAQ,GAAG,EAAE,YAAY,CAAA;AAAA,IAC5D,WAAU;AAAA,IACV,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,GAAI,KAAqB;AAAA,QACvB,cAAc;AAAA,QACd,aAAa;AAAA,MACf;AAAA,MACA,GAAI,KAAoB,EACtB,WAAW,4BACb;AAAA,MACA,SAAS;AAAA,IACX;AAAA,IAdF,UAAA;AAAA,MAgBG,IAAS,IAAS;AAAA,MACnB,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,WAAW;AAAA,QACb;AAAA,QAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,UACE,MAAM;AAAA,UACN,IAAI,GAAG,GAAO,QAAQ,QAAQ,GAAG,EAAE,YAAY,CAAA;AAAA,UAC/C,SAAQ;AAAA,UAEP,UAAA;AAAA,QACC,CAAA;AAAA,MACD,CAAA;AAAA,MACJ,IAAS,IAAS;AAAA,IACd;AAAA;AAEX"}
|
|
@@ -39,6 +39,13 @@ type OpenActionDrawerArgs = {
|
|
|
39
39
|
trigger: Exclude<ActionDrawerTrigger, 'inDescriptionCta'>;
|
|
40
40
|
cta?: never;
|
|
41
41
|
});
|
|
42
|
+
/** beatContext key: the beat's active_at as its card last rendered it (a sampled refresh drops it). */
|
|
43
|
+
export declare const BEAT_ACTIVE_AT_KEY = "active_at";
|
|
44
|
+
/** A message a block hands over when it closes its own drawer, shown after it unmounts. */
|
|
45
|
+
export interface ActionNotice {
|
|
46
|
+
message: string;
|
|
47
|
+
severity: 'success' | 'error';
|
|
48
|
+
}
|
|
42
49
|
/** Lifecycle of a beat's CTA action (see insights-v2/ctaActions), keyed by beat guid. */
|
|
43
50
|
export type CtaStatus = 'pending' | 'done' | 'error';
|
|
44
51
|
/**
|
|
@@ -55,6 +62,8 @@ export declare class InsightsV2Store {
|
|
|
55
62
|
* insights never reflects another card's pending or error state.
|
|
56
63
|
*/
|
|
57
64
|
ctaStatus: Record<string, CtaStatus>;
|
|
65
|
+
/** The notice per beat guid that outlives its drawer session; ActionBlockLayer draws it. */
|
|
66
|
+
actionNotice: Record<string, ActionNotice | undefined>;
|
|
58
67
|
/**
|
|
59
68
|
* Per-beat scratch input collected on the card or in its blocks (e.g. the account a user
|
|
60
69
|
* picked before pressing Save), keyed by beat guid. Unlike `actionDrawer.context`, which is
|
|
@@ -65,6 +74,7 @@ export declare class InsightsV2Store {
|
|
|
65
74
|
*/
|
|
66
75
|
beatContext: Record<string, Record<string, unknown>>;
|
|
67
76
|
constructor(globalStore: GlobalStore);
|
|
77
|
+
setActionNotice: (guid: string, notice: ActionNotice | undefined) => void;
|
|
68
78
|
setCtaStatus: (guid: string, status: CtaStatus) => void;
|
|
69
79
|
/** Merges `values` into the beat's scratch input. */
|
|
70
80
|
setBeatContext: (guid: string, values: Record<string, unknown>) => void;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { makeAutoObservable as o } from "mobx";
|
|
2
|
-
var
|
|
2
|
+
var r = {
|
|
3
3
|
isDrawerOpen: !1,
|
|
4
4
|
trigger: "primaryCta",
|
|
5
5
|
guid: "",
|
|
6
6
|
context: void 0,
|
|
7
7
|
cta: void 0
|
|
8
|
-
}, n = class {
|
|
8
|
+
}, n = "active_at", c = class {
|
|
9
9
|
globalStore;
|
|
10
|
-
actionDrawer =
|
|
10
|
+
actionDrawer = r;
|
|
11
11
|
ctaStatus = {};
|
|
12
|
+
actionNotice = {};
|
|
12
13
|
beatContext = {};
|
|
13
14
|
constructor(t) {
|
|
14
15
|
this.globalStore = t, o(this);
|
|
15
16
|
}
|
|
17
|
+
setActionNotice = (t, e) => {
|
|
18
|
+
this.actionNotice = {
|
|
19
|
+
...this.actionNotice,
|
|
20
|
+
[t]: e
|
|
21
|
+
};
|
|
22
|
+
};
|
|
16
23
|
setCtaStatus = (t, e) => {
|
|
17
24
|
this.ctaStatus = {
|
|
18
25
|
...this.ctaStatus,
|
|
@@ -37,13 +44,13 @@ var i = {
|
|
|
37
44
|
}
|
|
38
45
|
};
|
|
39
46
|
};
|
|
40
|
-
openActionDrawer = ({ guid: t, trigger: e, context: a, cta:
|
|
47
|
+
openActionDrawer = ({ guid: t, trigger: e, context: a, cta: i }) => {
|
|
41
48
|
this.actionDrawer = {
|
|
42
49
|
isDrawerOpen: !0,
|
|
43
50
|
trigger: e,
|
|
44
51
|
guid: t,
|
|
45
52
|
context: a,
|
|
46
|
-
cta:
|
|
53
|
+
cta: i
|
|
47
54
|
};
|
|
48
55
|
};
|
|
49
56
|
openCtaDrawer = (t, e) => {
|
|
@@ -61,8 +68,9 @@ var i = {
|
|
|
61
68
|
};
|
|
62
69
|
};
|
|
63
70
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
n as BEAT_ACTIVE_AT_KEY,
|
|
72
|
+
r as CLOSED_ACTION_DRAWER,
|
|
73
|
+
c as InsightsV2Store
|
|
66
74
|
};
|
|
67
75
|
|
|
68
76
|
//# sourceMappingURL=InsightsV2Store.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsV2Store.es.js","names":[],"sources":["../../../src/core/stores/InsightsV2Store.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\n\nimport type { InDescriptionCTA } from '../types/Insights'\n\nimport type { GlobalStore } from './GlobalStore'\n\n// `inDescriptionCta`: the link inside a card's description (`insights_payload.in_description_cta`).\nexport type ActionDrawerTrigger = 'primaryCta' | 'secondaryCta' | 'chartBar' | 'inDescriptionCta'\n\nexport interface ActionDrawerState {\n isDrawerOpen: boolean\n trigger: ActionDrawerTrigger\n guid: string\n /**\n * Block-specific drilldown data for the current drawer SESSION, opaque to the\n * store. Each action block defines and reads its own shape (via\n * useActionContext<T>()). Chart drilldowns put `{ chartBarIndex, tabIndex }`\n * here; CTAs carry none.\n *\n * This is an accumulating bag, not a single owner's value: a nested drawer\n * (e.g. TransactionDetailsBlock opened from a row inside TransactionHistory\n * Block) adds its own key via `setActionContext` ON TOP of whatever the outer\n * drawer already put here, so the outer block's own context survives while the\n * nested block is open. It resets to a clean slate only when a NEW drawer\n * session starts (`openActionDrawer`/`openCtaDrawer`, which fully replace the\n * envelope) — not on every `setActionContext` call.\n */\n context: unknown\n /**\n * Block and variant an `inDescriptionCta` drawer runs; without it the beat's own\n * `in_description_cta` is used. Replaced on each open, kept through close like `trigger`.\n */\n cta?: DrawerCta\n}\n\nexport const CLOSED_ACTION_DRAWER: ActionDrawerState = {\n isDrawerOpen: false,\n trigger: 'primaryCta',\n guid: '',\n context: undefined,\n cta: undefined,\n}\n\n/** What an `inDescriptionCta` opener picks: the block, its variant and step (`action_key`). */\nexport type DrawerCta = Pick<InDescriptionCTA, 'block' | 'variant' | 'action_key'>\n\n// Only the `inDescriptionCta` trigger accepts a `cta`.\ntype OpenActionDrawerArgs = {\n guid: string\n context?: unknown\n} & (\n | { trigger: 'inDescriptionCta'; cta?: DrawerCta }\n | { trigger: Exclude<ActionDrawerTrigger, 'inDescriptionCta'>; cta?: never }\n)\n\n/** Lifecycle of a beat's CTA action (see insights-v2/ctaActions), keyed by beat guid. */\nexport type CtaStatus = 'pending' | 'done' | 'error'\n\n/**\n * UI state shared across the insights-v2 widget tree. Owns the action drawer so\n * cards, charts, and action blocks coordinate through the store instead of prop\n * drilling. The drawer state is a fixed envelope (isDrawerOpen/guid/trigger) plus\n * an opaque `context` bag, so per-block drilldown data never leaks into this shape.\n */\nexport class InsightsV2Store {\n globalStore: GlobalStore\n\n actionDrawer: ActionDrawerState = CLOSED_ACTION_DRAWER\n\n /**\n * CTA action status per beat guid. Keyed by guid (not block) so a block shared by many\n * insights never reflects another card's pending or error state.\n */\n ctaStatus: Record<string, CtaStatus> = {}\n\n /**\n * Per-beat scratch input collected on the card or in its blocks (e.g. the account a user\n * picked before pressing Save), keyed by beat guid. Unlike `actionDrawer.context`, which is\n * replaced whenever any drawer session starts, this survives other cards' drawers opening.\n * CTA steps read it via `disabledWhen` and their `params` callback (`beatContextOf`). Ships\n * ahead of its first block writer (Designate's account picker) on purpose: it is the layer's\n * only way to keep a pick alive across other cards' drawer sessions.\n */\n beatContext: Record<string, Record<string, unknown>> = {}\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n\n makeAutoObservable(this)\n }\n\n setCtaStatus = (guid: string, status: CtaStatus) => {\n this.ctaStatus = { ...this.ctaStatus, [guid]: status }\n }\n\n /** Merges `values` into the beat's scratch input. */\n setBeatContext = (guid: string, values: Record<string, unknown>) => {\n this.beatContext = { ...this.beatContext, [guid]: { ...this.beatContext[guid], ...values } }\n }\n\n /**\n * Merges keys into the current drawer session's context bag — it does NOT\n * replace it. A nested drawer (e.g. a row click inside TransactionHistoryBlock\n * opening TransactionDetailsBlock) calls this to layer its own key (e.g.\n * `transaction_guid`) on top of whatever context the outer drawer already set\n * (e.g. `chartBarIndex`), so the outer block keeps reading its own keys via\n * useActionContext while the nested block is open. The bag only returns to a\n * clean slate when a new drawer session starts via `openActionDrawer`/\n * `openCtaDrawer`, which fully replace the envelope.\n */\n setActionContext = (context: Record<string, unknown>) => {\n this.actionDrawer = {\n ...this.actionDrawer,\n context: {\n ...(this.actionDrawer.context as Record<string, unknown> | undefined),\n ...context,\n },\n }\n }\n\n /**\n * Generic drawer opener — the only opener a new action block needs. Pass the\n * beat guid, the CTA/source that triggered it, and (optionally) a block-specific\n * context object the block reads back via useActionContext. `cta` overrides the CTA an\n * `inDescriptionCta` drawer runs, for this session only.\n */\n openActionDrawer = ({ guid, trigger, context, cta }: OpenActionDrawerArgs) => {\n this.actionDrawer = { isDrawerOpen: true, trigger, guid, context, cta }\n }\n\n /** Convenience opener for CTA drawers (no drilldown context). */\n openCtaDrawer = (guid: string, trigger: 'primaryCta' | 'secondaryCta') => {\n this.openActionDrawer({ guid, trigger })\n }\n\n closeActionDrawer = () => {\n // Preserve `trigger`, `context` and `cta` so the drawer keeps its variant-specific\n // title/content through the slide-out animation (ActionBlockLayer stays\n // mounted while closing). Only flip isDrawerOpen off and clear the beat guid.\n this.actionDrawer = { ...this.actionDrawer, isDrawerOpen: false, guid: '' }\n }\n}\n"],"mappings":";AAmCA,IAAa,IAA0C;AAAA,EACrD,cAAc;AAAA,EACd,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,KAAK;AACP,
|
|
1
|
+
{"version":3,"file":"InsightsV2Store.es.js","names":[],"sources":["../../../src/core/stores/InsightsV2Store.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\n\nimport type { InDescriptionCTA } from '../types/Insights'\n\nimport type { GlobalStore } from './GlobalStore'\n\n// `inDescriptionCta`: the link inside a card's description (`insights_payload.in_description_cta`).\nexport type ActionDrawerTrigger = 'primaryCta' | 'secondaryCta' | 'chartBar' | 'inDescriptionCta'\n\nexport interface ActionDrawerState {\n isDrawerOpen: boolean\n trigger: ActionDrawerTrigger\n guid: string\n /**\n * Block-specific drilldown data for the current drawer SESSION, opaque to the\n * store. Each action block defines and reads its own shape (via\n * useActionContext<T>()). Chart drilldowns put `{ chartBarIndex, tabIndex }`\n * here; CTAs carry none.\n *\n * This is an accumulating bag, not a single owner's value: a nested drawer\n * (e.g. TransactionDetailsBlock opened from a row inside TransactionHistory\n * Block) adds its own key via `setActionContext` ON TOP of whatever the outer\n * drawer already put here, so the outer block's own context survives while the\n * nested block is open. It resets to a clean slate only when a NEW drawer\n * session starts (`openActionDrawer`/`openCtaDrawer`, which fully replace the\n * envelope) — not on every `setActionContext` call.\n */\n context: unknown\n /**\n * Block and variant an `inDescriptionCta` drawer runs; without it the beat's own\n * `in_description_cta` is used. Replaced on each open, kept through close like `trigger`.\n */\n cta?: DrawerCta\n}\n\nexport const CLOSED_ACTION_DRAWER: ActionDrawerState = {\n isDrawerOpen: false,\n trigger: 'primaryCta',\n guid: '',\n context: undefined,\n cta: undefined,\n}\n\n/** What an `inDescriptionCta` opener picks: the block, its variant and step (`action_key`). */\nexport type DrawerCta = Pick<InDescriptionCTA, 'block' | 'variant' | 'action_key'>\n\n// Only the `inDescriptionCta` trigger accepts a `cta`.\ntype OpenActionDrawerArgs = {\n guid: string\n context?: unknown\n} & (\n | { trigger: 'inDescriptionCta'; cta?: DrawerCta }\n | { trigger: Exclude<ActionDrawerTrigger, 'inDescriptionCta'>; cta?: never }\n)\n\n/** beatContext key: the beat's active_at as its card last rendered it (a sampled refresh drops it). */\nexport const BEAT_ACTIVE_AT_KEY = 'active_at'\n\n/** A message a block hands over when it closes its own drawer, shown after it unmounts. */\nexport interface ActionNotice {\n message: string\n severity: 'success' | 'error'\n}\n\n/** Lifecycle of a beat's CTA action (see insights-v2/ctaActions), keyed by beat guid. */\nexport type CtaStatus = 'pending' | 'done' | 'error'\n\n/**\n * UI state shared across the insights-v2 widget tree. Owns the action drawer so\n * cards, charts, and action blocks coordinate through the store instead of prop\n * drilling. The drawer state is a fixed envelope (isDrawerOpen/guid/trigger) plus\n * an opaque `context` bag, so per-block drilldown data never leaks into this shape.\n */\nexport class InsightsV2Store {\n globalStore: GlobalStore\n\n actionDrawer: ActionDrawerState = CLOSED_ACTION_DRAWER\n\n /**\n * CTA action status per beat guid. Keyed by guid (not block) so a block shared by many\n * insights never reflects another card's pending or error state.\n */\n ctaStatus: Record<string, CtaStatus> = {}\n\n /** The notice per beat guid that outlives its drawer session; ActionBlockLayer draws it. */\n actionNotice: Record<string, ActionNotice | undefined> = {}\n\n /**\n * Per-beat scratch input collected on the card or in its blocks (e.g. the account a user\n * picked before pressing Save), keyed by beat guid. Unlike `actionDrawer.context`, which is\n * replaced whenever any drawer session starts, this survives other cards' drawers opening.\n * CTA steps read it via `disabledWhen` and their `params` callback (`beatContextOf`). Ships\n * ahead of its first block writer (Designate's account picker) on purpose: it is the layer's\n * only way to keep a pick alive across other cards' drawer sessions.\n */\n beatContext: Record<string, Record<string, unknown>> = {}\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n\n makeAutoObservable(this)\n }\n\n setActionNotice = (guid: string, notice: ActionNotice | undefined) => {\n this.actionNotice = { ...this.actionNotice, [guid]: notice }\n }\n\n setCtaStatus = (guid: string, status: CtaStatus) => {\n this.ctaStatus = { ...this.ctaStatus, [guid]: status }\n }\n\n /** Merges `values` into the beat's scratch input. */\n setBeatContext = (guid: string, values: Record<string, unknown>) => {\n this.beatContext = { ...this.beatContext, [guid]: { ...this.beatContext[guid], ...values } }\n }\n\n /**\n * Merges keys into the current drawer session's context bag — it does NOT\n * replace it. A nested drawer (e.g. a row click inside TransactionHistoryBlock\n * opening TransactionDetailsBlock) calls this to layer its own key (e.g.\n * `transaction_guid`) on top of whatever context the outer drawer already set\n * (e.g. `chartBarIndex`), so the outer block keeps reading its own keys via\n * useActionContext while the nested block is open. The bag only returns to a\n * clean slate when a new drawer session starts via `openActionDrawer`/\n * `openCtaDrawer`, which fully replace the envelope.\n */\n setActionContext = (context: Record<string, unknown>) => {\n this.actionDrawer = {\n ...this.actionDrawer,\n context: {\n ...(this.actionDrawer.context as Record<string, unknown> | undefined),\n ...context,\n },\n }\n }\n\n /**\n * Generic drawer opener — the only opener a new action block needs. Pass the\n * beat guid, the CTA/source that triggered it, and (optionally) a block-specific\n * context object the block reads back via useActionContext. `cta` overrides the CTA an\n * `inDescriptionCta` drawer runs, for this session only.\n */\n openActionDrawer = ({ guid, trigger, context, cta }: OpenActionDrawerArgs) => {\n this.actionDrawer = { isDrawerOpen: true, trigger, guid, context, cta }\n }\n\n /** Convenience opener for CTA drawers (no drilldown context). */\n openCtaDrawer = (guid: string, trigger: 'primaryCta' | 'secondaryCta') => {\n this.openActionDrawer({ guid, trigger })\n }\n\n closeActionDrawer = () => {\n // Preserve `trigger`, `context` and `cta` so the drawer keeps its variant-specific\n // title/content through the slide-out animation (ActionBlockLayer stays\n // mounted while closing). Only flip isDrawerOpen off and clear the beat guid.\n this.actionDrawer = { ...this.actionDrawer, isDrawerOpen: false, guid: '' }\n }\n}\n"],"mappings":";AAmCA,IAAa,IAA0C;AAAA,EACrD,cAAc;AAAA,EACd,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,KAAK;AACP,GAea,IAAqB,aAiBrB,IAAb,MAA6B;AAAA,EAC3B;AAAA,EAEA,eAAkC;AAAA,EAMlC,YAAuC,CAAC;AAAA,EAGxC,eAAyD,CAAC;AAAA,EAU1D,cAAuD,CAAC;AAAA,EAExD,YAAY,GAA0B;AACpC,SAAK,cAAc,GAEnB,EAAmB,IAAI;AAAA,EACzB;AAAA,EAEA,kBAAA,CAAmB,GAAc,MAAqC;AACpE,SAAK,eAAe;AAAA,MAAE,GAAG,KAAK;AAAA,MAAe,CAAA,CAAA,GAAO;AAAA,IAAO;AAAA,EAC7D;AAAA,EAEA,eAAA,CAAgB,GAAc,MAAsB;AAClD,SAAK,YAAY;AAAA,MAAE,GAAG,KAAK;AAAA,MAAY,CAAA,CAAA,GAAO;AAAA,IAAO;AAAA,EACvD;AAAA,EAGA,iBAAA,CAAkB,GAAc,MAAoC;AAClE,SAAK,cAAc;AAAA,MAAE,GAAG,KAAK;AAAA,MAAc,CAAA,CAAA,GAAO;AAAA,QAAE,GAAG,KAAK,YAAY,CAAA;AAAA,QAAO,GAAG;AAAA,MAAO;AAAA,IAAE;AAAA,EAC7F;AAAA,EAYA,mBAAA,CAAoB,MAAqC;AACvD,SAAK,eAAe;AAAA,MAClB,GAAG,KAAK;AAAA,MACR,SAAS;AAAA,QACP,GAAI,KAAK,aAAa;AAAA,QACtB,GAAG;AAAA,MACL;AAAA,IACF;AAAA,EACF;AAAA,EAQA,mBAAA,CAAoB,EAAE,MAAA,GAAM,SAAA,GAAS,SAAA,GAAS,KAAA,EAAA,MAAgC;AAC5E,SAAK,eAAe;AAAA,MAAE,cAAc;AAAA,MAAM,SAAA;AAAA,MAAS,MAAA;AAAA,MAAM,SAAA;AAAA,MAAS,KAAA;AAAA,IAAI;AAAA,EACxE;AAAA,EAGA,gBAAA,CAAiB,GAAc,MAA2C;AACxE,SAAK,iBAAiB;AAAA,MAAE,MAAA;AAAA,MAAM,SAAA;AAAA,IAAQ,CAAC;AAAA,EACzC;AAAA,EAEA,oBAAA,MAA0B;AAIxB,SAAK,eAAe;AAAA,MAAE,GAAG,KAAK;AAAA,MAAc,cAAc;AAAA,MAAO,MAAM;AAAA,IAAG;AAAA,EAC5E;AACF"}
|