sag_components 2.0.0-beta83 → 2.0.0-beta85

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.js CHANGED
@@ -3057,7 +3057,7 @@ const LinkButton = _ref => {
3057
3057
  width = '',
3058
3058
  disabled = false,
3059
3059
  textColor = '',
3060
- onClick = () => {},
3060
+ onClick,
3061
3061
  leftIcon = 'none',
3062
3062
  rightIcon = 'none'
3063
3063
  } = _ref;
@@ -13207,14 +13207,14 @@ const DialogOverlay = props => {
13207
13207
  modal.close();
13208
13208
  onDialogClose();
13209
13209
  };
13210
- return /*#__PURE__*/React__default["default"].createElement(ModalWrapper, {
13210
+ return /*#__PURE__*/React.createElement(ModalWrapper, {
13211
13211
  className: className
13212
- }, /*#__PURE__*/React__default["default"].createElement(Modal, null, /*#__PURE__*/React__default["default"].createElement(ModalHeader, null, /*#__PURE__*/React__default["default"].createElement(ModalTitle, null, title), /*#__PURE__*/React__default["default"].createElement(ModalClose, {
13212
+ }, /*#__PURE__*/React.createElement(Modal, null, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, title), /*#__PURE__*/React.createElement(ModalClose, {
13213
13213
  type: "button",
13214
13214
  onClick: closeModal
13215
- }, /*#__PURE__*/React__default["default"].createElement(CloseXIcon, {
13215
+ }, /*#__PURE__*/React.createElement(CloseXIcon, {
13216
13216
  fill: "white"
13217
- }))), /*#__PURE__*/React__default["default"].createElement(ModalBody, {
13217
+ }))), /*#__PURE__*/React.createElement(ModalBody, {
13218
13218
  id: "modalBody"
13219
13219
  }, children)));
13220
13220
  };
@@ -30348,7 +30348,8 @@ const BubbleChart = _ref => {
30348
30348
  // Calculate domains based on median-centered logic
30349
30349
  const calculateDomainBasedOnMedian = (min, max, median) => {
30350
30350
  const distance = Math.max(Math.abs(max - median), Math.abs(min - median));
30351
- return [median - distance, median + distance];
30351
+ const padding = distance * 0.01 || 0.01; // Add 1% padding or minimum 0.01
30352
+ return [median - distance - padding, median + distance + padding];
30352
30353
  };
30353
30354
 
30354
30355
  // const calculateDomainBasedOnMedian = (min, max, median) => {
@@ -30848,7 +30849,23 @@ const BubbleChart = _ref => {
30848
30849
  range: [0, 7000],
30849
30850
  domain: [0, Math.max(...data.map(item => item.size || 0))],
30850
30851
  "data-testid": "z-axis"
30851
- }), /*#__PURE__*/React__default["default"].createElement(recharts.ReferenceLine, {
30852
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Scatter, {
30853
+ name: "Bubble Chart",
30854
+ data: visibleData,
30855
+ shape: "circle",
30856
+ fill: "transparent",
30857
+ isAnimationActive: false,
30858
+ animationBegin: 0,
30859
+ animationDuration: 0,
30860
+ "data-testid": "scatter"
30861
+ }, visibleData.map((entry, index) => /*#__PURE__*/React__default["default"].createElement(recharts.Cell, {
30862
+ key: entry.key,
30863
+ fill: entry.fill,
30864
+ stroke: "rgba(255,255,255,0.6)",
30865
+ strokeWidth: 1.5,
30866
+ filter: "url(#bubble-blur)",
30867
+ "data-testid": `cell-${index}`
30868
+ }))), /*#__PURE__*/React__default["default"].createElement(recharts.ReferenceLine, {
30852
30869
  x: xMedian,
30853
30870
  stroke: "#D0D0D0",
30854
30871
  strokeDasharray: "4 4",
@@ -30967,23 +30984,7 @@ const BubbleChart = _ref => {
30967
30984
  y: false
30968
30985
  },
30969
30986
  "data-testid": "tooltip"
30970
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Scatter, {
30971
- name: "Bubble Chart",
30972
- data: visibleData,
30973
- shape: "circle",
30974
- fill: "transparent",
30975
- isAnimationActive: false,
30976
- animationBegin: 0,
30977
- animationDuration: 0,
30978
- "data-testid": "scatter"
30979
- }, visibleData.map((entry, index) => /*#__PURE__*/React__default["default"].createElement(recharts.Cell, {
30980
- key: entry.key,
30981
- fill: entry.fill,
30982
- stroke: "rgba(255,255,255,0.6)",
30983
- strokeWidth: 1.5,
30984
- filter: "url(#bubble-blur)",
30985
- "data-testid": `cell-${index}`
30986
- }))), isMiddleValueVisible && /*#__PURE__*/React__default["default"].createElement(recharts.ReferenceLine, {
30987
+ }), isMiddleValueVisible && /*#__PURE__*/React__default["default"].createElement(recharts.ReferenceLine, {
30987
30988
  x: xMedian,
30988
30989
  y: yMedian,
30989
30990
  stroke: "transparent",
@@ -30994,27 +30995,8 @@ const BubbleChart = _ref => {
30994
30995
  viewBox
30995
30996
  } = _ref8;
30996
30997
  // Calculate the exact position of the median point in the SVG
30997
- const xPos = viewBox.x + (xMedian - viewDomain.x[0]) / (viewDomain.x[1] - viewDomain.x[0]) * viewBox.width;
30998
- const yPos = viewBox.y + (1 - (yMedian - viewDomain.y[0]) / (viewDomain.y[1] - viewDomain.y[0])) * viewBox.height;
30999
-
31000
- // Calculate normalized position of median in domain
31001
- // const xNorm = (xMedian - viewDomain.x[0]) / (viewDomain.x[1] - viewDomain.x[0]);
31002
- // const yNorm = (yMedian - viewDomain.y[0]) / (viewDomain.y[1] - viewDomain.y[0]);
31003
-
31004
- // // If median is within 2% of the edge, center the label
31005
- // const isXEdge = xNorm < 0.02 || xNorm > 0.98;
31006
- // const isYEdge = yNorm < 0.02 || yNorm > 0.98;
31007
-
31008
- // let xPos, yPos;
31009
- // if (isXEdge || isYEdge) {
31010
- // // Center of SVG
31011
- // xPos = viewBox.x + viewBox.width / 2;
31012
- // yPos = viewBox.y + viewBox.height / 2;
31013
- // } else {
31014
- // // Median's data position
31015
- // xPos = viewBox.x + xNorm * viewBox.width;
31016
- // yPos = viewBox.y + (1 - yNorm) * viewBox.height;
31017
- // }
30998
+ const xPos = viewDomain.x[1] - viewDomain.x[0] === 0 ? viewBox.x + viewBox.width / 2 : viewBox.x + (xMedian - viewDomain.x[0]) / (viewDomain.x[1] - viewDomain.x[0]) * viewBox.width;
30999
+ const yPos = viewDomain.y[1] - viewDomain.y[0] === 0 ? viewBox.y + viewBox.height / 2 : viewBox.y + (1 - (yMedian - viewDomain.y[0]) / (viewDomain.y[1] - viewDomain.y[0])) * viewBox.height;
31018
31000
  return /*#__PURE__*/React__default["default"].createElement("text", {
31019
31001
  x: xPos,
31020
31002
  y: yPos,
@@ -31681,7 +31663,7 @@ const BarLine = props => {
31681
31663
  inc_sales,
31682
31664
  inc_roi
31683
31665
  } = payload[0].payload;
31684
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$4, null, label), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, description), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales: ${getFormattedValue(inc_sales)}${getFormattedUnits(inc_sales)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(inc_roi)}${getFormattedUnits(inc_roi)}`));
31666
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$4, null, label), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, description), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales: $${getFormattedValue(inc_sales)}${getFormattedUnits(inc_sales)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(inc_roi)}${getFormattedUnits(inc_roi)}`));
31685
31667
  });
31686
31668
  return /*#__PURE__*/React__default["default"].createElement("div", {
31687
31669
  style: {
@@ -31729,7 +31711,7 @@ const BarLine = props => {
31729
31711
  }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31730
31712
  dataKey: "inc_roi",
31731
31713
  position: "top",
31732
- formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31714
+ formatter: value => `${getFormattedValue(value)}${getFormattedUnits(value)}`,
31733
31715
  fill: "#212121",
31734
31716
  fontSize: 15,
31735
31717
  fontWeight: "400",
@@ -31811,7 +31793,8 @@ const BarLine = props => {
31811
31793
  const SingleChart = props => {
31812
31794
  const {
31813
31795
  barData,
31814
- color
31796
+ color,
31797
+ legendLabel
31815
31798
  } = props;
31816
31799
  const MAX_CHARS_PER_LINE = getMaxCharsPerLine(barData.length);
31817
31800
  const MAX_LINES = 2;
@@ -31919,7 +31902,7 @@ const SingleChart = props => {
31919
31902
  }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31920
31903
  dataKey: "value",
31921
31904
  position: "top",
31922
- formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31905
+ formatter: value => `${legendLabel === "INC Units" ? "" : "$"}${getFormattedValue(value)}${getFormattedUnits(value)}`,
31923
31906
  fill: "#212121",
31924
31907
  fontSize: 16,
31925
31908
  fontWeight: "400",
@@ -31937,7 +31920,7 @@ const SingleChart = props => {
31937
31920
  legendData: [{
31938
31921
  iconColor: color,
31939
31922
  iconType: "Square",
31940
- title: "INC Units"
31923
+ title: legendLabel
31941
31924
  }]
31942
31925
  }));
31943
31926
  };
@@ -32157,10 +32140,12 @@ const BrushChart = props => {
32157
32140
  brushAreaBarData: brushAreaBarData
32158
32141
  }), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32159
32142
  color: barChartColor,
32160
- barData: brushBarIncData
32143
+ barData: brushBarIncData,
32144
+ legendLabel: "INC Units"
32161
32145
  }), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32162
32146
  color: barChartColor,
32163
- barData: brushBarBasketData
32147
+ barData: brushBarBasketData,
32148
+ legendLabel: "Basket Lift"
32164
32149
  })));
32165
32150
  };
32166
32151