sag_components 2.0.0-beta66 → 2.0.0-beta67

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
@@ -1943,7 +1943,7 @@ const TitleAndValueContainer$4 = styled__default["default"].div`
1943
1943
  flex-direction: column;
1944
1944
  padding: 0 20px;
1945
1945
  `;
1946
- const Title$e = styled__default["default"].h4`
1946
+ const Title$f = styled__default["default"].h4`
1947
1947
  font-weight: 400;
1948
1948
  font-size: 18px;
1949
1949
  margin: 0 0 8px;
@@ -2078,7 +2078,7 @@ const AvarageDelimiter = styled__default["default"].div`
2078
2078
  `;
2079
2079
 
2080
2080
  /* Custom properties */
2081
- const TooltipContainer$3 = styled__default["default"].div`
2081
+ const TooltipContainer$4 = styled__default["default"].div`
2082
2082
  --tooltip-text-color: black;
2083
2083
  --tooltip-background-color: white;
2084
2084
  --tooltip-margin: 40px;
@@ -2104,7 +2104,7 @@ const TooltipTip$1 = styled__default["default"].div`
2104
2104
  font-size: 12px;
2105
2105
  font-family: sans-serif;
2106
2106
  line-height: 1;
2107
- z-index: 100;
2107
+ z-index: 99999;
2108
2108
  white-space: nowrap;
2109
2109
 
2110
2110
  /* CSS border triangles */
@@ -2120,7 +2120,6 @@ const TooltipTip$1 = styled__default["default"].div`
2120
2120
  margin-left: calc(var(--tooltip-arrow-size) * -1);
2121
2121
  }
2122
2122
 
2123
- /* Absolute positioning */
2124
2123
  &.controls.top {
2125
2124
  top: calc(var(--tooltip-margin) * ${props => props.topFactor || -1.8} );
2126
2125
  }
@@ -2131,7 +2130,6 @@ const TooltipTip$1 = styled__default["default"].div`
2131
2130
  border-top-color: var(--tooltip-background-color);
2132
2131
  }
2133
2132
 
2134
- /* Absolute positioning */
2135
2133
  &.controls.right {
2136
2134
  left: calc(70% + var(--tooltip-margin));
2137
2135
  top: 50%;
@@ -2146,7 +2144,6 @@ const TooltipTip$1 = styled__default["default"].div`
2146
2144
  border-right-color: var(--tooltip-background-color);
2147
2145
  }
2148
2146
 
2149
- /* Absolute positioning */
2150
2147
  &.controls.bottom {
2151
2148
  bottom: calc(var(--tooltip-margin) * -1);
2152
2149
  }
@@ -2156,7 +2153,6 @@ const TooltipTip$1 = styled__default["default"].div`
2156
2153
  border-bottom-color: var(--tooltip-background-color);
2157
2154
  }
2158
2155
 
2159
- /* Absolute positioning */
2160
2156
  &.controls.left {
2161
2157
  left: auto;
2162
2158
  right: calc(70% + var(--tooltip-margin));
@@ -2192,7 +2188,7 @@ const Tooltip$1 = props => {
2192
2188
  clearInterval(timeout);
2193
2189
  setActive(false);
2194
2190
  };
2195
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$3, null, /*#__PURE__*/React__default["default"].createElement(TooltipWrapper$2, {
2191
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$4, null, /*#__PURE__*/React__default["default"].createElement(TooltipWrapper$2, {
2196
2192
  onMouseEnter: showTip,
2197
2193
  onMouseLeave: hideTip
2198
2194
  }, children, active && /*#__PURE__*/React__default["default"].createElement(TooltipTip$1, {
@@ -2423,7 +2419,7 @@ const PieChart = props => {
2423
2419
  width: width
2424
2420
  }, !hideTitleAndValue && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$4, {
2425
2421
  className: "TitleAndValueContainer"
2426
- }, /*#__PURE__*/React__default["default"].createElement(Title$e, {
2422
+ }, /*#__PURE__*/React__default["default"].createElement(Title$f, {
2427
2423
  className: "Title"
2428
2424
  }, title), /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer$2, {
2429
2425
  className: "CurrencySignAndFormattedValueContainer"
@@ -11149,7 +11145,7 @@ const TooltipTextContainer = styled__default["default"].div`
11149
11145
  cursor: pointer;
11150
11146
  }
11151
11147
  `;
11152
- const TooltipText$1 = styled__default["default"].div`
11148
+ const TooltipText$2 = styled__default["default"].div`
11153
11149
  margin: 0;
11154
11150
  `;
11155
11151
 
@@ -11319,8 +11315,8 @@ const FilterPanel = props => {
11319
11315
  fieldsData: newFieldsDataState
11320
11316
  });
11321
11317
  };
11322
- const getTooltipTextDates = () => /*#__PURE__*/React__default["default"].createElement(TooltipTextContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipText$1, null, "Dates can be selected"), /*#__PURE__*/React__default["default"].createElement(TooltipText$1, null, "only after selecting"), /*#__PURE__*/React__default["default"].createElement(TooltipText$1, null, "period types"));
11323
- const getTooltipTextGoButton = () => /*#__PURE__*/React__default["default"].createElement(TooltipTextContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipText$1, null, tooltipTextGoButton));
11318
+ const getTooltipTextDates = () => /*#__PURE__*/React__default["default"].createElement(TooltipTextContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipText$2, null, "Dates can be selected"), /*#__PURE__*/React__default["default"].createElement(TooltipText$2, null, "only after selecting"), /*#__PURE__*/React__default["default"].createElement(TooltipText$2, null, "period types"));
11319
+ const getTooltipTextGoButton = () => /*#__PURE__*/React__default["default"].createElement(TooltipTextContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipText$2, null, tooltipTextGoButton));
11324
11320
  const getYearsArray = () => {
11325
11321
  const currentYear = moment().year();
11326
11322
  const previousYear = moment().subtract(1, 'years').year();
@@ -25397,7 +25393,7 @@ const TitleAndValueContainer$3 = styled__default["default"].div`
25397
25393
  display: flex;
25398
25394
  flex-direction: column;
25399
25395
  `;
25400
- const Title$d = styled__default["default"].h4`
25396
+ const Title$e = styled__default["default"].h4`
25401
25397
  font-weight: 400;
25402
25398
  font-size: 20px;
25403
25399
  margin: 0;
@@ -25460,7 +25456,7 @@ const FormattedValue$3 = props => {
25460
25456
  width: width
25461
25457
  }, /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$3, {
25462
25458
  className: "TitleAndValueContainer"
25463
- }, title ? /*#__PURE__*/React__default["default"].createElement(Title$d, {
25459
+ }, title ? /*#__PURE__*/React__default["default"].createElement(Title$e, {
25464
25460
  className: "Title",
25465
25461
  width: width
25466
25462
  }, title) : '', showTopValue && /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer$1, {
@@ -25472,7 +25468,7 @@ const FormattedValue$3 = props => {
25472
25468
  className: "CurrencySignOrPercent"
25473
25469
  }, currencySign ? getCurrencySign(currencyType, value) : ''), dotCut ? getFormattedValue(value && Math.abs(value) > 0 && value % 1 !== 0 ? value?.toFixed(2) : value) : getNumberWithCommas(value), dotCut ? getFormattedUnits(value) : '', /*#__PURE__*/React__default["default"].createElement(CurrencySignOrPercent, {
25474
25470
  className: "CurrencySignOrPercent"
25475
- }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default["default"].createElement(Title$d, {
25471
+ }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default["default"].createElement(Title$e, {
25476
25472
  className: "Title",
25477
25473
  width: width
25478
25474
  }, subtitle) : '')));
@@ -25534,7 +25530,7 @@ const TooltipLabel$3 = styled__default["default"].div`
25534
25530
  font-weight: 400;
25535
25531
  width: fit-content;
25536
25532
  `;
25537
- const TooltipTitle$3 = styled__default["default"].div`
25533
+ const TooltipTitle$4 = styled__default["default"].div`
25538
25534
  color: #212121;
25539
25535
  font-size: 14px;
25540
25536
  font-weight: 600;
@@ -25542,7 +25538,7 @@ const TooltipTitle$3 = styled__default["default"].div`
25542
25538
  const TitleAndValueContainer$2 = styled__default["default"].div`
25543
25539
  padding: 0 1rem;
25544
25540
  `;
25545
- const Title$c = styled__default["default"].h5`
25541
+ const Title$d = styled__default["default"].h5`
25546
25542
  font-weight: 500;
25547
25543
  font-size: 18px;
25548
25544
  line-height: 20px;
@@ -25671,7 +25667,7 @@ const TitleAndIconContainer = styled__default["default"].div`
25671
25667
  display: flex;
25672
25668
  align-items: center;
25673
25669
  `;
25674
- const Title$b = styled__default["default"].h4`
25670
+ const Title$c = styled__default["default"].h4`
25675
25671
  font-weight: 400;
25676
25672
  font-size: 14px;
25677
25673
  line-height: 27px;
@@ -25725,7 +25721,7 @@ const PerformanceAnalyticsLegend = props => {
25725
25721
  color: item.iconColor
25726
25722
  }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React__default["default"].createElement(LegendLineIcon, {
25727
25723
  color: item.iconColor
25728
- }) : '', /*#__PURE__*/React__default["default"].createElement(Title$b, {
25724
+ }) : '', /*#__PURE__*/React__default["default"].createElement(Title$c, {
25729
25725
  id: "Title",
25730
25726
  width: width
25731
25727
  }, item.title))))) : '');
@@ -25823,7 +25819,7 @@ const BarChartsByWeeks = props => {
25823
25819
  let currentTooltipSecondValue = 0;
25824
25820
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
25825
25821
  if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
25826
- return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$3, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$3, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipTitle}
25822
+ return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$3, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$4, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipTitle}
25827
25823
  ${displayFormattedValue(currentTooltipValue)}
25828
25824
  `), currentTooltipSecondValue ? /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
25829
25825
  ${displayFormattedValue(currentTooltipSecondValue)}
@@ -25880,7 +25876,7 @@ const BarChartsByWeeks = props => {
25880
25876
  ref: controlsContainerRef
25881
25877
  }, /*#__PURE__*/React__default["default"].createElement(Controls$6, {
25882
25878
  height: getControlsHeight()
25883
- }, showTitle && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React__default["default"].createElement(Title$c, null, title), /*#__PURE__*/React__default["default"].createElement(FormattedValue$3, {
25879
+ }, showTitle && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React__default["default"].createElement(Title$d, null, title), /*#__PURE__*/React__default["default"].createElement(FormattedValue$3, {
25884
25880
  title: headerValueTopTitle,
25885
25881
  subtitle: headerValueBottomTitle,
25886
25882
  showTopValue: showHeaderTopValue,
@@ -26113,7 +26109,7 @@ const TitleAndValueContainer$1 = styled__default["default"].div`
26113
26109
  flex-direction: column;
26114
26110
  padding: 0 1.25em; /* 20px → 1.25em */
26115
26111
  `;
26116
- const Title$a = styled__default["default"].h4`
26112
+ const Title$b = styled__default["default"].h4`
26117
26113
  font-weight: 500;
26118
26114
  font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26119
26115
  margin: 0;
@@ -26316,7 +26312,7 @@ const TotalDoughnutChart = props => {
26316
26312
  width: width
26317
26313
  }, !hideTitleAndValue && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$1, {
26318
26314
  className: "TitleAndValueContainer"
26319
- }, /*#__PURE__*/React__default["default"].createElement(Title$a, {
26315
+ }, /*#__PURE__*/React__default["default"].createElement(Title$b, {
26320
26316
  className: "Title",
26321
26317
  fontSize: titleFontSize
26322
26318
  }, title), /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer, {
@@ -26446,7 +26442,7 @@ CustomTooltip.defaultProps = {
26446
26442
  isPercent: false
26447
26443
  };
26448
26444
 
26449
- const TooltipContainer$2 = styled__default["default"].div`
26445
+ const TooltipContainer$3 = styled__default["default"].div`
26450
26446
  --tooltip-text-color: black;
26451
26447
  --tooltip-background-color: white;
26452
26448
  --tooltip-margin: 40px;
@@ -26552,7 +26548,7 @@ const Tooltip = props => {
26552
26548
  direction,
26553
26549
  content
26554
26550
  } = props;
26555
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$2, {
26551
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$3, {
26556
26552
  className: className,
26557
26553
  top: `${top}px`,
26558
26554
  left: `${left}px`
@@ -26638,7 +26634,7 @@ const TotalValue = styled__default["default"].div`
26638
26634
  font-size: 20px;
26639
26635
  }
26640
26636
  `;
26641
- const Title$9 = styled__default["default"].h4`
26637
+ const Title$a = styled__default["default"].h4`
26642
26638
  font-size: 18px;
26643
26639
  font-weight: 400;
26644
26640
  line-height: 1;
@@ -26795,7 +26791,7 @@ const TotalHorizontalCharts = props => {
26795
26791
  }, chartsData?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(CardHeader, {
26796
26792
  ref: topHeader,
26797
26793
  className: "CardHeader"
26798
- }, !hideTitle ? /*#__PURE__*/React__default["default"].createElement(Title$9, null, title) : '', !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(TotalValue, {
26794
+ }, !hideTitle ? /*#__PURE__*/React__default["default"].createElement(Title$a, null, title) : '', !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(TotalValue, {
26799
26795
  className: "TotalValue"
26800
26796
  }, currencySign && /*#__PURE__*/React__default["default"].createElement(CurrencySign, {
26801
26797
  className: "CurrencySign"
@@ -27268,7 +27264,7 @@ const ItemContainer = styled__default["default"].div`
27268
27264
  flex-direction: column;
27269
27265
  flex-wrap: wrap;
27270
27266
  `;
27271
- const Title$8 = styled__default["default"].h4`
27267
+ const Title$9 = styled__default["default"].h4`
27272
27268
  font-size: 18px;
27273
27269
  font-weight: 500;
27274
27270
  margin: 0;
@@ -27384,7 +27380,7 @@ const SalesAndROI = props => {
27384
27380
  showBorderShadow: showBorderShadow
27385
27381
  }, /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer, {
27386
27382
  id: "TitleAndValueContainer"
27387
- }, /*#__PURE__*/React__default["default"].createElement(Title$8, {
27383
+ }, /*#__PURE__*/React__default["default"].createElement(Title$9, {
27388
27384
  id: "Title"
27389
27385
  }, title), showBanner && /*#__PURE__*/React__default["default"].createElement(OutBanner, {
27390
27386
  id: "OutBanner",
@@ -27483,7 +27479,7 @@ const TitleContainer$1 = styled__default["default"].div`
27483
27479
  margin: 0;
27484
27480
  border-bottom: 1px solid #b1b1b1;
27485
27481
  `;
27486
- const Title$7 = styled__default["default"].p`
27482
+ const Title$8 = styled__default["default"].p`
27487
27483
  font-weight: 400;
27488
27484
  font-size: 24px;
27489
27485
  margin: 0;
@@ -27703,7 +27699,7 @@ const PopupCharts = props => {
27703
27699
  height: height,
27704
27700
  width: width,
27705
27701
  onClick: e => e.stopPropagation()
27706
- }, /*#__PURE__*/React__default["default"].createElement(TitleContainer$1, null, /*#__PURE__*/React__default["default"].createElement(Title$7, null, title), /*#__PURE__*/React__default["default"].createElement(CloseXIconContainer, {
27702
+ }, /*#__PURE__*/React__default["default"].createElement(TitleContainer$1, null, /*#__PURE__*/React__default["default"].createElement(Title$8, null, title), /*#__PURE__*/React__default["default"].createElement(CloseXIconContainer, {
27707
27703
  onClick: e => closePopupCharts(e)
27708
27704
  }, /*#__PURE__*/React__default["default"].createElement(CloseXIcon, null))), /*#__PURE__*/React__default["default"].createElement(ChartsContainer, {
27709
27705
  id: "ChartsContainer",
@@ -27801,7 +27797,7 @@ const TopToggleListMainContainer = styled__default["default"].div`
27801
27797
  padding: 0 24px;
27802
27798
  width: ${props => props.width};
27803
27799
  `;
27804
- const Title$6 = styled__default["default"].h4`
27800
+ const Title$7 = styled__default["default"].h4`
27805
27801
  font-size: 14px;
27806
27802
  font-weight: 600;
27807
27803
  margin: 20px 0 12px;
@@ -27831,7 +27827,7 @@ const TopToggleList = props => {
27831
27827
  } = props;
27832
27828
  return /*#__PURE__*/React__default["default"].createElement(TopToggleListMainContainer, {
27833
27829
  width: width
27834
- }, /*#__PURE__*/React__default["default"].createElement(Title$6, null, title), /*#__PURE__*/React__default["default"].createElement(ListContainer, {
27830
+ }, /*#__PURE__*/React__default["default"].createElement(Title$7, null, title), /*#__PURE__*/React__default["default"].createElement(ListContainer, {
27835
27831
  height: height
27836
27832
  }, list.map(item => /*#__PURE__*/React__default["default"].createElement(ListItem, {
27837
27833
  key: item.value
@@ -27893,7 +27889,7 @@ const TitleContainer = styled__default["default"].div`
27893
27889
  justify-content: flex-start;
27894
27890
  margin: 0 0 10px 0;
27895
27891
  `;
27896
- const Title$5 = styled__default["default"].h3`
27892
+ const Title$6 = styled__default["default"].h3`
27897
27893
  user-select: none;
27898
27894
  text-align: left;
27899
27895
  margin: 0;
@@ -27938,7 +27934,7 @@ const BarLabel = styled__default["default"].span`
27938
27934
  font-weight: 400;
27939
27935
  user-select: none;
27940
27936
  `;
27941
- const TooltipContainer$1 = styled__default["default"].div`
27937
+ const TooltipContainer$2 = styled__default["default"].div`
27942
27938
  position: absolute;
27943
27939
 
27944
27940
  top: ${props => props.top};
@@ -28048,7 +28044,7 @@ const Heatmap = props => {
28048
28044
  if (tooltip && tooltipPosition && tooltip.label === `${item.label} - ${Math.round(item.value / totalValue * 100)}%`) {
28049
28045
  const top = `${tooltipPosition.y}px`;
28050
28046
  const left = `${tooltipPosition.x}px`;
28051
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$1, {
28047
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$2, {
28052
28048
  className: "TooltipContainer",
28053
28049
  top: top,
28054
28050
  left: left
@@ -28168,7 +28164,7 @@ const Heatmap = props => {
28168
28164
  className: "HeatmapWrapper"
28169
28165
  }, /*#__PURE__*/React__default["default"].createElement(TitleContainer, {
28170
28166
  className: "TitleContainer"
28171
- }, /*#__PURE__*/React__default["default"].createElement(Title$5, {
28167
+ }, /*#__PURE__*/React__default["default"].createElement(Title$6, {
28172
28168
  className: "Title"
28173
28169
  }, title)), refreshRequired && renderBars(), !refreshRequired && renderBars(), renderLegend()));
28174
28170
  };
@@ -28582,12 +28578,12 @@ const TooltipLabel$1 = styled__default["default"].div`
28582
28578
  font-weight: 400;
28583
28579
  width: fit-content;
28584
28580
  `;
28585
- const TooltipTitle$2 = styled__default["default"].div`
28581
+ const TooltipTitle$3 = styled__default["default"].div`
28586
28582
  color: #212121;
28587
28583
  font-size: 14px;
28588
28584
  font-weight: 600;
28589
28585
  `;
28590
- const Title$4 = styled__default["default"].h5`
28586
+ const Title$5 = styled__default["default"].h5`
28591
28587
  font-weight: 500;
28592
28588
  font-size: 18px;
28593
28589
  line-height: 20px;
@@ -28664,7 +28660,7 @@ const BarChart = props => {
28664
28660
  if (!active || !payload || payload?.length === 0) return null;
28665
28661
  let currentTooltipValue = 0;
28666
28662
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
28667
- return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$1, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$2, null, `${label}`), /*#__PURE__*/React__default["default"].createElement(TooltipLabel$1, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
28663
+ return /*#__PURE__*/React__default["default"].createElement(TooltipDiv$1, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$3, null, `${label}`), /*#__PURE__*/React__default["default"].createElement(TooltipLabel$1, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
28668
28664
  };
28669
28665
  const CustomizedTickBarChart = props => {
28670
28666
  const {
@@ -28747,7 +28743,7 @@ const BarChart = props => {
28747
28743
  height: height,
28748
28744
  width: width,
28749
28745
  ref: controlsContainerRef
28750
- }, /*#__PURE__*/React__default["default"].createElement(Controls$3, null, /*#__PURE__*/React__default["default"].createElement(Title$4, null, title), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
28746
+ }, /*#__PURE__*/React__default["default"].createElement(Controls$3, null, /*#__PURE__*/React__default["default"].createElement(Title$5, null, title), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
28751
28747
  width: "100%",
28752
28748
  height: 400
28753
28749
  }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
@@ -28918,7 +28914,7 @@ const Controls$2 = styled__default["default"].div`
28918
28914
  flex-direction: column;
28919
28915
  background-color: white;
28920
28916
  `;
28921
- const Title$3 = styled__default["default"].h5`
28917
+ const Title$4 = styled__default["default"].h5`
28922
28918
  font-size: 18px;
28923
28919
  font-weight: 400;
28924
28920
  margin: 0 0 30px;
@@ -28951,7 +28947,7 @@ const TooltipLabel = styled__default["default"].div`
28951
28947
  font-weight: 400;
28952
28948
  width: fit-content;
28953
28949
  `;
28954
- const TooltipTitle$1 = styled__default["default"].div`
28950
+ const TooltipTitle$2 = styled__default["default"].div`
28955
28951
  color: #212121;
28956
28952
  font-size: 14px;
28957
28953
  font-weight: 600;
@@ -29105,7 +29101,7 @@ const DoubleBarSingleLine = props => {
29105
29101
  } else {
29106
29102
  `${currentTooltipValue.toFixed(1)}`;
29107
29103
  }
29108
- return /*#__PURE__*/React__default["default"].createElement(TooltipDiv, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$1, null, `${label}`), payload.map((item, idx) => {
29104
+ return /*#__PURE__*/React__default["default"].createElement(TooltipDiv, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$2, null, `${label}`), payload.map((item, idx) => {
29109
29105
  const dataStateItem = dataState.find(state => state.key === item.dataKey);
29110
29106
  return /*#__PURE__*/React__default["default"].createElement(TooltipLabel, {
29111
29107
  key: item.dataKey || idx
@@ -29178,7 +29174,7 @@ const DoubleBarSingleLine = props => {
29178
29174
  noDataText: noDataText
29179
29175
  }) : /*#__PURE__*/React__default["default"].createElement(Controls$2, {
29180
29176
  className: "Controls"
29181
- }, title && title.trim() !== '' && /*#__PURE__*/React__default["default"].createElement(Title$3, null, title), /*#__PURE__*/React__default["default"].createElement(ChartsWrapper, {
29177
+ }, title && title.trim() !== '' && /*#__PURE__*/React__default["default"].createElement(Title$4, null, title), /*#__PURE__*/React__default["default"].createElement(ChartsWrapper, {
29182
29178
  width: hasScroll ? `${data.length * 178}px` : 'auto'
29183
29179
  }, /*#__PURE__*/React__default["default"].createElement(LineChartWrapper, null, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, null, /*#__PURE__*/React__default["default"].createElement(recharts.LineChart, _extends({
29184
29180
  data: transformedData
@@ -29196,7 +29192,7 @@ const DoubleBarSingleLine = props => {
29196
29192
  right: barsWidth
29197
29193
  }
29198
29194
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
29199
- domain: [dataMin => Math.min(dataMin, calculateMinValue(data, dataState)) + 5, dataMax => Math.max(dataMax, calculateMaxValue(data, dataState)) + 5],
29195
+ domain: [dataMin => Math.min(dataMin, calculateMinValue(data, dataState)) - 5, dataMax => Math.max(dataMax, calculateMaxValue(data, dataState)) + 10],
29200
29196
  hide: true
29201
29197
  }), dataState.filter(item => item.type === "line").map(obj => /*#__PURE__*/React__default["default"].createElement(recharts.Line, {
29202
29198
  type: lineType,
@@ -29277,7 +29273,7 @@ const CheckboxGroupContainer = styled__default["default"].div`
29277
29273
  height: 21px;
29278
29274
  gap: 20px;
29279
29275
  `;
29280
- const Title$2 = styled__default["default"].h5`
29276
+ const Title$3 = styled__default["default"].h5`
29281
29277
  font-weight: 500;
29282
29278
  font-size: 18px;
29283
29279
  line-height: 20px;
@@ -29297,7 +29293,7 @@ const LegendIcon = styled__default["default"].div`
29297
29293
  margin-right: 5px;
29298
29294
  background-color: ${props => props.color};
29299
29295
  `;
29300
- const TooltipContainer = styled__default["default"].div`
29296
+ const TooltipContainer$1 = styled__default["default"].div`
29301
29297
  background: white;
29302
29298
  padding: 10px;
29303
29299
  border-radius: 5px;
@@ -29307,12 +29303,12 @@ const TooltipContainer = styled__default["default"].div`
29307
29303
  font-weight: 500;
29308
29304
  font-size: 14px;
29309
29305
  `;
29310
- const TooltipTitle = styled__default["default"].p`
29306
+ const TooltipTitle$1 = styled__default["default"].p`
29311
29307
  font-weight: 700;
29312
29308
  margin-top: 5px;
29313
29309
  margin-bottom: 5px;
29314
29310
  `;
29315
- const TooltipText = styled__default["default"].p`
29311
+ const TooltipText$1 = styled__default["default"].p`
29316
29312
  margin-top: 5px;
29317
29313
  margin-bottom: 5px;
29318
29314
  `;
@@ -29553,10 +29549,10 @@ const AreaChart = props => {
29553
29549
  payload
29554
29550
  } = _ref3;
29555
29551
  if (active && payload && payload.length) {
29556
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${payload[0].payload.label}`), payload.map((data, index) => {
29552
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$1, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$1, null, `${payload[0].payload.label}`), payload.map((data, index) => {
29557
29553
  const chart = areaChartsState.find(chart => chart.key === data.dataKey);
29558
29554
  if (chart) {
29559
- return /*#__PURE__*/React__default["default"].createElement(TooltipText, {
29555
+ return /*#__PURE__*/React__default["default"].createElement(TooltipText$1, {
29560
29556
  key: index
29561
29557
  }, `${chart.name}: ${displayFormattedValue(data.value, chart.isDollar)}`);
29562
29558
  }
@@ -29605,7 +29601,7 @@ const AreaChart = props => {
29605
29601
  height: height
29606
29602
  }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(HeaderContainer$2, {
29607
29603
  "data-testid": "header-container"
29608
- }, /*#__PURE__*/React__default["default"].createElement(Title$2, {
29604
+ }, /*#__PURE__*/React__default["default"].createElement(Title$3, {
29609
29605
  "data-testid": "title"
29610
29606
  }, title), /*#__PURE__*/React__default["default"].createElement(CheckboxGroupContainer, {
29611
29607
  "data-testid": "checkbox-group-container"
@@ -30103,7 +30099,7 @@ const HeaderContainer$1 = styled__default["default"].div`
30103
30099
  align-items: center;
30104
30100
  padding-bottom: 8px;
30105
30101
  `;
30106
- const Title$1 = styled__default["default"].h3`
30102
+ const Title$2 = styled__default["default"].h3`
30107
30103
  font-size: 18px;
30108
30104
  font-weight: 400;
30109
30105
  margin: 0;
@@ -30172,7 +30168,7 @@ const BreakdownPanel = props => {
30172
30168
  height: height
30173
30169
  }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(HeaderContainer$1, {
30174
30170
  "data-testid": "header-container"
30175
- }, /*#__PURE__*/React__default["default"].createElement(Title$1, {
30171
+ }, /*#__PURE__*/React__default["default"].createElement(Title$2, {
30176
30172
  "data-testid": "title"
30177
30173
  }, title)), /*#__PURE__*/React__default["default"].createElement(CategorySalesMainContainer, {
30178
30174
  "data-testid": "category-sales-main-container"
@@ -31414,41 +31410,94 @@ const BatteryChart = props => {
31414
31410
  }))))))), starText !== "" && /*#__PURE__*/React__default["default"].createElement(StarText, null, starText));
31415
31411
  };
31416
31412
 
31417
- // const originalData = [
31418
- // { label: "Vendor Selling Event: Week 34", inc_sales: 20000, inc_roi: 1.2 },
31419
- // { label: "Vendor Selling Event: Week 36", inc_sales: 10000, inc_roi: 1.2 },
31420
- // { label: "Vendor Selling Event: Week 38", inc_sales: 8000, inc_roi: 0.8 },
31421
- // { label: "Vendor Selling Event: Week 33", inc_sales: 12000, inc_roi: 1.1 },
31422
- // { label: "Vendor Selling Event: Week 29", inc_sales: 8000, inc_roi: 1.2 },
31423
- // { label: "Vendor Selling Event: Week 28", inc_sales: 8000, inc_roi: 0.7 },
31424
- // { label: "Vendor Selling Event: Week 35", inc_sales: 8000, inc_roi: 0.8 },
31425
- // { label: "Vendor Selling Event: Week 30", inc_sales: 9000, inc_roi: 1.1 },
31426
- // ];
31413
+ const Container = styled__default["default"].div`
31414
+ width: ${props => props.width};
31415
+ height: ${props => props.height};
31416
+ padding: 15px;
31417
+ display: flex;
31418
+ flex-direction: column;
31419
+ #Segment {
31420
+ width: auto;
31421
+ white-space: nowrap;
31422
+ font-size: 14px;
31423
+ font-weight: 500;
31424
+ font-family: "Poppins"
31425
+ }
31426
+ `;
31427
+ const Title$1 = styled__default["default"].h2`
31428
+ color: #212121;
31429
+ font-family: "Poppins";
31430
+ font-size: 18px;
31431
+ font-style: normal;
31432
+ font-weight: 400;
31433
+ line-height: normal;
31434
+ margin: 0 0 16px 0;
31435
+ `;
31436
+ styled__default["default"].div`
31437
+ font-family: sans-serif;
31438
+ text-align: center;
31439
+ `;
31440
+ styled__default["default"].div`
31441
+ height: 25%;
31442
+ `;
31443
+ styled__default["default"].div`
31444
+ height: 75%;
31445
+ `;
31446
+ styled__default["default"].div`
31447
+ height: 100%;
31448
+ display: flex;
31449
+ flex-direction: column;
31450
+ background-color: white;
31451
+ `;
31452
+ const TooltipContainer = styled__default["default"].div`
31453
+ background: white;
31454
+ padding: 10px;
31455
+ border-radius: 5px;
31456
+ box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
31457
+ border: 1px solid #ddd;
31458
+ font-family: Poppins, sans-serif;
31459
+ font-weight: 500;
31460
+ font-size: 14px;
31461
+ `;
31462
+ const TooltipTitle = styled__default["default"].p`
31463
+ font-weight: 700;
31464
+ margin-top: 5px;
31465
+ margin-bottom: 5px;
31466
+ `;
31467
+ const TooltipText = styled__default["default"].p`
31468
+ margin-top: 5px;
31469
+ margin-bottom: 5px;
31470
+ `;
31427
31471
 
31428
31472
  const SeparatedLineBarChart = ({
31429
- barlineData = []
31473
+ brushAreaBarData = []
31430
31474
  }) => {
31431
- // Sort the data by week number extracted from the label
31432
- const sortedData = barlineData?.sort((a, b) => {
31433
- const weekA = parseInt(a.label.match(/Week (\d+)/)[1], 10);
31434
- const weekB = parseInt(b.label.match(/Week (\d+)/)[1], 10);
31435
- return weekA - weekB;
31475
+ const processedData = brushAreaBarData.map(item => {
31476
+ return {
31477
+ ...item,
31478
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31479
+ };
31436
31480
  });
31437
- const dataWithIndex = sortedData.map((item, index) => ({
31438
- ...item,
31439
- index,
31440
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31441
- }));
31442
- const CustomizedTick = ({
31443
- x,
31444
- y,
31445
- payload,
31446
- viewableIndices
31447
- }) => {
31448
- const label = dataWithIndex[payload.value]?.label ?? "";
31449
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31450
- if (!viewableIndices.includes(payload.value)) {
31451
- return null;
31481
+ const CustomizedTick = props => {
31482
+ const {
31483
+ x,
31484
+ y,
31485
+ payload
31486
+ } = props;
31487
+ const label = payload.value;
31488
+ const words = label.split(" ");
31489
+ const chunks = [];
31490
+ let currentChunk = "";
31491
+ words.forEach(word => {
31492
+ if (currentChunk.length + word.length > 15) {
31493
+ chunks.push(currentChunk.trim());
31494
+ currentChunk = word;
31495
+ } else {
31496
+ currentChunk += (currentChunk ? " " : "") + word;
31497
+ }
31498
+ });
31499
+ if (currentChunk) {
31500
+ chunks.push(currentChunk.trim());
31452
31501
  }
31453
31502
  return /*#__PURE__*/React__default["default"].createElement("g", {
31454
31503
  transform: `translate(${x},${y})`
@@ -31458,89 +31507,68 @@ const SeparatedLineBarChart = ({
31458
31507
  dy: 16,
31459
31508
  textAnchor: "middle",
31460
31509
  fill: "#212121",
31461
- fontSize: 11,
31462
- fontWeight: "400",
31510
+ fontSize: 10,
31463
31511
  fontFamily: "Poppins"
31464
- }, /*#__PURE__*/React__default["default"].createElement("tspan", {
31512
+ }, chunks.map((chunk, i) => /*#__PURE__*/React__default["default"].createElement("tspan", {
31513
+ key: i,
31465
31514
  x: 0,
31466
- dy: 8
31467
- }, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
31468
- x: 0,
31469
- dy: 18
31470
- }, "Event: ", parts.join(" "))));
31515
+ dy: i === 0 ? "0.71em" : "1.2em"
31516
+ }, chunk))));
31471
31517
  };
31472
- const CustomLabelListFilter = props => {
31473
- const {
31474
- viewableIndices,
31475
- dataKey,
31476
- position,
31477
- formatter,
31478
- fill,
31479
- fontSize,
31480
- fontWeight,
31481
- fontFamily
31482
- } = props;
31483
- return /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31484
- dataKey: dataKey,
31485
- position: position,
31486
- formatter: (value, name, props) => {
31487
- if (!viewableIndices.includes(props.index)) {
31488
- return "";
31489
- }
31490
- return formatter ? formatter(value) : value;
31491
- },
31492
- fill: fill || "#212121",
31493
- fontSize: fontSize || 12,
31494
- fontWeight: fontWeight || "400",
31495
- fontFamily: fontFamily || "Poppins"
31496
- });
31518
+ const CustomTooltip = ({
31519
+ active,
31520
+ payload
31521
+ }) => {
31522
+ if (!active || !payload || !payload.length) return null;
31523
+ const data = payload[0]?.payload;
31524
+ if (!data) return null;
31525
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales: ${getFormattedValue(data.inc_sales)}${getFormattedUnits(data.inc_sales)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(data.inc_roi)}${getFormattedUnits(data.inc_roi)}`));
31497
31526
  };
31498
31527
  const chartMargins = {
31499
- top: 15,
31500
- right: 40,
31528
+ top: 30,
31529
+ right: 30,
31501
31530
  left: 20,
31502
- bottom: 40
31531
+ bottom: 0
31503
31532
  };
31504
- const [viewWindow, setViewWindow] = React$1.useState({
31505
- startIndex: 0,
31506
- endIndex: dataWithIndex.length - 1
31507
- });
31508
- const viewableIndices = [];
31509
- for (let i = viewWindow.startIndex; i <= viewWindow.endIndex; i++) {
31510
- viewableIndices.push(i);
31511
- }
31512
- dataWithIndex.filter(item => viewableIndices.includes(item.index));
31533
+ const chartMargins2 = {
31534
+ top: 30,
31535
+ right: 30,
31536
+ left: 20,
31537
+ bottom: 80
31538
+ };
31539
+ const BAR_CATEGORY_GAP = "30%";
31513
31540
  return /*#__PURE__*/React__default["default"].createElement("div", {
31514
31541
  style: {
31515
31542
  width: "100%",
31516
- height: 700
31543
+ height: "100%"
31517
31544
  }
31518
31545
  }, /*#__PURE__*/React__default["default"].createElement("div", {
31519
31546
  style: {
31520
- height: "40%"
31547
+ height: "25%"
31521
31548
  }
31522
31549
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
31523
31550
  width: "100%",
31524
31551
  height: "100%"
31525
31552
  }, /*#__PURE__*/React__default["default"].createElement(recharts.LineChart, {
31526
- data: dataWithIndex,
31527
- margin: chartMargins
31553
+ data: processedData,
31554
+ margin: chartMargins,
31555
+ syncId: "composedChart",
31556
+ syncMethod: "index"
31528
31557
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
31529
31558
  strokeDasharray: "3 3",
31530
31559
  vertical: false
31531
31560
  }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
31532
- dataKey: "index",
31533
- type: "number",
31534
- domain: ['dataMin', 'dataMax'],
31561
+ dataKey: "label",
31562
+ tick: false,
31535
31563
  padding: {
31536
- left: 20,
31537
- right: 20
31564
+ left: 70,
31565
+ right: 70
31538
31566
  },
31539
31567
  hide: true
31540
31568
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
31541
31569
  domain: [0, 2],
31542
31570
  hide: true
31543
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Line, {
31571
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Line, {
31544
31572
  type: "monotone",
31545
31573
  dataKey: "inc_roi",
31546
31574
  stroke: "#F8CD00",
@@ -31550,73 +31578,81 @@ const SeparatedLineBarChart = ({
31550
31578
  fill: "#F8CD00"
31551
31579
  },
31552
31580
  activeDot: false,
31553
- name: "INC Sales ROI"
31554
- }, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
31581
+ name: "INC Sales ROI",
31582
+ barCategoryGap: BAR_CATEGORY_GAP,
31583
+ barGap: 0
31584
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31555
31585
  dataKey: "inc_roi",
31556
31586
  position: "top",
31557
- formatter: value => value.toFixed(1),
31558
- viewableIndices: viewableIndices
31559
- }))))), /*#__PURE__*/React__default["default"].createElement("div", {
31587
+ formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31588
+ fill: "#212121",
31589
+ fontSize: 12,
31590
+ fontWeight: "400",
31591
+ fontFamily: "Poppins"
31592
+ })), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
31593
+ dataKey: "label",
31594
+ height: 30,
31595
+ stroke: "#212121",
31596
+ startIndex: 0,
31597
+ endIndex: Math.min(6, processedData.length - 1),
31598
+ y: 330,
31599
+ travellerWidth: 10,
31600
+ tickFormatter: (value, index) => index + 1,
31601
+ hide: true
31602
+ })))), /*#__PURE__*/React__default["default"].createElement("div", {
31560
31603
  style: {
31561
- height: "60%"
31604
+ height: "70%"
31562
31605
  }
31563
31606
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
31564
31607
  width: "100%",
31565
31608
  height: "100%"
31566
31609
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ComposedChart, {
31567
- data: dataWithIndex,
31568
- margin: chartMargins
31610
+ data: processedData,
31611
+ margin: chartMargins2,
31612
+ syncId: "composedChart",
31613
+ syncMethod: "index",
31614
+ barCategoryGap: BAR_CATEGORY_GAP,
31615
+ barGap: 0
31569
31616
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
31570
31617
  strokeDasharray: "3 3",
31571
31618
  vertical: false
31572
31619
  }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
31573
- dataKey: "index",
31574
- type: "number",
31575
- domain: ['dataMin', 'dataMax'],
31576
- padding: {
31577
- left: 20,
31578
- right: 20
31579
- },
31580
- tick: props => /*#__PURE__*/React__default["default"].createElement(CustomizedTick, _extends({}, props, {
31581
- viewableIndices: viewableIndices
31582
- })),
31620
+ dataKey: "label",
31621
+ tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
31583
31622
  interval: 0,
31584
- height: 60,
31585
- tickLine: false,
31586
- ticks: dataWithIndex.map(item => item.index)
31623
+ height: 80,
31624
+ tickLine: false
31587
31625
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
31588
31626
  tickFormatter: v => `${v / 1000}k`,
31589
31627
  hide: true
31590
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31628
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
31629
+ content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
31630
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31591
31631
  dataKey: "inc_sales",
31592
31632
  fill: "#CCDCDD",
31593
- gap: "4px",
31633
+ gap: 4,
31594
31634
  borderRadius: [4, 4, 0, 8],
31595
31635
  barSize: 40,
31596
31636
  name: "INC Sales"
31597
- }, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
31637
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31598
31638
  dataKey: "inc_sales",
31599
31639
  position: "top",
31600
- formatter: value => `${value / 1000}k`,
31601
- viewableIndices: viewableIndices
31640
+ formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31641
+ fill: "#212121",
31642
+ fontSize: 12,
31643
+ fontWeight: "400",
31644
+ fontFamily: "Poppins"
31602
31645
  })), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
31603
- dataKey: "index",
31646
+ dataKey: "label",
31604
31647
  height: 30,
31605
31648
  stroke: "#212121",
31606
- startIndex: viewWindow.startIndex,
31607
- endIndex: viewWindow.endIndex,
31608
- onChange: e => {
31609
- setViewWindow({
31610
- startIndex: e.startIndex ?? 0,
31611
- endIndex: e.endIndex ?? dataWithIndex.length - 1
31612
- });
31613
- },
31614
- travellerWidth: 12
31615
- })), /*#__PURE__*/React__default["default"].createElement("div", {
31616
- style: {
31617
- marginTop: "-28px"
31618
- }
31619
- }, /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
31649
+ startIndex: 0,
31650
+ endIndex: Math.min(6, processedData.length - 1),
31651
+ travellerWidth: 10,
31652
+ tickFormatter: (value, index) => index + 1
31653
+ })), /*#__PURE__*/React__default["default"].createElement("div", null)), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
31654
+ width: "100%",
31655
+ height: "40px",
31620
31656
  legendData: [{
31621
31657
  iconColor: "#CCDCDD",
31622
31658
  iconType: "Square",
@@ -31626,13 +31662,15 @@ const SeparatedLineBarChart = ({
31626
31662
  iconType: "LegendUnionIcon",
31627
31663
  title: "INC Sales ROI"
31628
31664
  }]
31629
- })))));
31665
+ })));
31630
31666
  };
31631
31667
 
31632
31668
  function SingleChart({
31633
- lineChartData
31669
+ barData,
31670
+ height = 450,
31671
+ width = "100%"
31634
31672
  }) {
31635
- const dataWithIndex = lineChartData?.map((item, index) => ({
31673
+ const dataWithIndex = barData?.map((item, index) => ({
31636
31674
  ...item,
31637
31675
  index,
31638
31676
  shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
@@ -31643,7 +31681,20 @@ function SingleChart({
31643
31681
  payload
31644
31682
  }) => {
31645
31683
  const label = dataWithIndex[payload.value]?.label ?? "";
31646
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31684
+ const words = label.split(' ');
31685
+ const chunks = [];
31686
+ let currentChunk = '';
31687
+ words.forEach(word => {
31688
+ if (currentChunk.length + word.length > 15) {
31689
+ chunks.push(currentChunk.trim());
31690
+ currentChunk = word;
31691
+ } else {
31692
+ currentChunk += (currentChunk ? ' ' : '') + word;
31693
+ }
31694
+ });
31695
+ if (currentChunk) {
31696
+ chunks.push(currentChunk.trim());
31697
+ }
31647
31698
  return /*#__PURE__*/React__default["default"].createElement("g", {
31648
31699
  transform: `translate(${x},${y})`
31649
31700
  }, /*#__PURE__*/React__default["default"].createElement("text", {
@@ -31652,31 +31703,31 @@ function SingleChart({
31652
31703
  dy: 16,
31653
31704
  textAnchor: "middle",
31654
31705
  fill: "#212121",
31655
- fontSize: 11,
31656
- fontWeight: "400",
31706
+ fontSize: 10,
31657
31707
  fontFamily: "Poppins"
31658
- }, /*#__PURE__*/React__default["default"].createElement("tspan", {
31659
- x: 0,
31660
- dy: 8
31661
- }, "Vendor Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
31708
+ }, chunks.map((chunk, i) => /*#__PURE__*/React__default["default"].createElement("tspan", {
31709
+ key: i,
31662
31710
  x: 0,
31663
- dy: 18
31664
- }, "Event: ", parts.join(" "))));
31711
+ dy: i === 0 ? "0.71em" : "1.2em"
31712
+ }, chunk))));
31713
+ };
31714
+ const CustomTooltip = ({
31715
+ active,
31716
+ payload
31717
+ }) => {
31718
+ if (!active || !payload || !payload.length) return null;
31719
+ const data = payload[0]?.payload;
31720
+ if (!data) return null;
31721
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.typeTitle}: ${getFormattedValue(data.value)}${getFormattedUnits(data.value)}`));
31665
31722
  };
31666
- const [startIndex, setStartIndex] = React$1.useState(0);
31667
- const [endIndex, setEndIndex] = React$1.useState(dataWithIndex?.length - 1);
31668
31723
  return /*#__PURE__*/React__default["default"].createElement("div", {
31669
31724
  style: {
31670
31725
  width: "100%",
31671
- height: 600
31672
- }
31673
- }, /*#__PURE__*/React__default["default"].createElement("div", {
31674
- style: {
31675
31726
  height: "100%"
31676
31727
  }
31677
31728
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
31678
31729
  width: "100%",
31679
- height: "100%"
31730
+ height: "95%"
31680
31731
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ComposedChart, {
31681
31732
  data: dataWithIndex,
31682
31733
  margin: {
@@ -31692,7 +31743,7 @@ function SingleChart({
31692
31743
  dataKey: "index",
31693
31744
  tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
31694
31745
  interval: 0,
31695
- height: 60,
31746
+ height: 80,
31696
31747
  padding: {
31697
31748
  left: 20,
31698
31749
  right: 20
@@ -31701,7 +31752,9 @@ function SingleChart({
31701
31752
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
31702
31753
  tickFormatter: v => `$${v / 1000}k`,
31703
31754
  hide: true
31704
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31755
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
31756
+ content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
31757
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31705
31758
  dataKey: "value",
31706
31759
  fill: "#CCDCDD",
31707
31760
  gap: "4px",
@@ -31711,29 +31764,25 @@ function SingleChart({
31711
31764
  }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31712
31765
  dataKey: "value",
31713
31766
  position: "top",
31714
- formatter: value => `$${value / 1000}k`,
31767
+ formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31715
31768
  fill: "#212121",
31716
31769
  fontSize: 12,
31717
31770
  fontWeight: "400",
31718
31771
  fontFamily: "Poppins"
31719
31772
  })), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
31720
- dataKey: "index",
31721
31773
  height: 30,
31722
- stroke: "#212121",
31723
- startIndex: startIndex,
31724
- endIndex: endIndex,
31725
- onChange: e => {
31726
- setStartIndex(e.startIndex ?? 0);
31727
- setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
31728
- },
31729
- travellerWidth: 12
31730
- })), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
31774
+ travellerWidth: 10,
31775
+ startIndex: 0,
31776
+ endIndex: Math.min(6, barData.length - 1)
31777
+ }))), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
31778
+ width: "100%",
31779
+ height: "40px",
31731
31780
  legendData: [{
31732
31781
  iconColor: "#CCDCDD",
31733
31782
  iconType: "Square",
31734
31783
  title: "INC Units"
31735
31784
  }]
31736
- }))));
31785
+ }));
31737
31786
  }
31738
31787
 
31739
31788
  styled__default["default"].div`
@@ -31964,16 +32013,8 @@ SegmentedButton.defaultProps = {
31964
32013
  };
31965
32014
 
31966
32015
  function InnerBarChart({
31967
- data = []
32016
+ brushInnerBarData
31968
32017
  }) {
31969
- const processedData = data.map(item => {
31970
- const parts = item.label.replace("Vendor Selling Event:", "").trim();
31971
- return {
31972
- ...item,
31973
- shortLabel: parts
31974
- };
31975
- });
31976
- const format = v => v >= 1000 ? `${v / 1000}K` : v;
31977
32018
  const BarWithInner = props => {
31978
32019
  const {
31979
32020
  x,
@@ -32002,7 +32043,7 @@ function InnerBarChart({
32002
32043
  fontWeight: 400,
32003
32044
  fontFamily: "Poppins",
32004
32045
  fill: "#212121"
32005
- }, format(payload.total)), /*#__PURE__*/React__default["default"].createElement("rect", {
32046
+ }, `${getFormattedValue(payload.total)}${getFormattedUnits(payload.total)}`), /*#__PURE__*/React__default["default"].createElement("rect", {
32006
32047
  x: x + width * 0.2,
32007
32048
  y: innerY,
32008
32049
  width: width * 0.6,
@@ -32018,7 +32059,7 @@ function InnerBarChart({
32018
32059
  fontWeight: 400,
32019
32060
  fontFamily: "Poppins",
32020
32061
  fill: "#212121"
32021
- }, format(payload.actual)));
32062
+ }, `${getFormattedValue(payload.actual)}${getFormattedUnits(payload.actual)}`));
32022
32063
  };
32023
32064
  const CustomTooltip = ({
32024
32065
  active,
@@ -32027,9 +32068,8 @@ function InnerBarChart({
32027
32068
  }) => {
32028
32069
  if (!active || !payload || !payload.length) return null;
32029
32070
  const data = payload[0].payload;
32030
- return /*#__PURE__*/React__default["default"].createElement("div", {
32031
- className: "bg-white border border-gray-300 p-2 rounded-lg text-sm"
32032
- }, /*#__PURE__*/React__default["default"].createElement("strong", null, data.label), /*#__PURE__*/React__default["default"].createElement("div", null, "Actual: ", format(data.actual)), /*#__PURE__*/React__default["default"].createElement("div", null, "Total: ", format(data.total)));
32071
+ const repeaterPercentage = (data.actual / data.total * 100).toFixed(1);
32072
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `New Shoppers: ${getFormattedValue(data.total)}${getFormattedUnits(data.total)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `Repeaters: ${getFormattedValue(data.actual)}${getFormattedUnits(data.actual)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `% Repeaters: ${repeaterPercentage}%`));
32033
32073
  };
32034
32074
  const CustomizedTick = props => {
32035
32075
  const {
@@ -32037,7 +32077,23 @@ function InnerBarChart({
32037
32077
  y,
32038
32078
  payload
32039
32079
  } = props;
32040
- const labelText = payload.value.replace("Vendor Selling Event:", "").trim();
32080
+ const label = payload.value;
32081
+
32082
+ // Split the label into chunks of words
32083
+ const words = label.split(" ");
32084
+ const chunks = [];
32085
+ let currentChunk = "";
32086
+ words.forEach(word => {
32087
+ if (currentChunk.length + word.length > 15) {
32088
+ chunks.push(currentChunk.trim());
32089
+ currentChunk = word;
32090
+ } else {
32091
+ currentChunk += " " + word;
32092
+ }
32093
+ });
32094
+ if (currentChunk) {
32095
+ chunks.push(currentChunk.trim());
32096
+ }
32041
32097
  return /*#__PURE__*/React__default["default"].createElement("g", {
32042
32098
  transform: `translate(${x},${y})`
32043
32099
  }, /*#__PURE__*/React__default["default"].createElement("text", {
@@ -32048,104 +32104,82 @@ function InnerBarChart({
32048
32104
  fill: "#212121",
32049
32105
  fontSize: 10,
32050
32106
  fontFamily: "Poppins"
32051
- }, /*#__PURE__*/React__default["default"].createElement("tspan", {
32052
- x: 0,
32053
- dy: "0.71em"
32054
- }, "Vendor"), /*#__PURE__*/React__default["default"].createElement("tspan", {
32107
+ }, chunks.map((chunk, i) => /*#__PURE__*/React__default["default"].createElement("tspan", {
32108
+ key: i,
32055
32109
  x: 0,
32056
- dy: "1.2em"
32057
- }, "Selling"), /*#__PURE__*/React__default["default"].createElement("tspan", {
32058
- x: 0,
32059
- dy: "1.2em"
32060
- }, labelText)));
32110
+ dy: i === 0 ? "0.71em" : "1.2em"
32111
+ }, chunk))));
32061
32112
  };
32062
32113
  return /*#__PURE__*/React__default["default"].createElement("div", {
32063
- className: "w-full"
32064
- }, /*#__PURE__*/React__default["default"].createElement("h3", {
32065
- className: "text-lg font-medium mb-4 text-center"
32066
- }, "Vendor Selling Events Comparison"), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
32114
+ style: {
32115
+ width: "100%",
32116
+ height: "100%"
32117
+ }
32118
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
32067
32119
  width: "100%",
32068
- height: 450
32120
+ height: "95%"
32069
32121
  }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
32070
- data: processedData,
32122
+ data: brushInnerBarData,
32071
32123
  margin: {
32072
32124
  top: 30,
32073
32125
  right: 30,
32074
32126
  left: 20,
32075
- bottom: 60
32127
+ bottom: 80
32076
32128
  }
32077
32129
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
32078
32130
  strokeDasharray: "3 3",
32079
32131
  vertical: false
32080
32132
  }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
32081
- dataKey: "shortLabel",
32133
+ dataKey: "label",
32082
32134
  tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
32083
- height: 70,
32135
+ height: 80,
32084
32136
  interval: 0
32085
32137
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
32086
32138
  type: "number",
32087
32139
  domain: [0, "dataMax + 2000"],
32088
- tickFormatter: format
32140
+ hide: true
32089
32141
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
32090
32142
  content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
32091
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
32092
- height: 30,
32093
- travellerWidth: 10,
32094
- startIndex: 0,
32095
- endIndex: 5,
32096
- y: 380
32097
32143
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
32098
32144
  dataKey: "total",
32099
32145
  shape: /*#__PURE__*/React__default["default"].createElement(BarWithInner, null),
32100
32146
  barSize: 36
32101
- }))));
32147
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
32148
+ height: 30,
32149
+ travellerWidth: 10,
32150
+ startIndex: 0,
32151
+ endIndex: Math.min(6, brushInnerBarData.length - 1)
32152
+ }))), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
32153
+ width: "100%",
32154
+ height: "40px",
32155
+ legendData: [{
32156
+ iconColor: "#CCDCDD",
32157
+ iconType: "Square",
32158
+ title: "New Shoppers"
32159
+ }, {
32160
+ iconColor: "#07575b",
32161
+ iconType: "Square",
32162
+ title: "Repeaters"
32163
+ }]
32164
+ }));
32102
32165
  }
32103
32166
 
32104
- const Container = styled__default["default"].div`
32105
- width: ${props => props.width};
32106
- height: ${props => props.height};
32107
- padding: 15px;
32108
- display: flex;
32109
- flex-direction: column;
32110
- #Segment {
32111
- width: auto;
32112
- white-space: nowrap;
32113
- font-size: 14px;
32114
- font-weight: 500;
32115
- font-family: "Poppins"
32116
- }
32117
- `;
32118
- styled__default["default"].div`
32119
- font-family: sans-serif;
32120
- text-align: center;
32121
- `;
32122
- styled__default["default"].div`
32123
- height: 25%;
32124
- `;
32125
- styled__default["default"].div`
32126
- height: 75%;
32127
- `;
32128
- styled__default["default"].div`
32129
- height: 100%;
32130
- display: flex;
32131
- flex-direction: column;
32132
- background-color: white;
32133
- `;
32134
-
32135
32167
  const BrushChart = props => {
32136
32168
  const {
32137
32169
  width,
32138
32170
  height,
32139
- data,
32140
- barlineData,
32141
- lineChartData
32171
+ brushInnerBarData,
32172
+ brushBarIncData,
32173
+ brushBarBasketData,
32174
+ brushAreaBarData,
32175
+ title
32142
32176
  } = props;
32143
32177
  const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
32144
32178
  const [selectedOption, setSelectedOption] = React$1.useState(segmentedbuttonOptions[0]);
32145
32179
  return /*#__PURE__*/React__default["default"].createElement(Container, {
32146
32180
  height: height,
32147
32181
  width: width
32148
- }, /*#__PURE__*/React__default["default"].createElement(SegmentedButton, {
32182
+ }, /*#__PURE__*/React__default["default"].createElement(Title$1, null, title), /*#__PURE__*/React__default["default"].createElement(SegmentedButton, {
32149
32183
  gap: "8px",
32150
32184
  options: segmentedbuttonOptions.map(value => ({
32151
32185
  value
@@ -32157,13 +32191,13 @@ const BrushChart = props => {
32157
32191
  return setSelectedOption(value);
32158
32192
  }
32159
32193
  }), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React__default["default"].createElement(InnerBarChart, {
32160
- data: data
32194
+ brushInnerBarData: brushInnerBarData
32161
32195
  }), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React__default["default"].createElement(SeparatedLineBarChart, {
32162
- barlineData: barlineData
32196
+ brushAreaBarData: brushAreaBarData
32163
32197
  }), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32164
- lineChartData: lineChartData
32198
+ barData: brushBarIncData
32165
32199
  }), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32166
- lineChartData: lineChartData
32200
+ barData: brushBarBasketData
32167
32201
  }));
32168
32202
  };
32169
32203
 
@@ -32262,7 +32296,10 @@ const VisibleCardsContainer = styled__default["default"].div`
32262
32296
 
32263
32297
  .prev-card,
32264
32298
  .next-card {
32265
- opacity: 0.3;
32299
+ background: #d3d3d3;
32300
+ > * {
32301
+ opacity: 0.5;
32302
+ }
32266
32303
  }
32267
32304
 
32268
32305
  .prev-card {