@mx-cartographer/insights-ui 1.7.4-alpha.san1 → 1.7.4

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 CHANGED
@@ -4,7 +4,7 @@ import H, { useState as G, useRef as D, useLayoutEffect as oe, useMemo as P, use
4
4
  import se from "@mui/material/Dialog";
5
5
  import { BottomSheetTransition as ce, Icon as C, P as f, Text as b, InstitutionLogo as V, H3 as ee, Drawer as he, createMXTheme as me, MerchantLogo as pe, CategoryIcon as ue } from "@kyper/mui";
6
6
  import Ee from "react-confetti";
7
- import u from "@mui/material/Box";
7
+ import E from "@mui/material/Box";
8
8
  import A from "@mui/material/Card";
9
9
  import { useTheme as w, styled as j, ThemeProvider as fe } from "@mui/material/styles";
10
10
  import { useInView as ge } from "react-intersection-observer";
@@ -127,7 +127,7 @@ const Te = ({
127
127
  },
128
128
  children: [
129
129
  /* @__PURE__ */ t(
130
- u,
130
+ E,
131
131
  {
132
132
  sx: {
133
133
  position: "absolute",
@@ -140,7 +140,7 @@ const Te = ({
140
140
  }
141
141
  ),
142
142
  /* @__PURE__ */ t(
143
- u,
143
+ E,
144
144
  {
145
145
  sx: {
146
146
  position: "absolute",
@@ -164,7 +164,7 @@ const Te = ({
164
164
  }) => {
165
165
  const o = w();
166
166
  return /* @__PURE__ */ c(
167
- u,
167
+ E,
168
168
  {
169
169
  className: "mx-insights-goal-progress",
170
170
  "data-ui-test": "goal-progress",
@@ -214,7 +214,7 @@ const Te = ({
214
214
  }) => {
215
215
  const l = w();
216
216
  return /* @__PURE__ */ c(
217
- u,
217
+ E,
218
218
  {
219
219
  className: "mx-insights-gradient-box",
220
220
  "data-ui-test": "gradient-box",
@@ -233,7 +233,7 @@ const Te = ({
233
233
  }
234
234
  ) }),
235
235
  /* @__PURE__ */ t(
236
- u,
236
+ E,
237
237
  {
238
238
  className: "mx-insights-gradient-box-card",
239
239
  sx: {
@@ -258,7 +258,7 @@ const Te = ({
258
258
  height: d
259
259
  }) => {
260
260
  const [s, h] = H.useState(null), m = () => {
261
- const p = document.getElementsByClassName("mx-mini-insight-card")[0].clientHeight, E = document.getElementsByClassName("mx-mini-insight-card-header")[0].clientHeight + document.getElementsByClassName("mx-mini-insight-card-content-body")[0].clientHeight, x = p - E - 24;
261
+ const p = document.getElementsByClassName("mx-mini-insight-card")[0].clientHeight, u = document.getElementsByClassName("mx-mini-insight-card-header")[0].clientHeight + document.getElementsByClassName("mx-mini-insight-card-content-body")[0].clientHeight, x = p - u - 24;
262
262
  h(Math.floor(x / 20));
263
263
  };
264
264
  return H.useEffect(() => (m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m)), []), /* @__PURE__ */ t(
@@ -290,9 +290,9 @@ const Te = ({
290
290
  width: "100%"
291
291
  },
292
292
  children: [
293
- /* @__PURE__ */ t(u, { className: "mx-mini-insight-card-content-body", children: r }),
294
- /* @__PURE__ */ t(u, { sx: { p: 24 }, children: /* @__PURE__ */ t(
295
- u,
293
+ /* @__PURE__ */ t(E, { className: "mx-mini-insight-card-content-body", children: r }),
294
+ /* @__PURE__ */ t(E, { sx: { p: 24 }, children: /* @__PURE__ */ t(
295
+ E,
296
296
  {
297
297
  className: "test-class",
298
298
  dangerouslySetInnerHTML: { __html: i.html_description },
@@ -355,12 +355,12 @@ const Te = ({
355
355
  onClose: d,
356
356
  open: !!a,
357
357
  transformOrigin: { horizontal: "right", vertical: "top" },
358
- children: n.map(({ icon: m, key: p, text: E }, x) => /* @__PURE__ */ c(ye, { onClick: () => s(x, p), sx: { padding: 12 }, children: [
358
+ children: n.map(({ icon: m, key: p, text: u }, x) => /* @__PURE__ */ c(ye, { onClick: () => s(x, p), sx: { padding: 12 }, children: [
359
359
  /* @__PURE__ */ t(F, { sx: { minWidth: "32px !important" }, children: m }),
360
360
  /* @__PURE__ */ t(
361
361
  K,
362
362
  {
363
- primary: E,
363
+ primary: u,
364
364
  primaryTypographyProps: {
365
365
  fontWeight: "normal",
366
366
  fontSize: 15,
@@ -414,7 +414,7 @@ const Te = ({
414
414
  gap: 2
415
415
  },
416
416
  children: [...Array(3)].map((o, d) => /* @__PURE__ */ t(
417
- u,
417
+ E,
418
418
  {
419
419
  sx: {
420
420
  width: 3,
@@ -448,7 +448,7 @@ const Te = ({
448
448
  const p = new ResizeObserver(() => {
449
449
  window.requestAnimationFrame(() => {
450
450
  if (s.current) {
451
- const { width: E } = s.current.getBoundingClientRect(), x = E / 2;
451
+ const { width: u } = s.current.getBoundingClientRect(), x = u / 2;
452
452
  s.current.querySelector("text").setAttribute("transform", `translate(${x}, -8)`);
453
453
  }
454
454
  });
@@ -488,7 +488,7 @@ const Te = ({
488
488
  selectedTabIndex: d,
489
489
  onBarClick: s
490
490
  }) => {
491
- const h = w(), { containerRef: m, height: p, width: E } = we(), x = P(() => {
491
+ const h = w(), { containerRef: m, height: p, width: u } = we(), x = P(() => {
492
492
  const y = `${r}80`;
493
493
  return d === void 0 ? [...new Array(n.length - 1).fill(y), r] : n.map((M, S) => S === d ? r : y);
494
494
  }, [r, n, d]), v = de(
@@ -513,13 +513,13 @@ const Te = ({
513
513
  [n]
514
514
  );
515
515
  return /* @__PURE__ */ c(g, { alignItems: "center", sx: { mb: 24, width: "100%" }, children: [
516
- /* @__PURE__ */ t(u, { ref: m, sx: { height: 130, width: "100%", mb: 8 }, children: /* @__PURE__ */ c(
516
+ /* @__PURE__ */ t(E, { ref: m, sx: { height: 130, width: "100%", mb: 8 }, children: /* @__PURE__ */ c(
517
517
  ve,
518
518
  {
519
519
  height: p,
520
520
  margin: l,
521
521
  series: k.series,
522
- width: E,
522
+ width: u,
523
523
  xAxis: k.xAxis,
524
524
  children: [
525
525
  i?.average && /* @__PURE__ */ t(
@@ -641,9 +641,9 @@ const Te = ({
641
641
  rightLowerText: s,
642
642
  rightUpperText: h
643
643
  }) => {
644
- const m = o ? O : U, p = D(null), { height: E, width: x } = re(p);
644
+ const m = o ? O : U, p = D(null), { height: u, width: x } = re(p);
645
645
  return /* @__PURE__ */ c(
646
- u,
646
+ E,
647
647
  {
648
648
  alignItems: "center",
649
649
  display: "flex",
@@ -655,7 +655,7 @@ const Te = ({
655
655
  }),
656
656
  width: "100%",
657
657
  children: [
658
- /* @__PURE__ */ t(ie, { height: E, shouldRun: r.shouldRun, width: x }),
658
+ /* @__PURE__ */ t(ie, { height: u, shouldRun: r.shouldRun, width: x }),
659
659
  /* @__PURE__ */ c(
660
660
  A,
661
661
  {
@@ -758,7 +758,7 @@ const Te = ({
758
758
  }
759
759
  );
760
760
  }, _e = ({ account: i, headerString: r }) => /* @__PURE__ */ c(
761
- u,
761
+ E,
762
762
  {
763
763
  "data-ui-test": "mx-insights-sudd-mini-body-header",
764
764
  sx: { display: "flex", flexDirection: "row", gap: 8, justifyContent: "center" },
@@ -847,8 +847,8 @@ const Te = ({
847
847
  if (!a.current) return;
848
848
  const d = a.current, s = d.querySelectorAll(".Overlay");
849
849
  ["brand100", "brand200", "brand300", "brand400", "brand500"].forEach((m) => {
850
- const p = d.querySelectorAll(`.${m}`), E = m.replace("brand", "");
851
- Q(p, o[E]);
850
+ const p = d.querySelectorAll(`.${m}`), u = m.replace("brand", "");
851
+ Q(p, o[u]);
852
852
  }), Q(s, o[300]);
853
853
  }, [o]), /* @__PURE__ */ t(
854
854
  "div",
@@ -919,11 +919,11 @@ const Te = ({
919
919
  if (l.current) {
920
920
  const o = l.current, d = o.parentElement;
921
921
  if (d) {
922
- const h = Array.from(d.children).reduce((k, y) => y !== o ? k + y.clientHeight : k, 0), p = d.clientHeight - h, E = parseInt(
922
+ const h = Array.from(d.children).reduce((k, y) => y !== o ? k + y.clientHeight : k, 0), p = d.clientHeight - h, u = parseInt(
923
923
  window.getComputedStyle(o).lineHeight,
924
924
  10
925
925
  ), v = Math.floor(
926
- (p - 20) / E
926
+ (p - 20) / u
927
927
  );
928
928
  v !== r && n(v);
929
929
  }
@@ -975,7 +975,7 @@ const Te = ({
975
975
  );
976
976
  return /* @__PURE__ */ c(L, { children: [
977
977
  l === "top" && m(),
978
- /* @__PURE__ */ t(g, { sx: { alignItems: "center" }, children: n }),
978
+ /* @__PURE__ */ t(g, { sx: { alignItems: "center", ...s && !d && { mx: -16 } }, children: n }),
979
979
  l === "bottom" && m(),
980
980
  i && /* @__PURE__ */ t(
981
981
  b,
@@ -1003,9 +1003,9 @@ const Te = ({
1003
1003
  header: h,
1004
1004
  isError: m = !1,
1005
1005
  isLoading: p = !1,
1006
- isMini: E = !1
1006
+ isMini: u = !1
1007
1007
  }) => /* @__PURE__ */ c(L, { children: [
1008
- /* @__PURE__ */ t(o1, { ...h, isMini: E, title: n.html_title }),
1008
+ /* @__PURE__ */ t(o1, { ...h, isMini: u, title: n.html_title }),
1009
1009
  m ? /* @__PURE__ */ t(a1, { erroredText: d }) : /* @__PURE__ */ c(L, { children: [
1010
1010
  /* @__PURE__ */ t(
1011
1011
  h1,
@@ -1014,11 +1014,11 @@ const Te = ({
1014
1014
  asteriskText: r,
1015
1015
  beat: n,
1016
1016
  hasFooterButton: !!l,
1017
- isMini: E,
1017
+ isMini: u,
1018
1018
  children: p ? /* @__PURE__ */ t(s1, { altLoadingText: i }) : a
1019
1019
  }
1020
1020
  ),
1021
- l,
1021
+ !u && l,
1022
1022
  s
1023
1023
  ] })
1024
1024
  ] }), ht = ({
@@ -1209,7 +1209,7 @@ const Te = ({
1209
1209
  width: "100%"
1210
1210
  });
1211
1211
  return /* @__PURE__ */ c(
1212
- u,
1212
+ E,
1213
1213
  {
1214
1214
  sx: {
1215
1215
  display: "flex",
@@ -1242,7 +1242,7 @@ const Te = ({
1242
1242
  ]
1243
1243
  }
1244
1244
  );
1245
- }, ft = ({ bodyText: i }) => /* @__PURE__ */ t(u, { style: { padding: "8px 24px 8px 0px" }, children: /* @__PURE__ */ t(f, { "data-ui-test": "feedback-description", children: i }) }), gt = ({
1245
+ }, ft = ({ bodyText: i }) => /* @__PURE__ */ t(E, { style: { padding: "8px 24px 8px 0px" }, children: /* @__PURE__ */ t(f, { "data-ui-test": "feedback-description", children: i }) }), gt = ({
1246
1246
  feedbackOptions: i,
1247
1247
  groupAriaLabel: r,
1248
1248
  selectedRadio: n,
@@ -1255,7 +1255,7 @@ const Te = ({
1255
1255
  width: "100%"
1256
1256
  },
1257
1257
  children: /* @__PURE__ */ t(We, { "aria-label": r, name: "radio-buttons-group", children: i.map((a, o) => /* @__PURE__ */ t(
1258
- u,
1258
+ E,
1259
1259
  {
1260
1260
  sx: (d) => ({
1261
1261
  p: "24px 0px 23px 0px",
@@ -1308,7 +1308,7 @@ const Te = ({
1308
1308
  resize: "none"
1309
1309
  }), p = Ie();
1310
1310
  return /* @__PURE__ */ c(
1311
- u,
1311
+ E,
1312
1312
  {
1313
1313
  "aria-label": a,
1314
1314
  sx: {
@@ -1324,8 +1324,8 @@ const Te = ({
1324
1324
  maxRows: 4,
1325
1325
  minRows: 4,
1326
1326
  name: "Feedback",
1327
- onChange: (E) => {
1328
- s(E.target.value), h(E.target.value);
1327
+ onChange: (u) => {
1328
+ s(u.target.value), h(u.target.value);
1329
1329
  },
1330
1330
  onClick: () => d(),
1331
1331
  placeholder: l,
@@ -1372,7 +1372,7 @@ const Te = ({
1372
1372
  }) => {
1373
1373
  const o = H.useRef(null), { height: d, width: s } = re(o);
1374
1374
  return /* @__PURE__ */ t(
1375
- u,
1375
+ E,
1376
1376
  {
1377
1377
  sx: (h) => ({
1378
1378
  background: h.palette.background.highlight,
@@ -1381,7 +1381,7 @@ const Te = ({
1381
1381
  width: "100%"
1382
1382
  }),
1383
1383
  children: /* @__PURE__ */ c(
1384
- u,
1384
+ E,
1385
1385
  {
1386
1386
  ref: o,
1387
1387
  sx: {
@@ -1396,7 +1396,7 @@ const Te = ({
1396
1396
  children: [
1397
1397
  /* @__PURE__ */ t(ie, { height: d, shouldRun: a, width: s }),
1398
1398
  /* @__PURE__ */ c(
1399
- u,
1399
+ E,
1400
1400
  {
1401
1401
  sx: (h) => ({
1402
1402
  background: h.palette.background.paper,
@@ -1407,7 +1407,7 @@ const Te = ({
1407
1407
  }),
1408
1408
  children: [
1409
1409
  /* @__PURE__ */ c(
1410
- u,
1410
+ E,
1411
1411
  {
1412
1412
  sx: {
1413
1413
  display: "flex",
@@ -1473,7 +1473,7 @@ const Te = ({
1473
1473
  }
1474
1474
  ),
1475
1475
  /* @__PURE__ */ t(
1476
- u,
1476
+ E,
1477
1477
  {
1478
1478
  sx: (h) => ({
1479
1479
  background: h.palette.background.highlight,
@@ -1524,8 +1524,8 @@ const Te = ({
1524
1524
  backgroundColor: "background.paper"
1525
1525
  }
1526
1526
  },
1527
- children: /* @__PURE__ */ t(g, { height: "100%", justifyContent: "space-between", children: /* @__PURE__ */ c(u, { height: "100%", overflow: "auto", children: [
1528
- /* @__PURE__ */ t(u, { sx: { p: "16px 24px", width: "100%" }, children: /* @__PURE__ */ t(
1527
+ children: /* @__PURE__ */ t(g, { height: "100%", justifyContent: "space-between", children: /* @__PURE__ */ c(E, { height: "100%", overflow: "auto", children: [
1528
+ /* @__PURE__ */ t(E, { sx: { p: "16px 24px", width: "100%" }, children: /* @__PURE__ */ t(
1529
1529
  q,
1530
1530
  {
1531
1531
  "aria-label": i,
@@ -1537,11 +1537,11 @@ const Te = ({
1537
1537
  }
1538
1538
  ) }),
1539
1539
  /* @__PURE__ */ t(Ge, {}),
1540
- /* @__PURE__ */ c(u, { children: [
1540
+ /* @__PURE__ */ c(E, { children: [
1541
1541
  /* @__PURE__ */ t(ee, { sx: { p: "16px 24px 8px 24px", whiteSpace: "wrap" }, children: n }),
1542
1542
  /* @__PURE__ */ c(g, { sx: { gap: 12, px: 24 }, children: [
1543
1543
  /* @__PURE__ */ t(f, { color: "secondary", fontSize: 13, children: m }),
1544
- /* @__PURE__ */ t(N, { children: p.map((E, x) => /* @__PURE__ */ c(
1544
+ /* @__PURE__ */ t(N, { children: p.map((u, x) => /* @__PURE__ */ c(
1545
1545
  X,
1546
1546
  {
1547
1547
  sx: {
@@ -1565,7 +1565,7 @@ const Te = ({
1565
1565
  K,
1566
1566
  {
1567
1567
  disableTypography: !0,
1568
- secondary: E,
1568
+ secondary: u,
1569
1569
  sx: (v) => ({ color: v.palette.text.secondary, fontSize: 13 })
1570
1570
  }
1571
1571
  )
@@ -1575,10 +1575,10 @@ const Te = ({
1575
1575
  )) })
1576
1576
  ] })
1577
1577
  ] }),
1578
- /* @__PURE__ */ c(u, { children: [
1578
+ /* @__PURE__ */ c(E, { children: [
1579
1579
  /* @__PURE__ */ t(b, { bold: !0, fontSize: 15, sx: { p: "16px 24px 8px 24px" }, children: o }),
1580
1580
  /* @__PURE__ */ t(f, { color: "secondary", fontSize: 13, sx: { mb: 16, mx: 24 }, children: a }),
1581
- /* @__PURE__ */ t(N, { sx: { p: "16px 24px" }, children: d.map((E, x) => /* @__PURE__ */ c(
1581
+ /* @__PURE__ */ t(N, { sx: { p: "16px 24px" }, children: d.map((u, x) => /* @__PURE__ */ c(
1582
1582
  X,
1583
1583
  {
1584
1584
  sx: (v) => ({
@@ -1592,12 +1592,12 @@ const Te = ({
1592
1592
  p: 16
1593
1593
  }),
1594
1594
  children: [
1595
- /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(C, { name: E.icon_name, size: 24 }) }),
1595
+ /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(C, { name: u.icon_name, size: 24 }) }),
1596
1596
  /* @__PURE__ */ t(
1597
1597
  K,
1598
1598
  {
1599
- primary: E.title,
1600
- secondary: E.content,
1599
+ primary: u.title,
1600
+ secondary: u.content,
1601
1601
  sx: (v) => ({
1602
1602
  "& > p": {
1603
1603
  color: v.palette.text.secondary,
@@ -1615,7 +1615,7 @@ const Te = ({
1615
1615
  ] }),
1616
1616
  /* @__PURE__ */ c(g, { sx: { alignItems: "center", justifyContent: "center", pb: 16 }, children: [
1617
1617
  /* @__PURE__ */ t(b, { bold: !0, sx: { p: "16px 24px 8px 24px" }, children: r }),
1618
- /* @__PURE__ */ c(u, { sx: { display: "flex", gap: 24, p: "12px 24px" }, children: [
1618
+ /* @__PURE__ */ c(E, { sx: { display: "flex", gap: 24, p: "12px 24px" }, children: [
1619
1619
  /* @__PURE__ */ t(q, { onClick: () => h("no"), children: /* @__PURE__ */ t(C, { "aria-label": "thumbs_down", color: "secondary", name: "thumb_down", size: 24 }) }),
1620
1620
  /* @__PURE__ */ t(q, { onClick: () => h("yes"), children: /* @__PURE__ */ t(C, { "aria-label": "thumbs_up", color: "secondary", name: "Thumb_up", size: 24 }) })
1621
1621
  ] })
@@ -1662,7 +1662,7 @@ const Te = ({
1662
1662
  totalSavedText: h
1663
1663
  }) => {
1664
1664
  const m = me(n ? "dark" : "light");
1665
- return /* @__PURE__ */ t(fe, { theme: m, children: /* @__PURE__ */ t(u, { className: "mx-insights-mefr-body", "data-ui-test": "mefr-body", sx: { mb: 16 }, children: /* @__PURE__ */ c(je, { title: s, children: [
1665
+ return /* @__PURE__ */ t(fe, { theme: m, children: /* @__PURE__ */ t(E, { className: "mx-insights-mefr-body", "data-ui-test": "mefr-body", sx: { mb: 16 }, children: /* @__PURE__ */ c(je, { title: s, children: [
1666
1666
  /* @__PURE__ */ t(
1667
1667
  Pe,
1668
1668
  {
@@ -1671,7 +1671,7 @@ const Te = ({
1671
1671
  }
1672
1672
  ),
1673
1673
  /* @__PURE__ */ c(
1674
- u,
1674
+ E,
1675
1675
  {
1676
1676
  className: "mx-insights-mefr-body-content",
1677
1677
  "data-ui-test": "mefr-body-content",
@@ -1796,7 +1796,7 @@ const Te = ({
1796
1796
  },
1797
1797
  children: [
1798
1798
  /* @__PURE__ */ t(
1799
- u,
1799
+ E,
1800
1800
  {
1801
1801
  className: "mx-insights-sdd-account-image-container",
1802
1802
  sx: { display: "flex", justifyContent: "center", width: "100%" },
@@ -1860,7 +1860,7 @@ const Te = ({
1860
1860
  leftLowerText: h,
1861
1861
  leftUpperText: m,
1862
1862
  rightLowerText: p,
1863
- rightUpperText: E,
1863
+ rightUpperText: u,
1864
1864
  sourceAccountGuid: x
1865
1865
  }) => /* @__PURE__ */ t(H.Fragment, { children: d ? /* @__PURE__ */ t(
1866
1866
  le,
@@ -1873,7 +1873,7 @@ const Te = ({
1873
1873
  leftLowerText: h,
1874
1874
  leftUpperText: m,
1875
1875
  rightLowerText: p,
1876
- rightUpperText: E
1876
+ rightUpperText: u
1877
1877
  }
1878
1878
  ) : /* @__PURE__ */ t(
1879
1879
  b1,