@mx-cartographer/insights-ui 1.4.6-alpha.mega15 → 1.4.6-alpha.mega16

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.
@@ -3,6 +3,7 @@ import { MenuItemProps } from './CardMenuItem';
3
3
  export interface CardHeaderProps {
4
4
  ariaLabel?: string;
5
5
  menuItems?: MenuItemProps[];
6
+ onActionOpen?: () => void;
6
7
  onClick?: (index: number, key: string) => void;
7
8
  shouldShowMenu?: boolean;
8
9
  subHeader?: React.ReactNode;
package/dist/index.es.js CHANGED
@@ -237,7 +237,7 @@ const Ve = ({
237
237
  height: o
238
238
  }) => {
239
239
  const [s, m] = y.useState(null), h = () => {
240
- const u = document.getElementsByClassName("mx-mini-insight-card")[0].clientHeight, f = document.getElementsByClassName("mx-mini-insight-card-header")[0].clientHeight + document.getElementsByClassName("mx-mini-insight-card-content-body")[0].clientHeight, E = u - f - 24;
240
+ const f = 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, E = f - u - 24;
241
241
  m(Math.floor(E / 20));
242
242
  };
243
243
  return y.useEffect(() => (h(), window.addEventListener("resize", h), () => window.removeEventListener("resize", h)), []), /* @__PURE__ */ t(
@@ -369,8 +369,8 @@ const Ve = ({
369
369
  le(() => {
370
370
  const h = new ResizeObserver(() => {
371
371
  if (o.current) {
372
- const f = o.current.getBoundingClientRect().width / 2;
373
- o.current.querySelector("text").setAttribute("transform", `translate(${f}, -8)`);
372
+ const u = o.current.getBoundingClientRect().width / 2;
373
+ o.current.querySelector("text").setAttribute("transform", `translate(${u}, -8)`);
374
374
  }
375
375
  });
376
376
  return o.current && h.observe(o.current), () => {
@@ -403,22 +403,22 @@ const Ve = ({
403
403
  onBarClick: o
404
404
  }) => {
405
405
  const s = b(), m = K(() => {
406
- const f = `${l}80`;
407
- return a === void 0 ? [...new Array(n.length - 1).fill(f), l] : n.map((E, A) => A === a ? l : f);
406
+ const u = `${l}80`;
407
+ return a === void 0 ? [...new Array(n.length - 1).fill(u), l] : n.map((E, A) => A === a ? l : u);
408
408
  }, [l, n, a]), h = re(
409
- (f, { dataIndex: E }) => o && o(E),
409
+ (u, { dataIndex: E }) => o && o(E),
410
410
  [o]
411
- ), u = K(
411
+ ), f = K(
412
412
  () => ({
413
413
  series: [
414
414
  {
415
- data: n.map(({ value: f }) => f),
415
+ data: n.map(({ value: u }) => u),
416
416
  type: "bar"
417
417
  }
418
418
  ],
419
419
  xAxis: [
420
420
  {
421
- data: n.map(({ label: f }) => f),
421
+ data: n.map(({ label: u }) => u),
422
422
  scaleType: "band",
423
423
  categoryGapRatio: 0.47
424
424
  // Matches the pulse width
@@ -428,14 +428,14 @@ const Ve = ({
428
428
  [n]
429
429
  );
430
430
  return /* @__PURE__ */ c(x, { alignItems: "center", children: [
431
- /* @__PURE__ */ t(p, { sx: { height: 130, width: "100%" }, children: /* @__PURE__ */ t(_, { children: ({ height: f, width: E }) => /* @__PURE__ */ c(
431
+ /* @__PURE__ */ t(p, { sx: { height: 130, width: "100%" }, children: /* @__PURE__ */ t(_, { children: ({ height: u, width: E }) => /* @__PURE__ */ c(
432
432
  pe,
433
433
  {
434
- height: f,
434
+ height: u,
435
435
  margin: { left: 16, right: 16, top: 38, bottom: 30 },
436
- series: u.series,
436
+ series: f.series,
437
437
  width: E,
438
- xAxis: u.xAxis,
438
+ xAxis: f.xAxis,
439
439
  children: [
440
440
  i?.average && /* @__PURE__ */ t(
441
441
  ue,
@@ -558,21 +558,21 @@ const Ve = ({
558
558
  rightLowerText: s,
559
559
  rightUpperText: m
560
560
  }) => {
561
- const h = a ? P : j, u = F(null), { height: f, width: E } = De(u);
561
+ const h = a ? P : j, f = F(null), { height: u, width: E } = De(f);
562
562
  return /* @__PURE__ */ c(
563
563
  p,
564
564
  {
565
565
  alignItems: "center",
566
566
  display: "flex",
567
567
  justifyContent: "center",
568
- ref: u,
568
+ ref: f,
569
569
  sx: (A) => ({
570
570
  backgroundColor: A.palette.grey[200],
571
571
  padding: 16
572
572
  }),
573
573
  width: "100%",
574
574
  children: [
575
- /* @__PURE__ */ t(We, { height: f, shouldRun: l.shouldRun, width: E }),
575
+ /* @__PURE__ */ t(We, { height: u, shouldRun: l.shouldRun, width: E }),
576
576
  /* @__PURE__ */ c(
577
577
  v,
578
578
  {
@@ -794,8 +794,8 @@ const Ve = ({
794
794
  if (!r.current) return;
795
795
  const d = r.current, a = d.querySelectorAll(".Overlay");
796
796
  ["brand100", "brand200", "brand300", "brand400", "brand500"].forEach((s, m) => {
797
- const h = d.querySelectorAll(`.${s}`), u = (100 + m).toString();
798
- Y(h, I[u]);
797
+ const h = d.querySelectorAll(`.${s}`), f = (100 + m).toString();
798
+ Y(h, I[f]);
799
799
  }), Y(a, I[300]);
800
800
  }, [I]), /* @__PURE__ */ t(
801
801
  "div",
@@ -835,7 +835,8 @@ const Ve = ({
835
835
  name: "more_horiz",
836
836
  size: 24,
837
837
  sx: {
838
- color: "text.primary"
838
+ color: "text.primary",
839
+ fontVariationSettings: "initial"
839
840
  }
840
841
  }
841
842
  )
@@ -873,31 +874,32 @@ const Ve = ({
873
874
  ), e1 = ({
874
875
  ariaLabel: i,
875
876
  menuItems: l = [],
876
- onClick: n,
877
- shouldShowMenu: r = !1,
878
- subHeader: d,
879
- title: a
877
+ onActionOpen: n,
878
+ onClick: r,
879
+ shouldShowMenu: d = !1,
880
+ subHeader: a,
881
+ title: o
880
882
  }) => {
881
- const [o, s] = X(null);
883
+ const [s, m] = X(null);
882
884
  return /* @__PURE__ */ c(w, { children: [
883
885
  /* @__PURE__ */ t(
884
886
  xe,
885
887
  {
886
- action: r && i ? /* @__PURE__ */ t(_e, { ariaLabel: i, onClick: (u) => {
887
- s(u.currentTarget);
888
+ action: d && i ? /* @__PURE__ */ t(_e, { ariaLabel: i, onClick: (u) => {
889
+ m(u.currentTarget), n?.();
888
890
  } }) : null,
889
- subheader: d ?? null,
891
+ subheader: a ?? null,
890
892
  sx: { alignItems: "flex-start", p: 0, mb: 16 },
891
- title: /* @__PURE__ */ t(U, { children: a })
893
+ title: /* @__PURE__ */ t(U, { children: o })
892
894
  }
893
895
  ),
894
- o && /* @__PURE__ */ t(
896
+ s && /* @__PURE__ */ t(
895
897
  $e,
896
898
  {
897
- anchorEl: o,
898
- handleClose: () => s(null),
899
- handleMenuItem: (u, f) => {
900
- n?.(u, f);
899
+ anchorEl: s,
900
+ handleClose: () => m(null),
901
+ handleMenuItem: (u, E) => {
902
+ m(null), r?.(u, E);
901
903
  },
902
904
  menuItems: l
903
905
  }
@@ -1049,8 +1051,8 @@ const Ve = ({
1049
1051
  "data-ui-test": d ? `primary-cta-${i.template}` : `secondary-cta-${i.template}`,
1050
1052
  disabled: l,
1051
1053
  id: d ? `primary-cta-${i.guid}` : `secondary-cta-${i.guid}`,
1052
- onClick: (u) => {
1053
- r(u);
1054
+ onClick: (f) => {
1055
+ r(f);
1054
1056
  },
1055
1057
  variant: o || "outlined",
1056
1058
  ...s,
@@ -1079,8 +1081,8 @@ const Ve = ({
1079
1081
  setRefs: a
1080
1082
  }) => /* @__PURE__ */ t(
1081
1083
  ({ elementTag: s, children: m, ...h }) => {
1082
- const u = s;
1083
- return y.createElement(u, h, m);
1084
+ const f = s;
1085
+ return y.createElement(f, h, m);
1084
1086
  },
1085
1087
  {
1086
1088
  "aria-hidden": i,
@@ -1149,7 +1151,7 @@ const Ve = ({
1149
1151
  },
1150
1152
  marginTop: 12,
1151
1153
  width: "100%"
1152
- }), u = Z(L)({
1154
+ }), f = Z(L)({
1153
1155
  backgroundColor: o.palette.action.active,
1154
1156
  borderRadius: 4,
1155
1157
  fontSize: 16,
@@ -1170,7 +1172,7 @@ const Ve = ({
1170
1172
  },
1171
1173
  children: [
1172
1174
  /* @__PURE__ */ t(
1173
- u,
1175
+ f,
1174
1176
  {
1175
1177
  className: "mx-insights-beat-feedback-submit-button",
1176
1178
  "data-ui-test": "submit-button",
@@ -1257,7 +1259,7 @@ const Ve = ({
1257
1259
  const h = Le(we)({
1258
1260
  height: 93,
1259
1261
  resize: "none"
1260
- }), u = ke();
1262
+ }), f = ke();
1261
1263
  return /* @__PURE__ */ c(
1262
1264
  p,
1263
1265
  {
@@ -1275,8 +1277,8 @@ const Ve = ({
1275
1277
  maxRows: 4,
1276
1278
  minRows: 4,
1277
1279
  name: "Feedback",
1278
- onChange: (f) => {
1279
- s(f.target.value), m(f.target.value);
1280
+ onChange: (u) => {
1281
+ s(u.target.value), m(u.target.value);
1280
1282
  },
1281
1283
  onClick: () => o(),
1282
1284
  placeholder: r,
@@ -1291,7 +1293,7 @@ const Ve = ({
1291
1293
  g,
1292
1294
  {
1293
1295
  sx: {
1294
- color: i && u.palette.error.darker,
1296
+ color: i && f.palette.error.darker,
1295
1297
  fontSize: 12,
1296
1298
  p: "0px !important"
1297
1299
  },
@@ -1445,8 +1447,8 @@ const Ve = ({
1445
1447
  onClose: s,
1446
1448
  sendResponseAnalytics: m,
1447
1449
  upperDescription: h,
1448
- upperList: u,
1449
- yesButtonText: f
1450
+ upperList: f,
1451
+ yesButtonText: u
1450
1452
  }) => /* @__PURE__ */ t(
1451
1453
  de,
1452
1454
  {
@@ -1479,7 +1481,7 @@ const Ve = ({
1479
1481
  /* @__PURE__ */ t(U, { sx: { p: "16px 24px 8px 24px", whiteSpace: "wrap" }, children: l }),
1480
1482
  /* @__PURE__ */ c(x, { sx: { gap: 12, px: 24 }, children: [
1481
1483
  /* @__PURE__ */ t(g, { color: "secondary", fontSize: 13, children: h }),
1482
- /* @__PURE__ */ t(J, { children: u.map((E, A) => /* @__PURE__ */ c(
1484
+ /* @__PURE__ */ t(J, { children: f.map((E, A) => /* @__PURE__ */ c(
1483
1485
  T,
1484
1486
  {
1485
1487
  sx: {
@@ -1564,7 +1566,7 @@ const Ve = ({
1564
1566
  border: `1px solid ${E.palette.border.main}`,
1565
1567
  p: "12 16"
1566
1568
  }),
1567
- children: f
1569
+ children: u
1568
1570
  }
1569
1571
  )
1570
1572
  ] })
@@ -1783,8 +1785,8 @@ const Ve = ({
1783
1785
  isMini: s,
1784
1786
  leftLowerText: m,
1785
1787
  leftUpperText: h,
1786
- rightLowerText: u,
1787
- rightUpperText: f,
1788
+ rightLowerText: f,
1789
+ rightUpperText: u,
1788
1790
  sourceAccountGuid: E
1789
1791
  }) => /* @__PURE__ */ t(y.Fragment, { children: o ? /* @__PURE__ */ t(
1790
1792
  ee,
@@ -1796,8 +1798,8 @@ const Ve = ({
1796
1798
  isMini: s,
1797
1799
  leftLowerText: m,
1798
1800
  leftUpperText: h,
1799
- rightLowerText: u,
1800
- rightUpperText: f
1801
+ rightLowerText: f,
1802
+ rightUpperText: u
1801
1803
  }
1802
1804
  ) : /* @__PURE__ */ t(
1803
1805
  f1,