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.esm.js CHANGED
@@ -1933,7 +1933,7 @@ const TitleAndValueContainer$4 = styled.div`
1933
1933
  flex-direction: column;
1934
1934
  padding: 0 20px;
1935
1935
  `;
1936
- const Title$e = styled.h4`
1936
+ const Title$f = styled.h4`
1937
1937
  font-weight: 400;
1938
1938
  font-size: 18px;
1939
1939
  margin: 0 0 8px;
@@ -2068,7 +2068,7 @@ const AvarageDelimiter = styled.div`
2068
2068
  `;
2069
2069
 
2070
2070
  /* Custom properties */
2071
- const TooltipContainer$3 = styled.div`
2071
+ const TooltipContainer$4 = styled.div`
2072
2072
  --tooltip-text-color: black;
2073
2073
  --tooltip-background-color: white;
2074
2074
  --tooltip-margin: 40px;
@@ -2094,7 +2094,7 @@ const TooltipTip$1 = styled.div`
2094
2094
  font-size: 12px;
2095
2095
  font-family: sans-serif;
2096
2096
  line-height: 1;
2097
- z-index: 100;
2097
+ z-index: 99999;
2098
2098
  white-space: nowrap;
2099
2099
 
2100
2100
  /* CSS border triangles */
@@ -2110,7 +2110,6 @@ const TooltipTip$1 = styled.div`
2110
2110
  margin-left: calc(var(--tooltip-arrow-size) * -1);
2111
2111
  }
2112
2112
 
2113
- /* Absolute positioning */
2114
2113
  &.controls.top {
2115
2114
  top: calc(var(--tooltip-margin) * ${props => props.topFactor || -1.8} );
2116
2115
  }
@@ -2121,7 +2120,6 @@ const TooltipTip$1 = styled.div`
2121
2120
  border-top-color: var(--tooltip-background-color);
2122
2121
  }
2123
2122
 
2124
- /* Absolute positioning */
2125
2123
  &.controls.right {
2126
2124
  left: calc(70% + var(--tooltip-margin));
2127
2125
  top: 50%;
@@ -2136,7 +2134,6 @@ const TooltipTip$1 = styled.div`
2136
2134
  border-right-color: var(--tooltip-background-color);
2137
2135
  }
2138
2136
 
2139
- /* Absolute positioning */
2140
2137
  &.controls.bottom {
2141
2138
  bottom: calc(var(--tooltip-margin) * -1);
2142
2139
  }
@@ -2146,7 +2143,6 @@ const TooltipTip$1 = styled.div`
2146
2143
  border-bottom-color: var(--tooltip-background-color);
2147
2144
  }
2148
2145
 
2149
- /* Absolute positioning */
2150
2146
  &.controls.left {
2151
2147
  left: auto;
2152
2148
  right: calc(70% + var(--tooltip-margin));
@@ -2182,7 +2178,7 @@ const Tooltip$1 = props => {
2182
2178
  clearInterval(timeout);
2183
2179
  setActive(false);
2184
2180
  };
2185
- return /*#__PURE__*/React$1.createElement(TooltipContainer$3, null, /*#__PURE__*/React$1.createElement(TooltipWrapper$2, {
2181
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$4, null, /*#__PURE__*/React$1.createElement(TooltipWrapper$2, {
2186
2182
  onMouseEnter: showTip,
2187
2183
  onMouseLeave: hideTip
2188
2184
  }, children, active && /*#__PURE__*/React$1.createElement(TooltipTip$1, {
@@ -2413,7 +2409,7 @@ const PieChart = props => {
2413
2409
  width: width
2414
2410
  }, !hideTitleAndValue && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$4, {
2415
2411
  className: "TitleAndValueContainer"
2416
- }, /*#__PURE__*/React$1.createElement(Title$e, {
2412
+ }, /*#__PURE__*/React$1.createElement(Title$f, {
2417
2413
  className: "Title"
2418
2414
  }, title), /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer$2, {
2419
2415
  className: "CurrencySignAndFormattedValueContainer"
@@ -11139,7 +11135,7 @@ const TooltipTextContainer = styled.div`
11139
11135
  cursor: pointer;
11140
11136
  }
11141
11137
  `;
11142
- const TooltipText$1 = styled.div`
11138
+ const TooltipText$2 = styled.div`
11143
11139
  margin: 0;
11144
11140
  `;
11145
11141
 
@@ -11309,8 +11305,8 @@ const FilterPanel = props => {
11309
11305
  fieldsData: newFieldsDataState
11310
11306
  });
11311
11307
  };
11312
- const getTooltipTextDates = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$1, null, "Dates can be selected"), /*#__PURE__*/React$1.createElement(TooltipText$1, null, "only after selecting"), /*#__PURE__*/React$1.createElement(TooltipText$1, null, "period types"));
11313
- const getTooltipTextGoButton = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$1, null, tooltipTextGoButton));
11308
+ const getTooltipTextDates = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$2, null, "Dates can be selected"), /*#__PURE__*/React$1.createElement(TooltipText$2, null, "only after selecting"), /*#__PURE__*/React$1.createElement(TooltipText$2, null, "period types"));
11309
+ const getTooltipTextGoButton = () => /*#__PURE__*/React$1.createElement(TooltipTextContainer, null, /*#__PURE__*/React$1.createElement(TooltipText$2, null, tooltipTextGoButton));
11314
11310
  const getYearsArray = () => {
11315
11311
  const currentYear = moment().year();
11316
11312
  const previousYear = moment().subtract(1, 'years').year();
@@ -25387,7 +25383,7 @@ const TitleAndValueContainer$3 = styled.div`
25387
25383
  display: flex;
25388
25384
  flex-direction: column;
25389
25385
  `;
25390
- const Title$d = styled.h4`
25386
+ const Title$e = styled.h4`
25391
25387
  font-weight: 400;
25392
25388
  font-size: 20px;
25393
25389
  margin: 0;
@@ -25450,7 +25446,7 @@ const FormattedValue$3 = props => {
25450
25446
  width: width
25451
25447
  }, /*#__PURE__*/React$1.createElement(TitleAndValueContainer$3, {
25452
25448
  className: "TitleAndValueContainer"
25453
- }, title ? /*#__PURE__*/React$1.createElement(Title$d, {
25449
+ }, title ? /*#__PURE__*/React$1.createElement(Title$e, {
25454
25450
  className: "Title",
25455
25451
  width: width
25456
25452
  }, title) : '', showTopValue && /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer$1, {
@@ -25462,7 +25458,7 @@ const FormattedValue$3 = props => {
25462
25458
  className: "CurrencySignOrPercent"
25463
25459
  }, 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$1.createElement(CurrencySignOrPercent, {
25464
25460
  className: "CurrencySignOrPercent"
25465
- }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React$1.createElement(Title$d, {
25461
+ }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React$1.createElement(Title$e, {
25466
25462
  className: "Title",
25467
25463
  width: width
25468
25464
  }, subtitle) : '')));
@@ -25524,7 +25520,7 @@ const TooltipLabel$3 = styled.div`
25524
25520
  font-weight: 400;
25525
25521
  width: fit-content;
25526
25522
  `;
25527
- const TooltipTitle$3 = styled.div`
25523
+ const TooltipTitle$4 = styled.div`
25528
25524
  color: #212121;
25529
25525
  font-size: 14px;
25530
25526
  font-weight: 600;
@@ -25532,7 +25528,7 @@ const TooltipTitle$3 = styled.div`
25532
25528
  const TitleAndValueContainer$2 = styled.div`
25533
25529
  padding: 0 1rem;
25534
25530
  `;
25535
- const Title$c = styled.h5`
25531
+ const Title$d = styled.h5`
25536
25532
  font-weight: 500;
25537
25533
  font-size: 18px;
25538
25534
  line-height: 20px;
@@ -25661,7 +25657,7 @@ const TitleAndIconContainer = styled.div`
25661
25657
  display: flex;
25662
25658
  align-items: center;
25663
25659
  `;
25664
- const Title$b = styled.h4`
25660
+ const Title$c = styled.h4`
25665
25661
  font-weight: 400;
25666
25662
  font-size: 14px;
25667
25663
  line-height: 27px;
@@ -25715,7 +25711,7 @@ const PerformanceAnalyticsLegend = props => {
25715
25711
  color: item.iconColor
25716
25712
  }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React$1.createElement(LegendLineIcon, {
25717
25713
  color: item.iconColor
25718
- }) : '', /*#__PURE__*/React$1.createElement(Title$b, {
25714
+ }) : '', /*#__PURE__*/React$1.createElement(Title$c, {
25719
25715
  id: "Title",
25720
25716
  width: width
25721
25717
  }, item.title))))) : '');
@@ -25813,7 +25809,7 @@ const BarChartsByWeeks = props => {
25813
25809
  let currentTooltipSecondValue = 0;
25814
25810
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
25815
25811
  if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
25816
- return /*#__PURE__*/React$1.createElement(TooltipDiv$3, null, /*#__PURE__*/React$1.createElement(TooltipTitle$3, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipTitle}
25812
+ return /*#__PURE__*/React$1.createElement(TooltipDiv$3, null, /*#__PURE__*/React$1.createElement(TooltipTitle$4, null, `${isTitleOriganal ? '' : 'Week: '}${week}`), /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipTitle}
25817
25813
  ${displayFormattedValue(currentTooltipValue)}
25818
25814
  `), currentTooltipSecondValue ? /*#__PURE__*/React$1.createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
25819
25815
  ${displayFormattedValue(currentTooltipSecondValue)}
@@ -25870,7 +25866,7 @@ const BarChartsByWeeks = props => {
25870
25866
  ref: controlsContainerRef
25871
25867
  }, /*#__PURE__*/React$1.createElement(Controls$6, {
25872
25868
  height: getControlsHeight()
25873
- }, showTitle && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React$1.createElement(Title$c, null, title), /*#__PURE__*/React$1.createElement(FormattedValue$3, {
25869
+ }, showTitle && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React$1.createElement(Title$d, null, title), /*#__PURE__*/React$1.createElement(FormattedValue$3, {
25874
25870
  title: headerValueTopTitle,
25875
25871
  subtitle: headerValueBottomTitle,
25876
25872
  showTopValue: showHeaderTopValue,
@@ -26103,7 +26099,7 @@ const TitleAndValueContainer$1 = styled.div`
26103
26099
  flex-direction: column;
26104
26100
  padding: 0 1.25em; /* 20px → 1.25em */
26105
26101
  `;
26106
- const Title$a = styled.h4`
26102
+ const Title$b = styled.h4`
26107
26103
  font-weight: 500;
26108
26104
  font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26109
26105
  margin: 0;
@@ -26306,7 +26302,7 @@ const TotalDoughnutChart = props => {
26306
26302
  width: width
26307
26303
  }, !hideTitleAndValue && /*#__PURE__*/React$1.createElement(TitleAndValueContainer$1, {
26308
26304
  className: "TitleAndValueContainer"
26309
- }, /*#__PURE__*/React$1.createElement(Title$a, {
26305
+ }, /*#__PURE__*/React$1.createElement(Title$b, {
26310
26306
  className: "Title",
26311
26307
  fontSize: titleFontSize
26312
26308
  }, title), /*#__PURE__*/React$1.createElement(CurrencySignAndFormattedValueContainer, {
@@ -26436,7 +26432,7 @@ CustomTooltip.defaultProps = {
26436
26432
  isPercent: false
26437
26433
  };
26438
26434
 
26439
- const TooltipContainer$2 = styled.div`
26435
+ const TooltipContainer$3 = styled.div`
26440
26436
  --tooltip-text-color: black;
26441
26437
  --tooltip-background-color: white;
26442
26438
  --tooltip-margin: 40px;
@@ -26542,7 +26538,7 @@ const Tooltip = props => {
26542
26538
  direction,
26543
26539
  content
26544
26540
  } = props;
26545
- return /*#__PURE__*/React$1.createElement(TooltipContainer$2, {
26541
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$3, {
26546
26542
  className: className,
26547
26543
  top: `${top}px`,
26548
26544
  left: `${left}px`
@@ -26628,7 +26624,7 @@ const TotalValue = styled.div`
26628
26624
  font-size: 20px;
26629
26625
  }
26630
26626
  `;
26631
- const Title$9 = styled.h4`
26627
+ const Title$a = styled.h4`
26632
26628
  font-size: 18px;
26633
26629
  font-weight: 400;
26634
26630
  line-height: 1;
@@ -26785,7 +26781,7 @@ const TotalHorizontalCharts = props => {
26785
26781
  }, chartsData?.length > 0 ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React$1.createElement(CardHeader, {
26786
26782
  ref: topHeader,
26787
26783
  className: "CardHeader"
26788
- }, !hideTitle ? /*#__PURE__*/React$1.createElement(Title$9, null, title) : '', !hideTotalValue ? /*#__PURE__*/React$1.createElement(TotalValue, {
26784
+ }, !hideTitle ? /*#__PURE__*/React$1.createElement(Title$a, null, title) : '', !hideTotalValue ? /*#__PURE__*/React$1.createElement(TotalValue, {
26789
26785
  className: "TotalValue"
26790
26786
  }, currencySign && /*#__PURE__*/React$1.createElement(CurrencySign, {
26791
26787
  className: "CurrencySign"
@@ -27258,7 +27254,7 @@ const ItemContainer = styled.div`
27258
27254
  flex-direction: column;
27259
27255
  flex-wrap: wrap;
27260
27256
  `;
27261
- const Title$8 = styled.h4`
27257
+ const Title$9 = styled.h4`
27262
27258
  font-size: 18px;
27263
27259
  font-weight: 500;
27264
27260
  margin: 0;
@@ -27374,7 +27370,7 @@ const SalesAndROI = props => {
27374
27370
  showBorderShadow: showBorderShadow
27375
27371
  }, /*#__PURE__*/React$1.createElement(TitleAndValueContainer, {
27376
27372
  id: "TitleAndValueContainer"
27377
- }, /*#__PURE__*/React$1.createElement(Title$8, {
27373
+ }, /*#__PURE__*/React$1.createElement(Title$9, {
27378
27374
  id: "Title"
27379
27375
  }, title), showBanner && /*#__PURE__*/React$1.createElement(OutBanner, {
27380
27376
  id: "OutBanner",
@@ -27473,7 +27469,7 @@ const TitleContainer$1 = styled.div`
27473
27469
  margin: 0;
27474
27470
  border-bottom: 1px solid #b1b1b1;
27475
27471
  `;
27476
- const Title$7 = styled.p`
27472
+ const Title$8 = styled.p`
27477
27473
  font-weight: 400;
27478
27474
  font-size: 24px;
27479
27475
  margin: 0;
@@ -27693,7 +27689,7 @@ const PopupCharts = props => {
27693
27689
  height: height,
27694
27690
  width: width,
27695
27691
  onClick: e => e.stopPropagation()
27696
- }, /*#__PURE__*/React$1.createElement(TitleContainer$1, null, /*#__PURE__*/React$1.createElement(Title$7, null, title), /*#__PURE__*/React$1.createElement(CloseXIconContainer, {
27692
+ }, /*#__PURE__*/React$1.createElement(TitleContainer$1, null, /*#__PURE__*/React$1.createElement(Title$8, null, title), /*#__PURE__*/React$1.createElement(CloseXIconContainer, {
27697
27693
  onClick: e => closePopupCharts(e)
27698
27694
  }, /*#__PURE__*/React$1.createElement(CloseXIcon, null))), /*#__PURE__*/React$1.createElement(ChartsContainer, {
27699
27695
  id: "ChartsContainer",
@@ -27791,7 +27787,7 @@ const TopToggleListMainContainer = styled.div`
27791
27787
  padding: 0 24px;
27792
27788
  width: ${props => props.width};
27793
27789
  `;
27794
- const Title$6 = styled.h4`
27790
+ const Title$7 = styled.h4`
27795
27791
  font-size: 14px;
27796
27792
  font-weight: 600;
27797
27793
  margin: 20px 0 12px;
@@ -27821,7 +27817,7 @@ const TopToggleList = props => {
27821
27817
  } = props;
27822
27818
  return /*#__PURE__*/React$1.createElement(TopToggleListMainContainer, {
27823
27819
  width: width
27824
- }, /*#__PURE__*/React$1.createElement(Title$6, null, title), /*#__PURE__*/React$1.createElement(ListContainer, {
27820
+ }, /*#__PURE__*/React$1.createElement(Title$7, null, title), /*#__PURE__*/React$1.createElement(ListContainer, {
27825
27821
  height: height
27826
27822
  }, list.map(item => /*#__PURE__*/React$1.createElement(ListItem, {
27827
27823
  key: item.value
@@ -27883,7 +27879,7 @@ const TitleContainer = styled.div`
27883
27879
  justify-content: flex-start;
27884
27880
  margin: 0 0 10px 0;
27885
27881
  `;
27886
- const Title$5 = styled.h3`
27882
+ const Title$6 = styled.h3`
27887
27883
  user-select: none;
27888
27884
  text-align: left;
27889
27885
  margin: 0;
@@ -27928,7 +27924,7 @@ const BarLabel = styled.span`
27928
27924
  font-weight: 400;
27929
27925
  user-select: none;
27930
27926
  `;
27931
- const TooltipContainer$1 = styled.div`
27927
+ const TooltipContainer$2 = styled.div`
27932
27928
  position: absolute;
27933
27929
 
27934
27930
  top: ${props => props.top};
@@ -28038,7 +28034,7 @@ const Heatmap = props => {
28038
28034
  if (tooltip && tooltipPosition && tooltip.label === `${item.label} - ${Math.round(item.value / totalValue * 100)}%`) {
28039
28035
  const top = `${tooltipPosition.y}px`;
28040
28036
  const left = `${tooltipPosition.x}px`;
28041
- return /*#__PURE__*/React$1.createElement(TooltipContainer$1, {
28037
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$2, {
28042
28038
  className: "TooltipContainer",
28043
28039
  top: top,
28044
28040
  left: left
@@ -28158,7 +28154,7 @@ const Heatmap = props => {
28158
28154
  className: "HeatmapWrapper"
28159
28155
  }, /*#__PURE__*/React$1.createElement(TitleContainer, {
28160
28156
  className: "TitleContainer"
28161
- }, /*#__PURE__*/React$1.createElement(Title$5, {
28157
+ }, /*#__PURE__*/React$1.createElement(Title$6, {
28162
28158
  className: "Title"
28163
28159
  }, title)), refreshRequired && renderBars(), !refreshRequired && renderBars(), renderLegend()));
28164
28160
  };
@@ -28572,12 +28568,12 @@ const TooltipLabel$1 = styled.div`
28572
28568
  font-weight: 400;
28573
28569
  width: fit-content;
28574
28570
  `;
28575
- const TooltipTitle$2 = styled.div`
28571
+ const TooltipTitle$3 = styled.div`
28576
28572
  color: #212121;
28577
28573
  font-size: 14px;
28578
28574
  font-weight: 600;
28579
28575
  `;
28580
- const Title$4 = styled.h5`
28576
+ const Title$5 = styled.h5`
28581
28577
  font-weight: 500;
28582
28578
  font-size: 18px;
28583
28579
  line-height: 20px;
@@ -28654,7 +28650,7 @@ const BarChart = props => {
28654
28650
  if (!active || !payload || payload?.length === 0) return null;
28655
28651
  let currentTooltipValue = 0;
28656
28652
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
28657
- return /*#__PURE__*/React$1.createElement(TooltipDiv$1, null, /*#__PURE__*/React$1.createElement(TooltipTitle$2, null, `${label}`), /*#__PURE__*/React$1.createElement(TooltipLabel$1, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
28653
+ return /*#__PURE__*/React$1.createElement(TooltipDiv$1, null, /*#__PURE__*/React$1.createElement(TooltipTitle$3, null, `${label}`), /*#__PURE__*/React$1.createElement(TooltipLabel$1, null, `${displayFormattedValue(currentTooltipValue, !!showCurrentCampaignStyle)}`));
28658
28654
  };
28659
28655
  const CustomizedTickBarChart = props => {
28660
28656
  const {
@@ -28737,7 +28733,7 @@ const BarChart = props => {
28737
28733
  height: height,
28738
28734
  width: width,
28739
28735
  ref: controlsContainerRef
28740
- }, /*#__PURE__*/React$1.createElement(Controls$3, null, /*#__PURE__*/React$1.createElement(Title$4, null, title), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
28736
+ }, /*#__PURE__*/React$1.createElement(Controls$3, null, /*#__PURE__*/React$1.createElement(Title$5, null, title), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
28741
28737
  width: "100%",
28742
28738
  height: 400
28743
28739
  }, /*#__PURE__*/React$1.createElement(BarChart$1, {
@@ -28908,7 +28904,7 @@ const Controls$2 = styled.div`
28908
28904
  flex-direction: column;
28909
28905
  background-color: white;
28910
28906
  `;
28911
- const Title$3 = styled.h5`
28907
+ const Title$4 = styled.h5`
28912
28908
  font-size: 18px;
28913
28909
  font-weight: 400;
28914
28910
  margin: 0 0 30px;
@@ -28941,7 +28937,7 @@ const TooltipLabel = styled.div`
28941
28937
  font-weight: 400;
28942
28938
  width: fit-content;
28943
28939
  `;
28944
- const TooltipTitle$1 = styled.div`
28940
+ const TooltipTitle$2 = styled.div`
28945
28941
  color: #212121;
28946
28942
  font-size: 14px;
28947
28943
  font-weight: 600;
@@ -29095,7 +29091,7 @@ const DoubleBarSingleLine = props => {
29095
29091
  } else {
29096
29092
  `${currentTooltipValue.toFixed(1)}`;
29097
29093
  }
29098
- return /*#__PURE__*/React$1.createElement(TooltipDiv, null, /*#__PURE__*/React$1.createElement(TooltipTitle$1, null, `${label}`), payload.map((item, idx) => {
29094
+ return /*#__PURE__*/React$1.createElement(TooltipDiv, null, /*#__PURE__*/React$1.createElement(TooltipTitle$2, null, `${label}`), payload.map((item, idx) => {
29099
29095
  const dataStateItem = dataState.find(state => state.key === item.dataKey);
29100
29096
  return /*#__PURE__*/React$1.createElement(TooltipLabel, {
29101
29097
  key: item.dataKey || idx
@@ -29168,7 +29164,7 @@ const DoubleBarSingleLine = props => {
29168
29164
  noDataText: noDataText
29169
29165
  }) : /*#__PURE__*/React$1.createElement(Controls$2, {
29170
29166
  className: "Controls"
29171
- }, title && title.trim() !== '' && /*#__PURE__*/React$1.createElement(Title$3, null, title), /*#__PURE__*/React$1.createElement(ChartsWrapper, {
29167
+ }, title && title.trim() !== '' && /*#__PURE__*/React$1.createElement(Title$4, null, title), /*#__PURE__*/React$1.createElement(ChartsWrapper, {
29172
29168
  width: hasScroll ? `${data.length * 178}px` : 'auto'
29173
29169
  }, /*#__PURE__*/React$1.createElement(LineChartWrapper, null, /*#__PURE__*/React$1.createElement(ResponsiveContainer, null, /*#__PURE__*/React$1.createElement(LineChart, _extends({
29174
29170
  data: transformedData
@@ -29186,7 +29182,7 @@ const DoubleBarSingleLine = props => {
29186
29182
  right: barsWidth
29187
29183
  }
29188
29184
  }), /*#__PURE__*/React$1.createElement(YAxis, {
29189
- domain: [dataMin => Math.min(dataMin, calculateMinValue(data, dataState)) + 5, dataMax => Math.max(dataMax, calculateMaxValue(data, dataState)) + 5],
29185
+ domain: [dataMin => Math.min(dataMin, calculateMinValue(data, dataState)) - 5, dataMax => Math.max(dataMax, calculateMaxValue(data, dataState)) + 10],
29190
29186
  hide: true
29191
29187
  }), dataState.filter(item => item.type === "line").map(obj => /*#__PURE__*/React$1.createElement(Line, {
29192
29188
  type: lineType,
@@ -29267,7 +29263,7 @@ const CheckboxGroupContainer = styled.div`
29267
29263
  height: 21px;
29268
29264
  gap: 20px;
29269
29265
  `;
29270
- const Title$2 = styled.h5`
29266
+ const Title$3 = styled.h5`
29271
29267
  font-weight: 500;
29272
29268
  font-size: 18px;
29273
29269
  line-height: 20px;
@@ -29287,7 +29283,7 @@ const LegendIcon = styled.div`
29287
29283
  margin-right: 5px;
29288
29284
  background-color: ${props => props.color};
29289
29285
  `;
29290
- const TooltipContainer = styled.div`
29286
+ const TooltipContainer$1 = styled.div`
29291
29287
  background: white;
29292
29288
  padding: 10px;
29293
29289
  border-radius: 5px;
@@ -29297,12 +29293,12 @@ const TooltipContainer = styled.div`
29297
29293
  font-weight: 500;
29298
29294
  font-size: 14px;
29299
29295
  `;
29300
- const TooltipTitle = styled.p`
29296
+ const TooltipTitle$1 = styled.p`
29301
29297
  font-weight: 700;
29302
29298
  margin-top: 5px;
29303
29299
  margin-bottom: 5px;
29304
29300
  `;
29305
- const TooltipText = styled.p`
29301
+ const TooltipText$1 = styled.p`
29306
29302
  margin-top: 5px;
29307
29303
  margin-bottom: 5px;
29308
29304
  `;
@@ -29543,10 +29539,10 @@ const AreaChart = props => {
29543
29539
  payload
29544
29540
  } = _ref3;
29545
29541
  if (active && payload && payload.length) {
29546
- return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${payload[0].payload.label}`), payload.map((data, index) => {
29542
+ return /*#__PURE__*/React$1.createElement(TooltipContainer$1, null, /*#__PURE__*/React$1.createElement(TooltipTitle$1, null, `${payload[0].payload.label}`), payload.map((data, index) => {
29547
29543
  const chart = areaChartsState.find(chart => chart.key === data.dataKey);
29548
29544
  if (chart) {
29549
- return /*#__PURE__*/React$1.createElement(TooltipText, {
29545
+ return /*#__PURE__*/React$1.createElement(TooltipText$1, {
29550
29546
  key: index
29551
29547
  }, `${chart.name}: ${displayFormattedValue(data.value, chart.isDollar)}`);
29552
29548
  }
@@ -29595,7 +29591,7 @@ const AreaChart = props => {
29595
29591
  height: height
29596
29592
  }) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(HeaderContainer$2, {
29597
29593
  "data-testid": "header-container"
29598
- }, /*#__PURE__*/React$1.createElement(Title$2, {
29594
+ }, /*#__PURE__*/React$1.createElement(Title$3, {
29599
29595
  "data-testid": "title"
29600
29596
  }, title), /*#__PURE__*/React$1.createElement(CheckboxGroupContainer, {
29601
29597
  "data-testid": "checkbox-group-container"
@@ -30093,7 +30089,7 @@ const HeaderContainer$1 = styled.div`
30093
30089
  align-items: center;
30094
30090
  padding-bottom: 8px;
30095
30091
  `;
30096
- const Title$1 = styled.h3`
30092
+ const Title$2 = styled.h3`
30097
30093
  font-size: 18px;
30098
30094
  font-weight: 400;
30099
30095
  margin: 0;
@@ -30162,7 +30158,7 @@ const BreakdownPanel = props => {
30162
30158
  height: height
30163
30159
  }) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(HeaderContainer$1, {
30164
30160
  "data-testid": "header-container"
30165
- }, /*#__PURE__*/React$1.createElement(Title$1, {
30161
+ }, /*#__PURE__*/React$1.createElement(Title$2, {
30166
30162
  "data-testid": "title"
30167
30163
  }, title)), /*#__PURE__*/React$1.createElement(CategorySalesMainContainer, {
30168
30164
  "data-testid": "category-sales-main-container"
@@ -31404,41 +31400,94 @@ const BatteryChart = props => {
31404
31400
  }))))))), starText !== "" && /*#__PURE__*/React$1.createElement(StarText, null, starText));
31405
31401
  };
31406
31402
 
31407
- // const originalData = [
31408
- // { label: "Vendor Selling Event: Week 34", inc_sales: 20000, inc_roi: 1.2 },
31409
- // { label: "Vendor Selling Event: Week 36", inc_sales: 10000, inc_roi: 1.2 },
31410
- // { label: "Vendor Selling Event: Week 38", inc_sales: 8000, inc_roi: 0.8 },
31411
- // { label: "Vendor Selling Event: Week 33", inc_sales: 12000, inc_roi: 1.1 },
31412
- // { label: "Vendor Selling Event: Week 29", inc_sales: 8000, inc_roi: 1.2 },
31413
- // { label: "Vendor Selling Event: Week 28", inc_sales: 8000, inc_roi: 0.7 },
31414
- // { label: "Vendor Selling Event: Week 35", inc_sales: 8000, inc_roi: 0.8 },
31415
- // { label: "Vendor Selling Event: Week 30", inc_sales: 9000, inc_roi: 1.1 },
31416
- // ];
31403
+ const Container = styled.div`
31404
+ width: ${props => props.width};
31405
+ height: ${props => props.height};
31406
+ padding: 15px;
31407
+ display: flex;
31408
+ flex-direction: column;
31409
+ #Segment {
31410
+ width: auto;
31411
+ white-space: nowrap;
31412
+ font-size: 14px;
31413
+ font-weight: 500;
31414
+ font-family: "Poppins"
31415
+ }
31416
+ `;
31417
+ const Title$1 = styled.h2`
31418
+ color: #212121;
31419
+ font-family: "Poppins";
31420
+ font-size: 18px;
31421
+ font-style: normal;
31422
+ font-weight: 400;
31423
+ line-height: normal;
31424
+ margin: 0 0 16px 0;
31425
+ `;
31426
+ styled.div`
31427
+ font-family: sans-serif;
31428
+ text-align: center;
31429
+ `;
31430
+ styled.div`
31431
+ height: 25%;
31432
+ `;
31433
+ styled.div`
31434
+ height: 75%;
31435
+ `;
31436
+ styled.div`
31437
+ height: 100%;
31438
+ display: flex;
31439
+ flex-direction: column;
31440
+ background-color: white;
31441
+ `;
31442
+ const TooltipContainer = styled.div`
31443
+ background: white;
31444
+ padding: 10px;
31445
+ border-radius: 5px;
31446
+ box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
31447
+ border: 1px solid #ddd;
31448
+ font-family: Poppins, sans-serif;
31449
+ font-weight: 500;
31450
+ font-size: 14px;
31451
+ `;
31452
+ const TooltipTitle = styled.p`
31453
+ font-weight: 700;
31454
+ margin-top: 5px;
31455
+ margin-bottom: 5px;
31456
+ `;
31457
+ const TooltipText = styled.p`
31458
+ margin-top: 5px;
31459
+ margin-bottom: 5px;
31460
+ `;
31417
31461
 
31418
31462
  const SeparatedLineBarChart = ({
31419
- barlineData = []
31463
+ brushAreaBarData = []
31420
31464
  }) => {
31421
- // Sort the data by week number extracted from the label
31422
- const sortedData = barlineData?.sort((a, b) => {
31423
- const weekA = parseInt(a.label.match(/Week (\d+)/)[1], 10);
31424
- const weekB = parseInt(b.label.match(/Week (\d+)/)[1], 10);
31425
- return weekA - weekB;
31465
+ const processedData = brushAreaBarData.map(item => {
31466
+ return {
31467
+ ...item,
31468
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31469
+ };
31426
31470
  });
31427
- const dataWithIndex = sortedData.map((item, index) => ({
31428
- ...item,
31429
- index,
31430
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31431
- }));
31432
- const CustomizedTick = ({
31433
- x,
31434
- y,
31435
- payload,
31436
- viewableIndices
31437
- }) => {
31438
- const label = dataWithIndex[payload.value]?.label ?? "";
31439
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31440
- if (!viewableIndices.includes(payload.value)) {
31441
- return null;
31471
+ const CustomizedTick = props => {
31472
+ const {
31473
+ x,
31474
+ y,
31475
+ payload
31476
+ } = props;
31477
+ const label = payload.value;
31478
+ const words = label.split(" ");
31479
+ const chunks = [];
31480
+ let currentChunk = "";
31481
+ words.forEach(word => {
31482
+ if (currentChunk.length + word.length > 15) {
31483
+ chunks.push(currentChunk.trim());
31484
+ currentChunk = word;
31485
+ } else {
31486
+ currentChunk += (currentChunk ? " " : "") + word;
31487
+ }
31488
+ });
31489
+ if (currentChunk) {
31490
+ chunks.push(currentChunk.trim());
31442
31491
  }
31443
31492
  return /*#__PURE__*/React$1.createElement("g", {
31444
31493
  transform: `translate(${x},${y})`
@@ -31448,89 +31497,68 @@ const SeparatedLineBarChart = ({
31448
31497
  dy: 16,
31449
31498
  textAnchor: "middle",
31450
31499
  fill: "#212121",
31451
- fontSize: 11,
31452
- fontWeight: "400",
31500
+ fontSize: 10,
31453
31501
  fontFamily: "Poppins"
31454
- }, /*#__PURE__*/React$1.createElement("tspan", {
31502
+ }, chunks.map((chunk, i) => /*#__PURE__*/React$1.createElement("tspan", {
31503
+ key: i,
31455
31504
  x: 0,
31456
- dy: 8
31457
- }, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
31458
- x: 0,
31459
- dy: 18
31460
- }, "Event: ", parts.join(" "))));
31505
+ dy: i === 0 ? "0.71em" : "1.2em"
31506
+ }, chunk))));
31461
31507
  };
31462
- const CustomLabelListFilter = props => {
31463
- const {
31464
- viewableIndices,
31465
- dataKey,
31466
- position,
31467
- formatter,
31468
- fill,
31469
- fontSize,
31470
- fontWeight,
31471
- fontFamily
31472
- } = props;
31473
- return /*#__PURE__*/React$1.createElement(LabelList, {
31474
- dataKey: dataKey,
31475
- position: position,
31476
- formatter: (value, name, props) => {
31477
- if (!viewableIndices.includes(props.index)) {
31478
- return "";
31479
- }
31480
- return formatter ? formatter(value) : value;
31481
- },
31482
- fill: fill || "#212121",
31483
- fontSize: fontSize || 12,
31484
- fontWeight: fontWeight || "400",
31485
- fontFamily: fontFamily || "Poppins"
31486
- });
31508
+ const CustomTooltip = ({
31509
+ active,
31510
+ payload
31511
+ }) => {
31512
+ if (!active || !payload || !payload.length) return null;
31513
+ const data = payload[0]?.payload;
31514
+ if (!data) return null;
31515
+ return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales: ${getFormattedValue(data.inc_sales)}${getFormattedUnits(data.inc_sales)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `INC Sales ROI: ${getFormattedValue(data.inc_roi)}${getFormattedUnits(data.inc_roi)}`));
31487
31516
  };
31488
31517
  const chartMargins = {
31489
- top: 15,
31490
- right: 40,
31518
+ top: 30,
31519
+ right: 30,
31491
31520
  left: 20,
31492
- bottom: 40
31521
+ bottom: 0
31493
31522
  };
31494
- const [viewWindow, setViewWindow] = useState({
31495
- startIndex: 0,
31496
- endIndex: dataWithIndex.length - 1
31497
- });
31498
- const viewableIndices = [];
31499
- for (let i = viewWindow.startIndex; i <= viewWindow.endIndex; i++) {
31500
- viewableIndices.push(i);
31501
- }
31502
- dataWithIndex.filter(item => viewableIndices.includes(item.index));
31523
+ const chartMargins2 = {
31524
+ top: 30,
31525
+ right: 30,
31526
+ left: 20,
31527
+ bottom: 80
31528
+ };
31529
+ const BAR_CATEGORY_GAP = "30%";
31503
31530
  return /*#__PURE__*/React$1.createElement("div", {
31504
31531
  style: {
31505
31532
  width: "100%",
31506
- height: 700
31533
+ height: "100%"
31507
31534
  }
31508
31535
  }, /*#__PURE__*/React$1.createElement("div", {
31509
31536
  style: {
31510
- height: "40%"
31537
+ height: "25%"
31511
31538
  }
31512
31539
  }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
31513
31540
  width: "100%",
31514
31541
  height: "100%"
31515
31542
  }, /*#__PURE__*/React$1.createElement(LineChart, {
31516
- data: dataWithIndex,
31517
- margin: chartMargins
31543
+ data: processedData,
31544
+ margin: chartMargins,
31545
+ syncId: "composedChart",
31546
+ syncMethod: "index"
31518
31547
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
31519
31548
  strokeDasharray: "3 3",
31520
31549
  vertical: false
31521
31550
  }), /*#__PURE__*/React$1.createElement(XAxis, {
31522
- dataKey: "index",
31523
- type: "number",
31524
- domain: ['dataMin', 'dataMax'],
31551
+ dataKey: "label",
31552
+ tick: false,
31525
31553
  padding: {
31526
- left: 20,
31527
- right: 20
31554
+ left: 70,
31555
+ right: 70
31528
31556
  },
31529
31557
  hide: true
31530
31558
  }), /*#__PURE__*/React$1.createElement(YAxis, {
31531
31559
  domain: [0, 2],
31532
31560
  hide: true
31533
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Line, {
31561
+ }), /*#__PURE__*/React$1.createElement(Line, {
31534
31562
  type: "monotone",
31535
31563
  dataKey: "inc_roi",
31536
31564
  stroke: "#F8CD00",
@@ -31540,73 +31568,81 @@ const SeparatedLineBarChart = ({
31540
31568
  fill: "#F8CD00"
31541
31569
  },
31542
31570
  activeDot: false,
31543
- name: "INC Sales ROI"
31544
- }, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
31571
+ name: "INC Sales ROI",
31572
+ barCategoryGap: BAR_CATEGORY_GAP,
31573
+ barGap: 0
31574
+ }, /*#__PURE__*/React$1.createElement(LabelList, {
31545
31575
  dataKey: "inc_roi",
31546
31576
  position: "top",
31547
- formatter: value => value.toFixed(1),
31548
- viewableIndices: viewableIndices
31549
- }))))), /*#__PURE__*/React$1.createElement("div", {
31577
+ formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31578
+ fill: "#212121",
31579
+ fontSize: 12,
31580
+ fontWeight: "400",
31581
+ fontFamily: "Poppins"
31582
+ })), /*#__PURE__*/React$1.createElement(Brush, {
31583
+ dataKey: "label",
31584
+ height: 30,
31585
+ stroke: "#212121",
31586
+ startIndex: 0,
31587
+ endIndex: Math.min(6, processedData.length - 1),
31588
+ y: 330,
31589
+ travellerWidth: 10,
31590
+ tickFormatter: (value, index) => index + 1,
31591
+ hide: true
31592
+ })))), /*#__PURE__*/React$1.createElement("div", {
31550
31593
  style: {
31551
- height: "60%"
31594
+ height: "70%"
31552
31595
  }
31553
31596
  }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
31554
31597
  width: "100%",
31555
31598
  height: "100%"
31556
31599
  }, /*#__PURE__*/React$1.createElement(ComposedChart, {
31557
- data: dataWithIndex,
31558
- margin: chartMargins
31600
+ data: processedData,
31601
+ margin: chartMargins2,
31602
+ syncId: "composedChart",
31603
+ syncMethod: "index",
31604
+ barCategoryGap: BAR_CATEGORY_GAP,
31605
+ barGap: 0
31559
31606
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
31560
31607
  strokeDasharray: "3 3",
31561
31608
  vertical: false
31562
31609
  }), /*#__PURE__*/React$1.createElement(XAxis, {
31563
- dataKey: "index",
31564
- type: "number",
31565
- domain: ['dataMin', 'dataMax'],
31566
- padding: {
31567
- left: 20,
31568
- right: 20
31569
- },
31570
- tick: props => /*#__PURE__*/React$1.createElement(CustomizedTick, _extends({}, props, {
31571
- viewableIndices: viewableIndices
31572
- })),
31610
+ dataKey: "label",
31611
+ tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null),
31573
31612
  interval: 0,
31574
- height: 60,
31575
- tickLine: false,
31576
- ticks: dataWithIndex.map(item => item.index)
31613
+ height: 80,
31614
+ tickLine: false
31577
31615
  }), /*#__PURE__*/React$1.createElement(YAxis, {
31578
31616
  tickFormatter: v => `${v / 1000}k`,
31579
31617
  hide: true
31580
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
31618
+ }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
31619
+ content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
31620
+ }), /*#__PURE__*/React$1.createElement(Bar, {
31581
31621
  dataKey: "inc_sales",
31582
31622
  fill: "#CCDCDD",
31583
- gap: "4px",
31623
+ gap: 4,
31584
31624
  borderRadius: [4, 4, 0, 8],
31585
31625
  barSize: 40,
31586
31626
  name: "INC Sales"
31587
- }, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
31627
+ }, /*#__PURE__*/React$1.createElement(LabelList, {
31588
31628
  dataKey: "inc_sales",
31589
31629
  position: "top",
31590
- formatter: value => `${value / 1000}k`,
31591
- viewableIndices: viewableIndices
31630
+ formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31631
+ fill: "#212121",
31632
+ fontSize: 12,
31633
+ fontWeight: "400",
31634
+ fontFamily: "Poppins"
31592
31635
  })), /*#__PURE__*/React$1.createElement(Brush, {
31593
- dataKey: "index",
31636
+ dataKey: "label",
31594
31637
  height: 30,
31595
31638
  stroke: "#212121",
31596
- startIndex: viewWindow.startIndex,
31597
- endIndex: viewWindow.endIndex,
31598
- onChange: e => {
31599
- setViewWindow({
31600
- startIndex: e.startIndex ?? 0,
31601
- endIndex: e.endIndex ?? dataWithIndex.length - 1
31602
- });
31603
- },
31604
- travellerWidth: 12
31605
- })), /*#__PURE__*/React$1.createElement("div", {
31606
- style: {
31607
- marginTop: "-28px"
31608
- }
31609
- }, /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
31639
+ startIndex: 0,
31640
+ endIndex: Math.min(6, processedData.length - 1),
31641
+ travellerWidth: 10,
31642
+ tickFormatter: (value, index) => index + 1
31643
+ })), /*#__PURE__*/React$1.createElement("div", null)), /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
31644
+ width: "100%",
31645
+ height: "40px",
31610
31646
  legendData: [{
31611
31647
  iconColor: "#CCDCDD",
31612
31648
  iconType: "Square",
@@ -31616,13 +31652,15 @@ const SeparatedLineBarChart = ({
31616
31652
  iconType: "LegendUnionIcon",
31617
31653
  title: "INC Sales ROI"
31618
31654
  }]
31619
- })))));
31655
+ })));
31620
31656
  };
31621
31657
 
31622
31658
  function SingleChart({
31623
- lineChartData
31659
+ barData,
31660
+ height = 450,
31661
+ width = "100%"
31624
31662
  }) {
31625
- const dataWithIndex = lineChartData?.map((item, index) => ({
31663
+ const dataWithIndex = barData?.map((item, index) => ({
31626
31664
  ...item,
31627
31665
  index,
31628
31666
  shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
@@ -31633,7 +31671,20 @@ function SingleChart({
31633
31671
  payload
31634
31672
  }) => {
31635
31673
  const label = dataWithIndex[payload.value]?.label ?? "";
31636
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31674
+ const words = label.split(' ');
31675
+ const chunks = [];
31676
+ let currentChunk = '';
31677
+ words.forEach(word => {
31678
+ if (currentChunk.length + word.length > 15) {
31679
+ chunks.push(currentChunk.trim());
31680
+ currentChunk = word;
31681
+ } else {
31682
+ currentChunk += (currentChunk ? ' ' : '') + word;
31683
+ }
31684
+ });
31685
+ if (currentChunk) {
31686
+ chunks.push(currentChunk.trim());
31687
+ }
31637
31688
  return /*#__PURE__*/React$1.createElement("g", {
31638
31689
  transform: `translate(${x},${y})`
31639
31690
  }, /*#__PURE__*/React$1.createElement("text", {
@@ -31642,31 +31693,31 @@ function SingleChart({
31642
31693
  dy: 16,
31643
31694
  textAnchor: "middle",
31644
31695
  fill: "#212121",
31645
- fontSize: 11,
31646
- fontWeight: "400",
31696
+ fontSize: 10,
31647
31697
  fontFamily: "Poppins"
31648
- }, /*#__PURE__*/React$1.createElement("tspan", {
31649
- x: 0,
31650
- dy: 8
31651
- }, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
31698
+ }, chunks.map((chunk, i) => /*#__PURE__*/React$1.createElement("tspan", {
31699
+ key: i,
31652
31700
  x: 0,
31653
- dy: 18
31654
- }, "Event: ", parts.join(" "))));
31701
+ dy: i === 0 ? "0.71em" : "1.2em"
31702
+ }, chunk))));
31703
+ };
31704
+ const CustomTooltip = ({
31705
+ active,
31706
+ payload
31707
+ }) => {
31708
+ if (!active || !payload || !payload.length) return null;
31709
+ const data = payload[0]?.payload;
31710
+ if (!data) return null;
31711
+ return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.typeTitle}: ${getFormattedValue(data.value)}${getFormattedUnits(data.value)}`));
31655
31712
  };
31656
- const [startIndex, setStartIndex] = useState(0);
31657
- const [endIndex, setEndIndex] = useState(dataWithIndex?.length - 1);
31658
31713
  return /*#__PURE__*/React$1.createElement("div", {
31659
31714
  style: {
31660
31715
  width: "100%",
31661
- height: 600
31662
- }
31663
- }, /*#__PURE__*/React$1.createElement("div", {
31664
- style: {
31665
31716
  height: "100%"
31666
31717
  }
31667
31718
  }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
31668
31719
  width: "100%",
31669
- height: "100%"
31720
+ height: "95%"
31670
31721
  }, /*#__PURE__*/React$1.createElement(ComposedChart, {
31671
31722
  data: dataWithIndex,
31672
31723
  margin: {
@@ -31682,7 +31733,7 @@ function SingleChart({
31682
31733
  dataKey: "index",
31683
31734
  tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null),
31684
31735
  interval: 0,
31685
- height: 60,
31736
+ height: 80,
31686
31737
  padding: {
31687
31738
  left: 20,
31688
31739
  right: 20
@@ -31691,7 +31742,9 @@ function SingleChart({
31691
31742
  }), /*#__PURE__*/React$1.createElement(YAxis, {
31692
31743
  tickFormatter: v => `$${v / 1000}k`,
31693
31744
  hide: true
31694
- }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
31745
+ }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
31746
+ content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
31747
+ }), /*#__PURE__*/React$1.createElement(Bar, {
31695
31748
  dataKey: "value",
31696
31749
  fill: "#CCDCDD",
31697
31750
  gap: "4px",
@@ -31701,29 +31754,25 @@ function SingleChart({
31701
31754
  }, /*#__PURE__*/React$1.createElement(LabelList, {
31702
31755
  dataKey: "value",
31703
31756
  position: "top",
31704
- formatter: value => `$${value / 1000}k`,
31757
+ formatter: value => `$${getFormattedValue(value)}${getFormattedUnits(value)}`,
31705
31758
  fill: "#212121",
31706
31759
  fontSize: 12,
31707
31760
  fontWeight: "400",
31708
31761
  fontFamily: "Poppins"
31709
31762
  })), /*#__PURE__*/React$1.createElement(Brush, {
31710
- dataKey: "index",
31711
31763
  height: 30,
31712
- stroke: "#212121",
31713
- startIndex: startIndex,
31714
- endIndex: endIndex,
31715
- onChange: e => {
31716
- setStartIndex(e.startIndex ?? 0);
31717
- setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
31718
- },
31719
- travellerWidth: 12
31720
- })), /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
31764
+ travellerWidth: 10,
31765
+ startIndex: 0,
31766
+ endIndex: Math.min(6, barData.length - 1)
31767
+ }))), /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
31768
+ width: "100%",
31769
+ height: "40px",
31721
31770
  legendData: [{
31722
31771
  iconColor: "#CCDCDD",
31723
31772
  iconType: "Square",
31724
31773
  title: "INC Units"
31725
31774
  }]
31726
- }))));
31775
+ }));
31727
31776
  }
31728
31777
 
31729
31778
  styled.div`
@@ -31954,16 +32003,8 @@ SegmentedButton.defaultProps = {
31954
32003
  };
31955
32004
 
31956
32005
  function InnerBarChart({
31957
- data = []
32006
+ brushInnerBarData
31958
32007
  }) {
31959
- const processedData = data.map(item => {
31960
- const parts = item.label.replace("Vendor Selling Event:", "").trim();
31961
- return {
31962
- ...item,
31963
- shortLabel: parts
31964
- };
31965
- });
31966
- const format = v => v >= 1000 ? `${v / 1000}K` : v;
31967
32008
  const BarWithInner = props => {
31968
32009
  const {
31969
32010
  x,
@@ -31992,7 +32033,7 @@ function InnerBarChart({
31992
32033
  fontWeight: 400,
31993
32034
  fontFamily: "Poppins",
31994
32035
  fill: "#212121"
31995
- }, format(payload.total)), /*#__PURE__*/React$1.createElement("rect", {
32036
+ }, `${getFormattedValue(payload.total)}${getFormattedUnits(payload.total)}`), /*#__PURE__*/React$1.createElement("rect", {
31996
32037
  x: x + width * 0.2,
31997
32038
  y: innerY,
31998
32039
  width: width * 0.6,
@@ -32008,7 +32049,7 @@ function InnerBarChart({
32008
32049
  fontWeight: 400,
32009
32050
  fontFamily: "Poppins",
32010
32051
  fill: "#212121"
32011
- }, format(payload.actual)));
32052
+ }, `${getFormattedValue(payload.actual)}${getFormattedUnits(payload.actual)}`));
32012
32053
  };
32013
32054
  const CustomTooltip = ({
32014
32055
  active,
@@ -32017,9 +32058,8 @@ function InnerBarChart({
32017
32058
  }) => {
32018
32059
  if (!active || !payload || !payload.length) return null;
32019
32060
  const data = payload[0].payload;
32020
- return /*#__PURE__*/React$1.createElement("div", {
32021
- className: "bg-white border border-gray-300 p-2 rounded-lg text-sm"
32022
- }, /*#__PURE__*/React$1.createElement("strong", null, data.label), /*#__PURE__*/React$1.createElement("div", null, "Actual: ", format(data.actual)), /*#__PURE__*/React$1.createElement("div", null, "Total: ", format(data.total)));
32061
+ const repeaterPercentage = (data.actual / data.total * 100).toFixed(1);
32062
+ return /*#__PURE__*/React$1.createElement(TooltipContainer, null, /*#__PURE__*/React$1.createElement(TooltipTitle, null, `${data.label}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `${data.description}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `New Shoppers: ${getFormattedValue(data.total)}${getFormattedUnits(data.total)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `Repeaters: ${getFormattedValue(data.actual)}${getFormattedUnits(data.actual)}`), /*#__PURE__*/React$1.createElement(TooltipText, null, `% Repeaters: ${repeaterPercentage}%`));
32023
32063
  };
32024
32064
  const CustomizedTick = props => {
32025
32065
  const {
@@ -32027,7 +32067,23 @@ function InnerBarChart({
32027
32067
  y,
32028
32068
  payload
32029
32069
  } = props;
32030
- const labelText = payload.value.replace("Vendor Selling Event:", "").trim();
32070
+ const label = payload.value;
32071
+
32072
+ // Split the label into chunks of words
32073
+ const words = label.split(" ");
32074
+ const chunks = [];
32075
+ let currentChunk = "";
32076
+ words.forEach(word => {
32077
+ if (currentChunk.length + word.length > 15) {
32078
+ chunks.push(currentChunk.trim());
32079
+ currentChunk = word;
32080
+ } else {
32081
+ currentChunk += " " + word;
32082
+ }
32083
+ });
32084
+ if (currentChunk) {
32085
+ chunks.push(currentChunk.trim());
32086
+ }
32031
32087
  return /*#__PURE__*/React$1.createElement("g", {
32032
32088
  transform: `translate(${x},${y})`
32033
32089
  }, /*#__PURE__*/React$1.createElement("text", {
@@ -32038,104 +32094,82 @@ function InnerBarChart({
32038
32094
  fill: "#212121",
32039
32095
  fontSize: 10,
32040
32096
  fontFamily: "Poppins"
32041
- }, /*#__PURE__*/React$1.createElement("tspan", {
32042
- x: 0,
32043
- dy: "0.71em"
32044
- }, "Vendor"), /*#__PURE__*/React$1.createElement("tspan", {
32097
+ }, chunks.map((chunk, i) => /*#__PURE__*/React$1.createElement("tspan", {
32098
+ key: i,
32045
32099
  x: 0,
32046
- dy: "1.2em"
32047
- }, "Selling"), /*#__PURE__*/React$1.createElement("tspan", {
32048
- x: 0,
32049
- dy: "1.2em"
32050
- }, labelText)));
32100
+ dy: i === 0 ? "0.71em" : "1.2em"
32101
+ }, chunk))));
32051
32102
  };
32052
32103
  return /*#__PURE__*/React$1.createElement("div", {
32053
- className: "w-full"
32054
- }, /*#__PURE__*/React$1.createElement("h3", {
32055
- className: "text-lg font-medium mb-4 text-center"
32056
- }, "Vendor Selling Events Comparison"), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
32104
+ style: {
32105
+ width: "100%",
32106
+ height: "100%"
32107
+ }
32108
+ }, /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
32057
32109
  width: "100%",
32058
- height: 450
32110
+ height: "95%"
32059
32111
  }, /*#__PURE__*/React$1.createElement(BarChart$1, {
32060
- data: processedData,
32112
+ data: brushInnerBarData,
32061
32113
  margin: {
32062
32114
  top: 30,
32063
32115
  right: 30,
32064
32116
  left: 20,
32065
- bottom: 60
32117
+ bottom: 80
32066
32118
  }
32067
32119
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
32068
32120
  strokeDasharray: "3 3",
32069
32121
  vertical: false
32070
32122
  }), /*#__PURE__*/React$1.createElement(XAxis, {
32071
- dataKey: "shortLabel",
32123
+ dataKey: "label",
32072
32124
  tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null),
32073
- height: 70,
32125
+ height: 80,
32074
32126
  interval: 0
32075
32127
  }), /*#__PURE__*/React$1.createElement(YAxis, {
32076
32128
  type: "number",
32077
32129
  domain: [0, "dataMax + 2000"],
32078
- tickFormatter: format
32130
+ hide: true
32079
32131
  }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
32080
32132
  content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
32081
- }), /*#__PURE__*/React$1.createElement(Brush, {
32082
- height: 30,
32083
- travellerWidth: 10,
32084
- startIndex: 0,
32085
- endIndex: 5,
32086
- y: 380
32087
32133
  }), /*#__PURE__*/React$1.createElement(Bar, {
32088
32134
  dataKey: "total",
32089
32135
  shape: /*#__PURE__*/React$1.createElement(BarWithInner, null),
32090
32136
  barSize: 36
32091
- }))));
32137
+ }), /*#__PURE__*/React$1.createElement(Brush, {
32138
+ height: 30,
32139
+ travellerWidth: 10,
32140
+ startIndex: 0,
32141
+ endIndex: Math.min(6, brushInnerBarData.length - 1)
32142
+ }))), /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
32143
+ width: "100%",
32144
+ height: "40px",
32145
+ legendData: [{
32146
+ iconColor: "#CCDCDD",
32147
+ iconType: "Square",
32148
+ title: "New Shoppers"
32149
+ }, {
32150
+ iconColor: "#07575b",
32151
+ iconType: "Square",
32152
+ title: "Repeaters"
32153
+ }]
32154
+ }));
32092
32155
  }
32093
32156
 
32094
- const Container = styled.div`
32095
- width: ${props => props.width};
32096
- height: ${props => props.height};
32097
- padding: 15px;
32098
- display: flex;
32099
- flex-direction: column;
32100
- #Segment {
32101
- width: auto;
32102
- white-space: nowrap;
32103
- font-size: 14px;
32104
- font-weight: 500;
32105
- font-family: "Poppins"
32106
- }
32107
- `;
32108
- styled.div`
32109
- font-family: sans-serif;
32110
- text-align: center;
32111
- `;
32112
- styled.div`
32113
- height: 25%;
32114
- `;
32115
- styled.div`
32116
- height: 75%;
32117
- `;
32118
- styled.div`
32119
- height: 100%;
32120
- display: flex;
32121
- flex-direction: column;
32122
- background-color: white;
32123
- `;
32124
-
32125
32157
  const BrushChart = props => {
32126
32158
  const {
32127
32159
  width,
32128
32160
  height,
32129
- data,
32130
- barlineData,
32131
- lineChartData
32161
+ brushInnerBarData,
32162
+ brushBarIncData,
32163
+ brushBarBasketData,
32164
+ brushAreaBarData,
32165
+ title
32132
32166
  } = props;
32133
32167
  const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
32134
32168
  const [selectedOption, setSelectedOption] = useState(segmentedbuttonOptions[0]);
32135
32169
  return /*#__PURE__*/React$1.createElement(Container, {
32136
32170
  height: height,
32137
32171
  width: width
32138
- }, /*#__PURE__*/React$1.createElement(SegmentedButton, {
32172
+ }, /*#__PURE__*/React$1.createElement(Title$1, null, title), /*#__PURE__*/React$1.createElement(SegmentedButton, {
32139
32173
  gap: "8px",
32140
32174
  options: segmentedbuttonOptions.map(value => ({
32141
32175
  value
@@ -32147,13 +32181,13 @@ const BrushChart = props => {
32147
32181
  return setSelectedOption(value);
32148
32182
  }
32149
32183
  }), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React$1.createElement(InnerBarChart, {
32150
- data: data
32184
+ brushInnerBarData: brushInnerBarData
32151
32185
  }), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React$1.createElement(SeparatedLineBarChart, {
32152
- barlineData: barlineData
32186
+ brushAreaBarData: brushAreaBarData
32153
32187
  }), selectedOption === "INC Units" && /*#__PURE__*/React$1.createElement(SingleChart, {
32154
- lineChartData: lineChartData
32188
+ barData: brushBarIncData
32155
32189
  }), selectedOption === "Basket Lift" && /*#__PURE__*/React$1.createElement(SingleChart, {
32156
- lineChartData: lineChartData
32190
+ barData: brushBarBasketData
32157
32191
  }));
32158
32192
  };
32159
32193
 
@@ -32252,7 +32286,10 @@ const VisibleCardsContainer = styled.div`
32252
32286
 
32253
32287
  .prev-card,
32254
32288
  .next-card {
32255
- opacity: 0.3;
32289
+ background: #d3d3d3;
32290
+ > * {
32291
+ opacity: 0.5;
32292
+ }
32256
32293
  }
32257
32294
 
32258
32295
  .prev-card {