@mx-cartographer/insights-ui 1.8.13-aplha.JB7 → 1.8.14-alpha.JB

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
@@ -1,6 +1,6 @@
1
1
  import { jsx as e, jsxs as d, Fragment as b } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import J, { useState as X, useRef as z, useLayoutEffect as ne, useMemo as N, useCallback as me, useEffect as oe, forwardRef as R } from "react";
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
5
  import { BottomSheetTransition as pe, Icon as C, P as k, Text as M, InstitutionLogo as Y, H3 as ae, createMXTheme as ue, MerchantLogo as ye, CategoryIcon as ke, CheckmarkFilledIcon as fe } from "@kyper/mui";
6
6
  import Ce from "react-confetti";
@@ -41,8 +41,8 @@ const Ue = ({
41
41
  showBackground: s = !1,
42
42
  width: h = 450
43
43
  }) => {
44
- const [c, m] = J.useState(!1);
45
- return J.useEffect(() => {
44
+ const [c, m] = g.useState(!1);
45
+ return g.useEffect(() => {
46
46
  m(!!i);
47
47
  }, [i]), /* @__PURE__ */ e(
48
48
  Ee,
@@ -109,10 +109,10 @@ const Ue = ({
109
109
  percent: r,
110
110
  height: o = 12
111
111
  }) => {
112
- const [n, a] = xe({ triggerOnce: !0 }), [s, h] = J.useState("0%"), c = r > 100 ? 100 : r;
113
- return J.useEffect(() => {
112
+ const [n, a] = xe({ triggerOnce: !0 }), [s, h] = g.useState("0%"), c = r > 100 ? 100 : r;
113
+ return g.useEffect(() => {
114
114
  a && h(`${c}%`);
115
- }, [a, c]), /* @__PURE__ */ e(J.Fragment, { children: /* @__PURE__ */ d(
115
+ }, [a, c]), /* @__PURE__ */ e(g.Fragment, { children: /* @__PURE__ */ d(
116
116
  w,
117
117
  {
118
118
  "data-ui-test": "progress-bar",
@@ -255,18 +255,18 @@ const Ue = ({
255
255
  subHeader: a,
256
256
  height: s
257
257
  }) => {
258
- const [h, c] = J.useState(null), m = () => {
258
+ const [h, c] = g.useState(null), m = () => {
259
259
  const E = 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, y = E - u - 24;
260
260
  c(Math.floor(y / 20));
261
261
  };
262
- return J.useEffect(() => (m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m)), []), /* @__PURE__ */ e(
262
+ return g.useEffect(() => (m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m)), []), /* @__PURE__ */ e(
263
263
  w,
264
264
  {
265
265
  "aria-labelledby": i.guid,
266
266
  className: "mx-mini-insight-card",
267
267
  ref: n,
268
268
  sx: { height: s, pb: 24, pt: 0, px: 0 },
269
- children: i.dismissed_at ? r : /* @__PURE__ */ d(J.Fragment, { children: [
269
+ children: i.dismissed_at ? r : /* @__PURE__ */ d(g.Fragment, { children: [
270
270
  /* @__PURE__ */ e(
271
271
  ge,
272
272
  {
@@ -364,7 +364,7 @@ const Ue = ({
364
364
  onClose: m,
365
365
  open: !!h,
366
366
  transformOrigin: { horizontal: "right", vertical: "top" },
367
- children: r.map(({ icon: y, key: S, text: v }, g) => /* @__PURE__ */ d(Me, { onClick: () => E(g, S), sx: { padding: 12 }, children: [
367
+ children: r.map(({ icon: y, key: S, text: v }, J) => /* @__PURE__ */ d(Me, { onClick: () => E(J, S), sx: { padding: 12 }, children: [
368
368
  /* @__PURE__ */ e(T, { sx: { minWidth: "32px !important" }, children: y }),
369
369
  /* @__PURE__ */ e(
370
370
  D,
@@ -464,8 +464,8 @@ const Ue = ({
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 = y / 2, g = h.current.querySelector("text");
468
- g && g.setAttribute("transform", `translate(${v}, -8)`);
467
+ const v = y / 2, J = h.current.querySelector("text");
468
+ J && J.setAttribute("transform", `translate(${v}, -8)`);
469
469
  }
470
470
  });
471
471
  });
@@ -521,7 +521,7 @@ const Ue = ({
521
521
  }, [l, r, h]), v = me(
522
522
  (x, { dataIndex: A }) => c && c(A),
523
523
  [c]
524
- ), g = N(
524
+ ), J = N(
525
525
  () => ({
526
526
  series: [
527
527
  {
@@ -545,9 +545,9 @@ const Ue = ({
545
545
  {
546
546
  height: u,
547
547
  margin: n,
548
- series: g.series,
548
+ series: J.series,
549
549
  width: y,
550
- xAxis: g.xAxis,
550
+ xAxis: J.xAxis,
551
551
  children: [
552
552
  i?.average && /* @__PURE__ */ e(
553
553
  Ze,
@@ -948,14 +948,7 @@ const Ue = ({
948
948
  if (n.current) {
949
949
  const s = n.current, h = s.parentElement;
950
950
  if (h) {
951
- console.log("parentElement"), console.log(h);
952
- const c = h.clientHeight;
953
- console.log("parentHeight"), console.log(c);
954
- const m = Array.from(h.children);
955
- console.log("parentChildren"), console.log(m);
956
- const E = m.reduce((v, g) => g !== s ? (console.log(g), console.log(g.clientHeight), v + g.clientHeight) : v, 0);
957
- console.log("nonDescriptionChildrenHeight"), console.log(E);
958
- const u = c - E, y = parseInt(
951
+ const m = Array.from(h.children).reduce((v, J) => J !== s ? v + J.clientHeight : v, 0), u = h.clientHeight - m, y = parseInt(
959
952
  window.getComputedStyle(s).lineHeight,
960
953
  10
961
954
  ), S = Math.floor(u / y);
@@ -1152,7 +1145,7 @@ const Ue = ({
1152
1145
  }) => /* @__PURE__ */ e(
1153
1146
  ({ elementTag: h, children: c, ...m }) => {
1154
1147
  const E = h;
1155
- return J.createElement(E, m, c);
1148
+ return g.createElement(E, m, c);
1156
1149
  },
1157
1150
  {
1158
1151
  "aria-hidden": i,
@@ -1466,7 +1459,7 @@ const R1 = ({
1466
1459
  account_2_alt_text: o,
1467
1460
  isSuccess: n
1468
1461
  }) => {
1469
- const a = J.useRef(null), { height: s, width: h } = Q(a);
1462
+ const a = g.useRef(null), { height: s, width: h } = Q(a);
1470
1463
  return /* @__PURE__ */ e(
1471
1464
  p,
1472
1465
  {
@@ -1936,7 +1929,7 @@ const R1 = ({
1936
1929
  rightLowerText: E,
1937
1930
  rightUpperText: u,
1938
1931
  sourceAccountGuid: y
1939
- }) => /* @__PURE__ */ e(J.Fragment, { children: s ? /* @__PURE__ */ e(
1932
+ }) => /* @__PURE__ */ e(g.Fragment, { children: s ? /* @__PURE__ */ e(
1940
1933
  he,
1941
1934
  {
1942
1935
  account: i,
@@ -2136,7 +2129,7 @@ const R1 = ({
2136
2129
  displayData: o,
2137
2130
  ...n
2138
2131
  }) => {
2139
- const { no_spend_days: a } = i.payload, { noSpendDays: s, dollarBillAltText: h, daysOfTheWeek: c } = o, m = zt[a.length || 0], E = J.useRef(null), { height: u, width: y } = Q(E);
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: u, width: y } = Q(E);
2140
2133
  return /* @__PURE__ */ e(
2141
2134
  L,
2142
2135
  {