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.d.ts CHANGED
@@ -1074,7 +1074,7 @@ declare function LinkButton({ text, type, size, height, width, disabled, textCol
1074
1074
  width?: string;
1075
1075
  disabled?: boolean;
1076
1076
  textColor?: string;
1077
- onClick?: () => void;
1077
+ onClick: any;
1078
1078
  leftIcon?: string;
1079
1079
  rightIcon?: string;
1080
1080
  }): react_jsx_runtime.JSX.Element;
package/dist/index.esm.js CHANGED
@@ -3047,7 +3047,7 @@ const LinkButton = _ref => {
3047
3047
  width = '',
3048
3048
  disabled = false,
3049
3049
  textColor = '',
3050
- onClick = () => {},
3050
+ onClick,
3051
3051
  leftIcon = 'none',
3052
3052
  rightIcon = 'none'
3053
3053
  } = _ref;
@@ -13197,14 +13197,14 @@ const DialogOverlay = props => {
13197
13197
  modal.close();
13198
13198
  onDialogClose();
13199
13199
  };
13200
- return /*#__PURE__*/React$1.createElement(ModalWrapper, {
13200
+ return /*#__PURE__*/React.createElement(ModalWrapper, {
13201
13201
  className: className
13202
- }, /*#__PURE__*/React$1.createElement(Modal, null, /*#__PURE__*/React$1.createElement(ModalHeader, null, /*#__PURE__*/React$1.createElement(ModalTitle, null, title), /*#__PURE__*/React$1.createElement(ModalClose, {
13202
+ }, /*#__PURE__*/React.createElement(Modal, null, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, null, title), /*#__PURE__*/React.createElement(ModalClose, {
13203
13203
  type: "button",
13204
13204
  onClick: closeModal
13205
- }, /*#__PURE__*/React$1.createElement(CloseXIcon, {
13205
+ }, /*#__PURE__*/React.createElement(CloseXIcon, {
13206
13206
  fill: "white"
13207
- }))), /*#__PURE__*/React$1.createElement(ModalBody, {
13207
+ }))), /*#__PURE__*/React.createElement(ModalBody, {
13208
13208
  id: "modalBody"
13209
13209
  }, children)));
13210
13210
  };
@@ -30338,7 +30338,8 @@ const BubbleChart = _ref => {
30338
30338
  // Calculate domains based on median-centered logic
30339
30339
  const calculateDomainBasedOnMedian = (min, max, median) => {
30340
30340
  const distance = Math.max(Math.abs(max - median), Math.abs(min - median));
30341
- return [median - distance, median + distance];
30341
+ const padding = distance * 0.01 || 0.01; // Add 1% padding or minimum 0.01
30342
+ return [median - distance - padding, median + distance + padding];
30342
30343
  };
30343
30344
 
30344
30345
  // const calculateDomainBasedOnMedian = (min, max, median) => {
@@ -30838,7 +30839,23 @@ const BubbleChart = _ref => {
30838
30839
  range: [0, 7000],
30839
30840
  domain: [0, Math.max(...data.map(item => item.size || 0))],
30840
30841
  "data-testid": "z-axis"
30841
- }), /*#__PURE__*/React$1.createElement(ReferenceLine, {
30842
+ }), /*#__PURE__*/React$1.createElement(Scatter, {
30843
+ name: "Bubble Chart",
30844
+ data: visibleData,
30845
+ shape: "circle",
30846
+ fill: "transparent",
30847
+ isAnimationActive: false,
30848
+ animationBegin: 0,
30849
+ animationDuration: 0,
30850
+ "data-testid": "scatter"
30851
+ }, visibleData.map((entry, index) => /*#__PURE__*/React$1.createElement(Cell, {
30852
+ key: entry.key,
30853
+ fill: entry.fill,
30854
+ stroke: "rgba(255,255,255,0.6)",
30855
+ strokeWidth: 1.5,
30856
+ filter: "url(#bubble-blur)",
30857
+ "data-testid": `cell-${index}`
30858
+ }))), /*#__PURE__*/React$1.createElement(ReferenceLine, {
30842
30859
  x: xMedian,
30843
30860
  stroke: "#D0D0D0",
30844
30861
  strokeDasharray: "4 4",
@@ -30957,23 +30974,7 @@ const BubbleChart = _ref => {
30957
30974
  y: false
30958
30975
  },
30959
30976
  "data-testid": "tooltip"
30960
- }), /*#__PURE__*/React$1.createElement(Scatter, {
30961
- name: "Bubble Chart",
30962
- data: visibleData,
30963
- shape: "circle",
30964
- fill: "transparent",
30965
- isAnimationActive: false,
30966
- animationBegin: 0,
30967
- animationDuration: 0,
30968
- "data-testid": "scatter"
30969
- }, visibleData.map((entry, index) => /*#__PURE__*/React$1.createElement(Cell, {
30970
- key: entry.key,
30971
- fill: entry.fill,
30972
- stroke: "rgba(255,255,255,0.6)",
30973
- strokeWidth: 1.5,
30974
- filter: "url(#bubble-blur)",
30975
- "data-testid": `cell-${index}`
30976
- }))), isMiddleValueVisible && /*#__PURE__*/React$1.createElement(ReferenceLine, {
30977
+ }), isMiddleValueVisible && /*#__PURE__*/React$1.createElement(ReferenceLine, {
30977
30978
  x: xMedian,
30978
30979
  y: yMedian,
30979
30980
  stroke: "transparent",
@@ -30984,27 +30985,8 @@ const BubbleChart = _ref => {
30984
30985
  viewBox
30985
30986
  } = _ref8;
30986
30987
  // Calculate the exact position of the median point in the SVG
30987
- const xPos = viewBox.x + (xMedian - viewDomain.x[0]) / (viewDomain.x[1] - viewDomain.x[0]) * viewBox.width;
30988
- const yPos = viewBox.y + (1 - (yMedian - viewDomain.y[0]) / (viewDomain.y[1] - viewDomain.y[0])) * viewBox.height;
30989
-
30990
- // Calculate normalized position of median in domain
30991
- // const xNorm = (xMedian - viewDomain.x[0]) / (viewDomain.x[1] - viewDomain.x[0]);
30992
- // const yNorm = (yMedian - viewDomain.y[0]) / (viewDomain.y[1] - viewDomain.y[0]);
30993
-
30994
- // // If median is within 2% of the edge, center the label
30995
- // const isXEdge = xNorm < 0.02 || xNorm > 0.98;
30996
- // const isYEdge = yNorm < 0.02 || yNorm > 0.98;
30997
-
30998
- // let xPos, yPos;
30999
- // if (isXEdge || isYEdge) {
31000
- // // Center of SVG
31001
- // xPos = viewBox.x + viewBox.width / 2;
31002
- // yPos = viewBox.y + viewBox.height / 2;
31003
- // } else {
31004
- // // Median's data position
31005
- // xPos = viewBox.x + xNorm * viewBox.width;
31006
- // yPos = viewBox.y + (1 - yNorm) * viewBox.height;
31007
- // }
30988
+ 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;
30989
+ 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;
31008
30990
  return /*#__PURE__*/React$1.createElement("text", {
31009
30991
  x: xPos,
31010
30992
  y: yPos,
@@ -31671,7 +31653,7 @@ const BarLine = props => {
31671
31653
  inc_sales,
31672
31654
  inc_roi
31673
31655
  } = payload[0].payload;
31674
- return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle$4, null, label), /*#__PURE__*/React$1.createElement(TooltipText, null, description), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales: ${getFormattedValue(inc_sales)}${getFormattedUnits(inc_sales)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(inc_roi)}${getFormattedUnits(inc_roi)}`));
31656
+ return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle$4, null, label), /*#__PURE__*/React$1.createElement(TooltipText, null, description), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales: $${getFormattedValue(inc_sales)}${getFormattedUnits(inc_sales)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(inc_roi)}${getFormattedUnits(inc_roi)}`));
31675
31657
  });
31676
31658
  return /*#__PURE__*/React$1.createElement("div", {
31677
31659
  style: {
@@ -31719,7 +31701,7 @@ const BarLine = props => {
31719
31701
  }, /*#__PURE__*/React$1.createElement(LabelList, {
31720
31702
  dataKey: "inc_roi",
31721
31703
  position: "top",
31722
- formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31704
+ formatter: value => `${getFormattedValue(value)}${getFormattedUnits(value)}`,
31723
31705
  fill: "#212121",
31724
31706
  fontSize: 15,
31725
31707
  fontWeight: "400",
@@ -31801,7 +31783,8 @@ const BarLine = props => {
31801
31783
  const SingleChart = props => {
31802
31784
  const {
31803
31785
  barData,
31804
- color
31786
+ color,
31787
+ legendLabel
31805
31788
  } = props;
31806
31789
  const MAX_CHARS_PER_LINE = getMaxCharsPerLine(barData.length);
31807
31790
  const MAX_LINES = 2;
@@ -31909,7 +31892,7 @@ const SingleChart = props => {
31909
31892
  }, /*#__PURE__*/React$1.createElement(LabelList, {
31910
31893
  dataKey: "value",
31911
31894
  position: "top",
31912
- formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31895
+ formatter: value => `${legendLabel === "INC Units" ? "" : "$"}${getFormattedValue(value)}${getFormattedUnits(value)}`,
31913
31896
  fill: "#212121",
31914
31897
  fontSize: 16,
31915
31898
  fontWeight: "400",
@@ -31927,7 +31910,7 @@ const SingleChart = props => {
31927
31910
  legendData: [{
31928
31911
  iconColor: color,
31929
31912
  iconType: "Square",
31930
- title: "INC Units"
31913
+ title: legendLabel
31931
31914
  }]
31932
31915
  }));
31933
31916
  };
@@ -32147,10 +32130,12 @@ const BrushChart = props => {
32147
32130
  brushAreaBarData: brushAreaBarData
32148
32131
  }), selectedOption === "INC Units" && /*#__PURE__*/React$1.createElement(SingleChart, {
32149
32132
  color: barChartColor,
32150
- barData: brushBarIncData
32133
+ barData: brushBarIncData,
32134
+ legendLabel: "INC Units"
32151
32135
  }), selectedOption === "Basket Lift" && /*#__PURE__*/React$1.createElement(SingleChart, {
32152
32136
  color: barChartColor,
32153
- barData: brushBarBasketData
32137
+ barData: brushBarBasketData,
32138
+ legendLabel: "Basket Lift"
32154
32139
  })));
32155
32140
  };
32156
32141