@mx-cartographer/insights-ui 1.8.14 → 1.8.15-alpha.JB0
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/dist/index.es.js +41 -41
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as d, Fragment as b } from "react/jsx-runtime";
|
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import g, { useState as X, useRef as z, useLayoutEffect as ne, useMemo as N, useCallback as me, useEffect as oe, forwardRef as R } from "react";
|
|
4
4
|
import Ee from "@mui/material/Dialog";
|
|
5
|
-
import { BottomSheetTransition as pe, Icon as C, P as k, Text as M, InstitutionLogo as Y, H3 as ae, createMXTheme as
|
|
5
|
+
import { BottomSheetTransition as pe, Icon as C, P as k, Text as M, InstitutionLogo as Y, H3 as ae, createMXTheme as ye, MerchantLogo as ue, CategoryIcon as ke, CheckmarkFilledIcon as fe } from "@kyper/mui";
|
|
6
6
|
import Ce from "react-confetti";
|
|
7
7
|
import p from "@mui/material/Box";
|
|
8
8
|
import w from "@mui/material/Card";
|
|
@@ -256,8 +256,8 @@ const Ue = ({
|
|
|
256
256
|
height: s
|
|
257
257
|
}) => {
|
|
258
258
|
const [h, c] = g.useState(null), m = () => {
|
|
259
|
-
const E = document.getElementsByClassName("mx-mini-insight-card")[0].clientHeight,
|
|
260
|
-
c(Math.floor(
|
|
259
|
+
const E = document.getElementsByClassName("mx-mini-insight-card")[0].clientHeight, y = document.getElementsByClassName("mx-mini-insight-card-header")[0].clientHeight + document.getElementsByClassName("mx-mini-insight-card-content-body")[0].clientHeight, u = E - y - 24;
|
|
260
|
+
c(Math.floor(u / 20));
|
|
261
261
|
};
|
|
262
262
|
return g.useEffect(() => (m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m)), []), /* @__PURE__ */ e(
|
|
263
263
|
w,
|
|
@@ -326,8 +326,8 @@ const Ue = ({
|
|
|
326
326
|
tabIndex: a = 0,
|
|
327
327
|
...s
|
|
328
328
|
}) => {
|
|
329
|
-
const [h, c] = X(null), m = () => c(null), E = (
|
|
330
|
-
m(), o(
|
|
329
|
+
const [h, c] = X(null), m = () => c(null), E = (u, S) => {
|
|
330
|
+
m(), o(u, S);
|
|
331
331
|
};
|
|
332
332
|
return /* @__PURE__ */ d(b, { children: [
|
|
333
333
|
/* @__PURE__ */ e(
|
|
@@ -335,8 +335,8 @@ const Ue = ({
|
|
|
335
335
|
{
|
|
336
336
|
"aria-hidden": i,
|
|
337
337
|
"aria-label": l,
|
|
338
|
-
onClick: (
|
|
339
|
-
c(
|
|
338
|
+
onClick: (u) => {
|
|
339
|
+
c(u.currentTarget), n();
|
|
340
340
|
},
|
|
341
341
|
sx: { position: "relative !important", bottom: 6 },
|
|
342
342
|
tabIndex: a,
|
|
@@ -364,8 +364,8 @@ const Ue = ({
|
|
|
364
364
|
onClose: m,
|
|
365
365
|
open: !!h,
|
|
366
366
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
367
|
-
children: r.map(({ icon:
|
|
368
|
-
/* @__PURE__ */ e(T, { sx: { minWidth: "32px !important" }, children:
|
|
367
|
+
children: r.map(({ icon: u, key: S, text: v }, J) => /* @__PURE__ */ d(Me, { onClick: () => E(J, S), sx: { padding: 12 }, children: [
|
|
368
|
+
/* @__PURE__ */ e(T, { sx: { minWidth: "32px !important" }, children: u }),
|
|
369
369
|
/* @__PURE__ */ e(
|
|
370
370
|
D,
|
|
371
371
|
{
|
|
@@ -456,21 +456,21 @@ const Ue = ({
|
|
|
456
456
|
width: n.width
|
|
457
457
|
});
|
|
458
458
|
ne(() => {
|
|
459
|
-
const
|
|
459
|
+
const y = new ResizeObserver(() => {
|
|
460
460
|
window.requestAnimationFrame(() => {
|
|
461
461
|
if (h.current) {
|
|
462
|
-
const { width:
|
|
462
|
+
const { width: u, height: S } = h.current.getBoundingClientRect();
|
|
463
463
|
if (S === 0) {
|
|
464
464
|
const x = h.current;
|
|
465
465
|
x.style.height = "1px", x.style.transform = `translate3d(${n.x?.get()}px, ${Number(n.y?.get()) - 1}px, 0px)`;
|
|
466
466
|
}
|
|
467
|
-
const v =
|
|
467
|
+
const v = u / 2, J = h.current.querySelector("text");
|
|
468
468
|
J && J.setAttribute("transform", `translate(${v}, -8)`);
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
471
|
});
|
|
472
|
-
return h.current &&
|
|
473
|
-
h.current &&
|
|
472
|
+
return h.current && y.observe(h.current), () => {
|
|
473
|
+
h.current && y.unobserve(h.current);
|
|
474
474
|
};
|
|
475
475
|
}, []);
|
|
476
476
|
const { ariaLabel: m, formattedAmount: E } = l[r];
|
|
@@ -515,7 +515,7 @@ const Ue = ({
|
|
|
515
515
|
selectedTabIndex: h,
|
|
516
516
|
onBarClick: c
|
|
517
517
|
}) => {
|
|
518
|
-
const m = Z(), { containerRef: E, height:
|
|
518
|
+
const m = Z(), { containerRef: E, height: y, width: u } = He(), S = N(() => {
|
|
519
519
|
const x = `${l}80`;
|
|
520
520
|
return h === void 0 ? [...new Array(r.length - 1).fill(x), l] : r.map((A, V) => V === h ? l : x);
|
|
521
521
|
}, [l, r, h]), v = me(
|
|
@@ -543,10 +543,10 @@ const Ue = ({
|
|
|
543
543
|
/* @__PURE__ */ e(p, { ref: E, sx: { height: o ? 120 : 172, width: "100%", mb: 8 }, children: /* @__PURE__ */ d(
|
|
544
544
|
we,
|
|
545
545
|
{
|
|
546
|
-
height:
|
|
546
|
+
height: y,
|
|
547
547
|
margin: n,
|
|
548
548
|
series: J.series,
|
|
549
|
-
width:
|
|
549
|
+
width: u,
|
|
550
550
|
xAxis: J.xAxis,
|
|
551
551
|
children: [
|
|
552
552
|
i?.average && /* @__PURE__ */ e(
|
|
@@ -668,7 +668,7 @@ const Ue = ({
|
|
|
668
668
|
rightLowerText: h,
|
|
669
669
|
rightUpperText: c
|
|
670
670
|
}) => {
|
|
671
|
-
const m = a ? te : ie, E = z(null), { height:
|
|
671
|
+
const m = a ? te : ie, E = z(null), { height: y, width: u } = Q(E);
|
|
672
672
|
return /* @__PURE__ */ d(
|
|
673
673
|
p,
|
|
674
674
|
{
|
|
@@ -682,7 +682,7 @@ const Ue = ({
|
|
|
682
682
|
}),
|
|
683
683
|
width: "100%",
|
|
684
684
|
children: [
|
|
685
|
-
/* @__PURE__ */ e(P, { height:
|
|
685
|
+
/* @__PURE__ */ e(P, { height: y, shouldRun: l.shouldRun, width: u }),
|
|
686
686
|
/* @__PURE__ */ d(
|
|
687
687
|
w,
|
|
688
688
|
{
|
|
@@ -874,8 +874,8 @@ const Ue = ({
|
|
|
874
874
|
if (!n.current) return;
|
|
875
875
|
const s = n.current, h = s.querySelectorAll(".Overlay");
|
|
876
876
|
["brand100", "brand200", "brand300", "brand400", "brand500"].forEach((m) => {
|
|
877
|
-
const E = s.querySelectorAll(`.${m}`),
|
|
878
|
-
le(E, a[
|
|
877
|
+
const E = s.querySelectorAll(`.${m}`), y = m.replace("brand", "");
|
|
878
|
+
le(E, a[y]);
|
|
879
879
|
}), le(h, a[300]);
|
|
880
880
|
}, [a]), /* @__PURE__ */ e(
|
|
881
881
|
"div",
|
|
@@ -948,10 +948,10 @@ const Ue = ({
|
|
|
948
948
|
if (n.current) {
|
|
949
949
|
const s = n.current, h = s.parentElement;
|
|
950
950
|
if (h) {
|
|
951
|
-
const m = Array.from(h.children).reduce((v, J) => J !== s ? v + J.clientHeight : v, 0),
|
|
951
|
+
const m = Array.from(h.children).reduce((v, J) => J !== s ? v + J.clientHeight : v, 0), y = h.clientHeight - m, u = parseInt(
|
|
952
952
|
window.getComputedStyle(s).lineHeight,
|
|
953
953
|
10
|
|
954
|
-
), S = Math.floor(
|
|
954
|
+
), S = Math.floor(y / u);
|
|
955
955
|
S !== r && o(S);
|
|
956
956
|
}
|
|
957
957
|
}
|
|
@@ -1031,9 +1031,9 @@ const Ue = ({
|
|
|
1031
1031
|
header: c,
|
|
1032
1032
|
isError: m = !1,
|
|
1033
1033
|
isLoading: E = !1,
|
|
1034
|
-
isMini:
|
|
1034
|
+
isMini: y = !1
|
|
1035
1035
|
}) => /* @__PURE__ */ d(b, { children: [
|
|
1036
|
-
/* @__PURE__ */ e(ht, { ...c, isMini:
|
|
1036
|
+
/* @__PURE__ */ e(ht, { ...c, isMini: y, title: r.html_title }),
|
|
1037
1037
|
m ? /* @__PURE__ */ e(st, { erroredText: s }) : /* @__PURE__ */ d(b, { children: [
|
|
1038
1038
|
/* @__PURE__ */ e(
|
|
1039
1039
|
Et,
|
|
@@ -1043,11 +1043,11 @@ const Ue = ({
|
|
|
1043
1043
|
beat: r,
|
|
1044
1044
|
hasFooterButton: !!o,
|
|
1045
1045
|
isLoading: E,
|
|
1046
|
-
isMini:
|
|
1046
|
+
isMini: y,
|
|
1047
1047
|
children: E ? /* @__PURE__ */ e(dt, { altLoadingText: i }) : n
|
|
1048
1048
|
}
|
|
1049
1049
|
),
|
|
1050
|
-
!
|
|
1050
|
+
!y && o,
|
|
1051
1051
|
h
|
|
1052
1052
|
] })
|
|
1053
1053
|
] }), w1 = ({
|
|
@@ -1164,7 +1164,7 @@ const Ue = ({
|
|
|
1164
1164
|
},
|
|
1165
1165
|
children: l.dismissed_at ? o : r
|
|
1166
1166
|
}
|
|
1167
|
-
),
|
|
1167
|
+
), yt = (i, l) => /* @__PURE__ */ t.createElement("svg", { width: 295, height: 142, viewBox: "0 0 295 142", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: l, ...i }, /* @__PURE__ */ t.createElement("path", { d: "M0.5 4C0.5 2.067 2.067 0.5 4 0.5H291C292.933 0.5 294.5 2.067 294.5 4V39.5H0.5V4Z", stroke: "#EEF1F6" }), /* @__PURE__ */ t.createElement("path", { d: "M0.5 102.5H294.5V138C294.5 139.933 292.933 141.5 291 141.5H4.00001C2.06701 141.5 0.5 139.933 0.5 138V102.5Z", fill: "#F8F9FB", stroke: "#EEF1F6" }), /* @__PURE__ */ t.createElement("rect", { x: 0.5, y: 39.5, width: 294, height: 63, fill: "white", stroke: "#EEF1F6" }), /* @__PURE__ */ t.createElement("rect", { x: 16, y: 55, width: 32, height: 32, rx: 2, fill: "#EEF1F6" }), /* @__PURE__ */ t.createElement("rect", { x: 16, y: 15, width: 80, height: 8, rx: 2, fill: "#EEF1F6" }), /* @__PURE__ */ t.createElement("rect", { x: 16, y: 118, width: 80, height: 8, rx: 2, fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 226, y: 118, width: 56, height: 8, rx: 2, fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 64, y: 60, width: 80, height: 8, rx: 2, fill: "#EEF1F6" }), /* @__PURE__ */ t.createElement("rect", { x: 232, y: 60, width: 47, height: 8, rx: 2, fill: "#EEF1F6" }), /* @__PURE__ */ t.createElement("rect", { x: 64, y: 76, width: 60, height: 4, rx: 2, fill: "#EEF1F6" })), ut = R(yt), kt = {
|
|
1168
1168
|
padding: 8,
|
|
1169
1169
|
marginTop: 8,
|
|
1170
1170
|
marginBottom: 12
|
|
@@ -1175,7 +1175,7 @@ const Ue = ({
|
|
|
1175
1175
|
flexDirection: "row",
|
|
1176
1176
|
justifyContent: "center"
|
|
1177
1177
|
},
|
|
1178
|
-
children: /* @__PURE__ */ e(I, { divProps: { style: kt }, image:
|
|
1178
|
+
children: /* @__PURE__ */ e(I, { divProps: { style: kt }, image: ut })
|
|
1179
1179
|
}
|
|
1180
1180
|
), v1 = ({
|
|
1181
1181
|
headerText: i,
|
|
@@ -1353,8 +1353,8 @@ const Ue = ({
|
|
|
1353
1353
|
maxRows: 4,
|
|
1354
1354
|
minRows: 4,
|
|
1355
1355
|
name: "Feedback",
|
|
1356
|
-
onChange: (
|
|
1357
|
-
h(
|
|
1356
|
+
onChange: (y) => {
|
|
1357
|
+
h(y.target.value), c(y.target.value);
|
|
1358
1358
|
},
|
|
1359
1359
|
onClick: () => s(),
|
|
1360
1360
|
placeholder: o,
|
|
@@ -1727,7 +1727,7 @@ const R1 = ({
|
|
|
1727
1727
|
title: h,
|
|
1728
1728
|
totalSavedText: c
|
|
1729
1729
|
}) => {
|
|
1730
|
-
const m =
|
|
1730
|
+
const m = ye(r ? "dark" : "light");
|
|
1731
1731
|
return /* @__PURE__ */ e(Se, { theme: m, children: /* @__PURE__ */ e(p, { className: "mx-insights-mefr-body", "data-ui-test": "mefr-body", sx: { mb: 16 }, children: /* @__PURE__ */ d(Pe, { title: h, children: [
|
|
1732
1732
|
/* @__PURE__ */ e(
|
|
1733
1733
|
Xe,
|
|
@@ -1927,8 +1927,8 @@ const R1 = ({
|
|
|
1927
1927
|
leftLowerText: c,
|
|
1928
1928
|
leftUpperText: m,
|
|
1929
1929
|
rightLowerText: E,
|
|
1930
|
-
rightUpperText:
|
|
1931
|
-
sourceAccountGuid:
|
|
1930
|
+
rightUpperText: y,
|
|
1931
|
+
sourceAccountGuid: u
|
|
1932
1932
|
}) => /* @__PURE__ */ e(g.Fragment, { children: s ? /* @__PURE__ */ e(
|
|
1933
1933
|
he,
|
|
1934
1934
|
{
|
|
@@ -1940,7 +1940,7 @@ const R1 = ({
|
|
|
1940
1940
|
leftLowerText: c,
|
|
1941
1941
|
leftUpperText: m,
|
|
1942
1942
|
rightLowerText: E,
|
|
1943
|
-
rightUpperText:
|
|
1943
|
+
rightUpperText: y
|
|
1944
1944
|
}
|
|
1945
1945
|
) : /* @__PURE__ */ e(
|
|
1946
1946
|
Lt,
|
|
@@ -1948,7 +1948,7 @@ const R1 = ({
|
|
|
1948
1948
|
destinationAccountGuid: r,
|
|
1949
1949
|
externalAccountName: o,
|
|
1950
1950
|
heldAccountName: n,
|
|
1951
|
-
sourceAccountGuid:
|
|
1951
|
+
sourceAccountGuid: u
|
|
1952
1952
|
}
|
|
1953
1953
|
) }), bt = (i, l) => /* @__PURE__ */ t.createElement("svg", { width: 288, height: 156, viewBox: "0 0 288 156", fill: "none", xmlns: "http://www.w3.org/2000/svg", ref: l, ...i }, /* @__PURE__ */ t.createElement("rect", { width: 288, height: 156 }), /* @__PURE__ */ t.createElement("line", { x1: 16, y1: 119.5, x2: 272, y2: 119.5, stroke: "#A8B1BD" }), /* @__PURE__ */ t.createElement("path", { d: "M242 18C242 16.8954 242.895 16 244 16H262C263.105 16 264 16.8954 264 18V119H242V18Z", fill: "#CDD3DD" }), /* @__PURE__ */ t.createElement("path", { d: "M198 37C198 35.8954 198.895 35 200 35H218C219.105 35 220 35.8954 220 37V119H198V37Z", fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("path", { d: "M154 54C154 52.8954 154.895 52 156 52H174C175.105 52 176 52.8954 176 54V119H154V54Z", fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("path", { d: "M110 77C110 75.8954 110.895 75 112 75H130C131.105 75 132 75.8954 132 77V119H110V77Z", fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("path", { d: "M66 61C66 59.8954 66.8954 59 68 59H86C87.1046 59 88 59.8954 88 61V119H66V61Z", fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("path", { d: "M22 72C22 70.8954 22.8954 70 24 70H42C43.1046 70 44 70.8954 44 72V119H22V72Z", fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 23, y: 130, width: 20, height: 6, rx: 3, fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 67, y: 130, width: 20, height: 6, rx: 3, fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 111, y: 130, width: 20, height: 6, rx: 3, fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 155, y: 130, width: 20, height: 6, rx: 3, fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 199, y: 130, width: 20, height: 6, rx: 3, fill: "#E4E8EE" }), /* @__PURE__ */ t.createElement("rect", { x: 243, y: 130, width: 20, height: 6, rx: 3, fill: "#CDD3DD" })), ce = R(bt), F1 = ({
|
|
1954
1954
|
amounts: i,
|
|
@@ -2008,7 +2008,7 @@ const R1 = ({
|
|
|
2008
2008
|
}),
|
|
2009
2009
|
children: [
|
|
2010
2010
|
/* @__PURE__ */ e(
|
|
2011
|
-
|
|
2011
|
+
ue,
|
|
2012
2012
|
{
|
|
2013
2013
|
alt: o,
|
|
2014
2014
|
categoryGuid: i.primary_transaction?.top_level_category_guid || "",
|
|
@@ -2129,7 +2129,7 @@ const R1 = ({
|
|
|
2129
2129
|
displayData: o,
|
|
2130
2130
|
...n
|
|
2131
2131
|
}) => {
|
|
2132
|
-
const { no_spend_days: a } = i.payload, { noSpendDays: s, dollarBillAltText: h, daysOfTheWeek: c } = o, m = zt[a.length || 0], E = g.useRef(null), { height:
|
|
2132
|
+
const { no_spend_days: a } = i.payload, { noSpendDays: s, dollarBillAltText: h, daysOfTheWeek: c } = o, m = zt[a.length || 0], E = g.useRef(null), { height: y, width: u } = Q(E);
|
|
2133
2133
|
return /* @__PURE__ */ e(
|
|
2134
2134
|
L,
|
|
2135
2135
|
{
|
|
@@ -2145,7 +2145,7 @@ const R1 = ({
|
|
|
2145
2145
|
width: "100%",
|
|
2146
2146
|
children: [
|
|
2147
2147
|
/* @__PURE__ */ e("img", { alt: h, src: m, width: 138 }),
|
|
2148
|
-
a?.length >= 4 && /* @__PURE__ */ e(P, { height:
|
|
2148
|
+
a?.length >= 4 && /* @__PURE__ */ e(P, { height: y, shouldRun: !0, width: u }),
|
|
2149
2149
|
/* @__PURE__ */ e(Tt, { daysOfTheWeek: c, noSpendDays: s })
|
|
2150
2150
|
]
|
|
2151
2151
|
}
|
|
@@ -2195,12 +2195,12 @@ const R1 = ({
|
|
|
2195
2195
|
),
|
|
2196
2196
|
header: n ? void 0 : o,
|
|
2197
2197
|
isMini: n,
|
|
2198
|
-
children: /* @__PURE__ */ e(p, {
|
|
2198
|
+
children: /* @__PURE__ */ e(p, { mb: 16, ml: -16, mr: -16, children: /* @__PURE__ */ e(
|
|
2199
2199
|
"img",
|
|
2200
2200
|
{
|
|
2201
2201
|
alt: l.description,
|
|
2202
2202
|
src: l.image_url,
|
|
2203
|
-
style: { width: "100%", height: "auto"
|
|
2203
|
+
style: { width: "100%", height: "auto" }
|
|
2204
2204
|
}
|
|
2205
2205
|
) })
|
|
2206
2206
|
}
|