sag_components 2.0.0-beta56 → 2.0.0-beta58

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$d = 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;
@@ -2192,7 +2192,7 @@ const Tooltip$1 = props => {
2192
2192
  clearInterval(timeout);
2193
2193
  setActive(false);
2194
2194
  };
2195
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$3, null, /*#__PURE__*/React__default["default"].createElement(TooltipWrapper$2, {
2195
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$4, null, /*#__PURE__*/React__default["default"].createElement(TooltipWrapper$2, {
2196
2196
  onMouseEnter: showTip,
2197
2197
  onMouseLeave: hideTip
2198
2198
  }, children, active && /*#__PURE__*/React__default["default"].createElement(TooltipTip$1, {
@@ -2423,7 +2423,7 @@ const PieChart = props => {
2423
2423
  width: width
2424
2424
  }, !hideTitleAndValue && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$4, {
2425
2425
  className: "TitleAndValueContainer"
2426
- }, /*#__PURE__*/React__default["default"].createElement(Title$d, {
2426
+ }, /*#__PURE__*/React__default["default"].createElement(Title$f, {
2427
2427
  className: "Title"
2428
2428
  }, title), /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer$2, {
2429
2429
  className: "CurrencySignAndFormattedValueContainer"
@@ -9727,35 +9727,41 @@ const OptionsContainer$4 = styled__default["default"].div`
9727
9727
  padding-top: 8px;
9728
9728
  `;
9729
9729
 
9730
- const ChervronRightIcon = ({
9731
- width = "8",
9732
- height = "13",
9733
- fill = "#777575"
9734
- }) => /*#__PURE__*/React__default["default"].createElement("svg", {
9735
- width: width,
9736
- height: height,
9737
- viewBox: "0 0 8 13",
9738
- fill: "none",
9739
- xmlns: "http://www.w3.org/2000/svg"
9740
- }, /*#__PURE__*/React__default["default"].createElement("path", {
9741
- d: "M7.33984 5.78516C7.58594 6.05859 7.58594 6.46875 7.33984 6.71484L2.08984 11.9648C1.81641 12.2383 1.40625 12.2383 1.16016 11.9648C0.886719 11.7188 0.886719 11.3086 1.16016 11.0625L5.94531 6.27734L1.16016 1.46484C0.886719 1.21875 0.886719 0.808594 1.16016 0.5625C1.40625 0.289062 1.81641 0.289062 2.0625 0.5625L7.33984 5.78516Z",
9742
- fill: fill
9743
- }));
9730
+ const ChervronRightIcon = _ref => {
9731
+ let {
9732
+ width = "8",
9733
+ height = "13",
9734
+ fill = "#777575"
9735
+ } = _ref;
9736
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
9737
+ width: width,
9738
+ height: height,
9739
+ viewBox: "0 0 8 13",
9740
+ fill: "none",
9741
+ xmlns: "http://www.w3.org/2000/svg"
9742
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
9743
+ d: "M7.33984 5.78516C7.58594 6.05859 7.58594 6.46875 7.33984 6.71484L2.08984 11.9648C1.81641 12.2383 1.40625 12.2383 1.16016 11.9648C0.886719 11.7188 0.886719 11.3086 1.16016 11.0625L5.94531 6.27734L1.16016 1.46484C0.886719 1.21875 0.886719 0.808594 1.16016 0.5625C1.40625 0.289062 1.81641 0.289062 2.0625 0.5625L7.33984 5.78516Z",
9744
+ fill: fill
9745
+ }));
9746
+ };
9744
9747
 
9745
- const ChervronLeftIcon = ({
9746
- width = 7,
9747
- height = 13,
9748
- fill = "#777575"
9749
- }) => /*#__PURE__*/React__default["default"].createElement("svg", {
9750
- width: width,
9751
- height: height,
9752
- viewBox: "0 0 7 13",
9753
- fill: "none",
9754
- xmlns: "http://www.w3.org/2000/svg"
9755
- }, /*#__PURE__*/React__default["default"].createElement("path", {
9756
- d: "M0.410156 5.78516L5.66016 0.5625C5.90625 0.289062 6.31641 0.289062 6.58984 0.5625C6.83594 0.808594 6.83594 1.21875 6.58984 1.46484L1.77734 6.25L6.5625 11.0625C6.83594 11.3086 6.83594 11.7188 6.5625 11.9648C6.31641 12.2383 5.90625 12.2383 5.66016 11.9648L0.410156 6.71484C0.136719 6.46875 0.136719 6.05859 0.410156 5.78516Z",
9757
- fill: fill
9758
- }));
9748
+ const ChervronLeftIcon = _ref => {
9749
+ let {
9750
+ width = 7,
9751
+ height = 13,
9752
+ fill = "#777575"
9753
+ } = _ref;
9754
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
9755
+ width: width,
9756
+ height: height,
9757
+ viewBox: "0 0 7 13",
9758
+ fill: "none",
9759
+ xmlns: "http://www.w3.org/2000/svg"
9760
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
9761
+ d: "M0.410156 5.78516L5.66016 0.5625C5.90625 0.289062 6.31641 0.289062 6.58984 0.5625C6.83594 0.808594 6.83594 1.21875 6.58984 1.46484L1.77734 6.25L6.5625 11.0625C6.83594 11.3086 6.83594 11.7188 6.5625 11.9648C6.31641 12.2383 5.90625 12.2383 5.66016 11.9648L0.410156 6.71484C0.136719 6.46875 0.136719 6.05859 0.410156 5.78516Z",
9762
+ fill: fill
9763
+ }));
9764
+ };
9759
9765
 
9760
9766
  /* eslint-disable react/prop-types */
9761
9767
 
@@ -11137,7 +11143,7 @@ const TooltipTextContainer = styled__default["default"].div`
11137
11143
  cursor: pointer;
11138
11144
  }
11139
11145
  `;
11140
- const TooltipText$1 = styled__default["default"].div`
11146
+ const TooltipText$2 = styled__default["default"].div`
11141
11147
  margin: 0;
11142
11148
  `;
11143
11149
 
@@ -11251,7 +11257,7 @@ const FilterPanel = props => {
11251
11257
  inputSubType: 'year'
11252
11258
  } : ''),
11253
11259
  ...(newPeriodPickerSelectedValue[0]?.value === 'ytd' ? {
11254
- inputSubType: 'daterange'
11260
+ inputSubType: 'ytd'
11255
11261
  } : ''),
11256
11262
  ...(newPeriodPickerSelectedValue[0]?.value === 'month' ? {
11257
11263
  inputSubType: 'month'
@@ -11274,7 +11280,7 @@ const FilterPanel = props => {
11274
11280
  inputSubType: 'year'
11275
11281
  } : ''),
11276
11282
  ...(newPeriodPickerSelectedValue[0]?.value === 'ytd' ? {
11277
- inputSubType: 'daterange'
11283
+ inputSubType: 'ytd'
11278
11284
  } : ''),
11279
11285
  ...(newPeriodPickerSelectedValue[0]?.value === 'month' ? {
11280
11286
  inputSubType: 'month'
@@ -11307,8 +11313,8 @@ const FilterPanel = props => {
11307
11313
  fieldsData: newFieldsDataState
11308
11314
  });
11309
11315
  };
11310
- 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"));
11311
- const getTooltipTextGoButton = () => /*#__PURE__*/React__default["default"].createElement(TooltipTextContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipText$1, null, tooltipTextGoButton));
11316
+ 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"));
11317
+ const getTooltipTextGoButton = () => /*#__PURE__*/React__default["default"].createElement(TooltipTextContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipText$2, null, tooltipTextGoButton));
11312
11318
  const getYearsArray = () => {
11313
11319
  const currentYear = moment().year();
11314
11320
  const previousYear = moment().subtract(1, 'years').year();
@@ -11464,7 +11470,7 @@ const FilterPanel = props => {
11464
11470
  const selectedValue = eventRangePicker && typeof eventRangePicker === 'string' ? `${eventRangePicker}` : undefined;
11465
11471
  const newFieldsDataState = FieldsDataState?.map(itemField => itemField.name === item.name ? {
11466
11472
  ...itemField,
11467
- inputSubType: 'daterange',
11473
+ inputSubType: 'ytd',
11468
11474
  selectedValue: selectedValue ? `${selectedValue}` : undefined
11469
11475
  } : itemField);
11470
11476
  setFieldsDataState(newFieldsDataState);
@@ -11473,14 +11479,14 @@ const FilterPanel = props => {
11473
11479
  changedItem: {
11474
11480
  name: item.name,
11475
11481
  inputType: item.inputType,
11476
- inputSubType: 'daterange',
11482
+ inputSubType: 'ytd',
11477
11483
  selectedValue: selectedValue ? `${selectedValue}` : undefined
11478
11484
  }
11479
11485
  });
11480
11486
  },
11481
11487
  required: item.required,
11482
11488
  placeholder: "Select Date Range ...",
11483
- selectedValue: item.selectedValue || getYTDString(),
11489
+ selectedValue: getYTDString(),
11484
11490
  disabled: true,
11485
11491
  width: "100%",
11486
11492
  height: "55px"
@@ -25383,7 +25389,7 @@ const TitleAndValueContainer$3 = styled__default["default"].div`
25383
25389
  display: flex;
25384
25390
  flex-direction: column;
25385
25391
  `;
25386
- const Title$c = styled__default["default"].h4`
25392
+ const Title$e = styled__default["default"].h4`
25387
25393
  font-weight: 400;
25388
25394
  font-size: 20px;
25389
25395
  margin: 0;
@@ -25446,7 +25452,7 @@ const FormattedValue$3 = props => {
25446
25452
  width: width
25447
25453
  }, /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$3, {
25448
25454
  className: "TitleAndValueContainer"
25449
- }, title ? /*#__PURE__*/React__default["default"].createElement(Title$c, {
25455
+ }, title ? /*#__PURE__*/React__default["default"].createElement(Title$e, {
25450
25456
  className: "Title",
25451
25457
  width: width
25452
25458
  }, title) : '', showTopValue && /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer$1, {
@@ -25458,7 +25464,7 @@ const FormattedValue$3 = props => {
25458
25464
  className: "CurrencySignOrPercent"
25459
25465
  }, 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, {
25460
25466
  className: "CurrencySignOrPercent"
25461
- }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default["default"].createElement(Title$c, {
25467
+ }, isPercent ? '%' : ''))), subtitle ? /*#__PURE__*/React__default["default"].createElement(Title$e, {
25462
25468
  className: "Title",
25463
25469
  width: width
25464
25470
  }, subtitle) : '')));
@@ -25520,7 +25526,7 @@ const TooltipLabel$3 = styled__default["default"].div`
25520
25526
  font-weight: 400;
25521
25527
  width: fit-content;
25522
25528
  `;
25523
- const TooltipTitle$3 = styled__default["default"].div`
25529
+ const TooltipTitle$4 = styled__default["default"].div`
25524
25530
  color: #212121;
25525
25531
  font-size: 14px;
25526
25532
  font-weight: 600;
@@ -25528,7 +25534,7 @@ const TooltipTitle$3 = styled__default["default"].div`
25528
25534
  const TitleAndValueContainer$2 = styled__default["default"].div`
25529
25535
  padding: 0 1rem;
25530
25536
  `;
25531
- const Title$b = styled__default["default"].h5`
25537
+ const Title$d = styled__default["default"].h5`
25532
25538
  font-weight: 500;
25533
25539
  font-size: 18px;
25534
25540
  line-height: 20px;
@@ -25657,7 +25663,7 @@ const TitleAndIconContainer = styled__default["default"].div`
25657
25663
  display: flex;
25658
25664
  align-items: center;
25659
25665
  `;
25660
- const Title$a = styled__default["default"].h4`
25666
+ const Title$c = styled__default["default"].h4`
25661
25667
  font-weight: 400;
25662
25668
  font-size: 14px;
25663
25669
  line-height: 27px;
@@ -25711,7 +25717,7 @@ const PerformanceAnalyticsLegend = props => {
25711
25717
  color: item.iconColor
25712
25718
  }) : item.iconType === ICON_TYPE_LEGEND_LINE_ICON$2 ? /*#__PURE__*/React__default["default"].createElement(LegendLineIcon, {
25713
25719
  color: item.iconColor
25714
- }) : '', /*#__PURE__*/React__default["default"].createElement(Title$a, {
25720
+ }) : '', /*#__PURE__*/React__default["default"].createElement(Title$c, {
25715
25721
  id: "Title",
25716
25722
  width: width
25717
25723
  }, item.title))))) : '');
@@ -25809,7 +25815,7 @@ const BarChartsByWeeks = props => {
25809
25815
  let currentTooltipSecondValue = 0;
25810
25816
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
25811
25817
  if (payload[0].payload?.secondValue) currentTooltipSecondValue = payload[0].payload?.secondValue;
25812
- 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}
25818
+ 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}
25813
25819
  ${displayFormattedValue(currentTooltipValue)}
25814
25820
  `), currentTooltipSecondValue ? /*#__PURE__*/React__default["default"].createElement(TooltipLabel$3, null, `${tooltipSecondTitle}
25815
25821
  ${displayFormattedValue(currentTooltipSecondValue)}
@@ -25866,7 +25872,7 @@ const BarChartsByWeeks = props => {
25866
25872
  ref: controlsContainerRef
25867
25873
  }, /*#__PURE__*/React__default["default"].createElement(Controls$6, {
25868
25874
  height: getControlsHeight()
25869
- }, showTitle && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$2, null, /*#__PURE__*/React__default["default"].createElement(Title$b, null, title), /*#__PURE__*/React__default["default"].createElement(FormattedValue$3, {
25875
+ }, 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, {
25870
25876
  title: headerValueTopTitle,
25871
25877
  subtitle: headerValueBottomTitle,
25872
25878
  showTopValue: showHeaderTopValue,
@@ -26099,7 +26105,7 @@ const TitleAndValueContainer$1 = styled__default["default"].div`
26099
26105
  flex-direction: column;
26100
26106
  padding: 0 1.25em; /* 20px → 1.25em */
26101
26107
  `;
26102
- const Title$9 = styled__default["default"].h4`
26108
+ const Title$b = styled__default["default"].h4`
26103
26109
  font-weight: 500;
26104
26110
  font-size: ${props => props.titleFontSize || '1.125em'}; /* Default: 18px → 1.125em */
26105
26111
  margin: 0;
@@ -26302,7 +26308,7 @@ const TotalDoughnutChart = props => {
26302
26308
  width: width
26303
26309
  }, !hideTitleAndValue && /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer$1, {
26304
26310
  className: "TitleAndValueContainer"
26305
- }, /*#__PURE__*/React__default["default"].createElement(Title$9, {
26311
+ }, /*#__PURE__*/React__default["default"].createElement(Title$b, {
26306
26312
  className: "Title",
26307
26313
  fontSize: titleFontSize
26308
26314
  }, title), /*#__PURE__*/React__default["default"].createElement(CurrencySignAndFormattedValueContainer, {
@@ -26432,7 +26438,7 @@ CustomTooltip.defaultProps = {
26432
26438
  isPercent: false
26433
26439
  };
26434
26440
 
26435
- const TooltipContainer$2 = styled__default["default"].div`
26441
+ const TooltipContainer$3 = styled__default["default"].div`
26436
26442
  --tooltip-text-color: black;
26437
26443
  --tooltip-background-color: white;
26438
26444
  --tooltip-margin: 40px;
@@ -26538,7 +26544,7 @@ const Tooltip = props => {
26538
26544
  direction,
26539
26545
  content
26540
26546
  } = props;
26541
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$2, {
26547
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$3, {
26542
26548
  className: className,
26543
26549
  top: `${top}px`,
26544
26550
  left: `${left}px`
@@ -26624,7 +26630,7 @@ const TotalValue = styled__default["default"].div`
26624
26630
  font-size: 20px;
26625
26631
  }
26626
26632
  `;
26627
- const Title$8 = styled__default["default"].h4`
26633
+ const Title$a = styled__default["default"].h4`
26628
26634
  font-size: 18px;
26629
26635
  font-weight: 400;
26630
26636
  line-height: 1;
@@ -26781,7 +26787,7 @@ const TotalHorizontalCharts = props => {
26781
26787
  }, chartsData?.length > 0 ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !hideTitle || !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(CardHeader, {
26782
26788
  ref: topHeader,
26783
26789
  className: "CardHeader"
26784
- }, !hideTitle ? /*#__PURE__*/React__default["default"].createElement(Title$8, null, title) : '', !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(TotalValue, {
26790
+ }, !hideTitle ? /*#__PURE__*/React__default["default"].createElement(Title$a, null, title) : '', !hideTotalValue ? /*#__PURE__*/React__default["default"].createElement(TotalValue, {
26785
26791
  className: "TotalValue"
26786
26792
  }, currencySign && /*#__PURE__*/React__default["default"].createElement(CurrencySign, {
26787
26793
  className: "CurrencySign"
@@ -27254,7 +27260,7 @@ const ItemContainer = styled__default["default"].div`
27254
27260
  flex-direction: column;
27255
27261
  flex-wrap: wrap;
27256
27262
  `;
27257
- const Title$7 = styled__default["default"].h4`
27263
+ const Title$9 = styled__default["default"].h4`
27258
27264
  font-size: 18px;
27259
27265
  font-weight: 500;
27260
27266
  margin: 0;
@@ -27370,7 +27376,7 @@ const SalesAndROI = props => {
27370
27376
  showBorderShadow: showBorderShadow
27371
27377
  }, /*#__PURE__*/React__default["default"].createElement(TitleAndValueContainer, {
27372
27378
  id: "TitleAndValueContainer"
27373
- }, /*#__PURE__*/React__default["default"].createElement(Title$7, {
27379
+ }, /*#__PURE__*/React__default["default"].createElement(Title$9, {
27374
27380
  id: "Title"
27375
27381
  }, title), showBanner && /*#__PURE__*/React__default["default"].createElement(OutBanner, {
27376
27382
  id: "OutBanner",
@@ -27449,7 +27455,7 @@ const ModalOverlay = styled__default["default"].div`
27449
27455
  justify-content: center;
27450
27456
  align-items: center;
27451
27457
  `;
27452
- const ModalContent = styled__default["default"].div`
27458
+ const ModalContent$1 = styled__default["default"].div`
27453
27459
  font-family: "Poppins", sans-serif;
27454
27460
  font-weight: 500;
27455
27461
  font-size: 18px;
@@ -27469,7 +27475,7 @@ const TitleContainer$1 = styled__default["default"].div`
27469
27475
  margin: 0;
27470
27476
  border-bottom: 1px solid #b1b1b1;
27471
27477
  `;
27472
- const Title$6 = styled__default["default"].p`
27478
+ const Title$8 = styled__default["default"].p`
27473
27479
  font-weight: 400;
27474
27480
  font-size: 24px;
27475
27481
  margin: 0;
@@ -27682,14 +27688,14 @@ const PopupCharts = props => {
27682
27688
  }, IsPopupChartsOpen && /*#__PURE__*/React__default["default"].createElement(ModalOverlay, {
27683
27689
  id: "ModalOverlay",
27684
27690
  className: "modal-overlay"
27685
- }, /*#__PURE__*/React__default["default"].createElement(ModalContent, {
27691
+ }, /*#__PURE__*/React__default["default"].createElement(ModalContent$1, {
27686
27692
  id: "ModalContent",
27687
27693
  ref: divRef,
27688
27694
  className: "modal-content",
27689
27695
  height: height,
27690
27696
  width: width,
27691
27697
  onClick: e => e.stopPropagation()
27692
- }, /*#__PURE__*/React__default["default"].createElement(TitleContainer$1, null, /*#__PURE__*/React__default["default"].createElement(Title$6, null, title), /*#__PURE__*/React__default["default"].createElement(CloseXIconContainer, {
27698
+ }, /*#__PURE__*/React__default["default"].createElement(TitleContainer$1, null, /*#__PURE__*/React__default["default"].createElement(Title$8, null, title), /*#__PURE__*/React__default["default"].createElement(CloseXIconContainer, {
27693
27699
  onClick: e => closePopupCharts(e)
27694
27700
  }, /*#__PURE__*/React__default["default"].createElement(CloseXIcon, null))), /*#__PURE__*/React__default["default"].createElement(ChartsContainer, {
27695
27701
  id: "ChartsContainer",
@@ -27787,7 +27793,7 @@ const TopToggleListMainContainer = styled__default["default"].div`
27787
27793
  padding: 0 24px;
27788
27794
  width: ${props => props.width};
27789
27795
  `;
27790
- const Title$5 = styled__default["default"].h4`
27796
+ const Title$7 = styled__default["default"].h4`
27791
27797
  font-size: 14px;
27792
27798
  font-weight: 600;
27793
27799
  margin: 20px 0 12px;
@@ -27817,7 +27823,7 @@ const TopToggleList = props => {
27817
27823
  } = props;
27818
27824
  return /*#__PURE__*/React__default["default"].createElement(TopToggleListMainContainer, {
27819
27825
  width: width
27820
- }, /*#__PURE__*/React__default["default"].createElement(Title$5, null, title), /*#__PURE__*/React__default["default"].createElement(ListContainer, {
27826
+ }, /*#__PURE__*/React__default["default"].createElement(Title$7, null, title), /*#__PURE__*/React__default["default"].createElement(ListContainer, {
27821
27827
  height: height
27822
27828
  }, list.map(item => /*#__PURE__*/React__default["default"].createElement(ListItem, {
27823
27829
  key: item.value
@@ -27879,7 +27885,7 @@ const TitleContainer = styled__default["default"].div`
27879
27885
  justify-content: flex-start;
27880
27886
  margin: 0 0 10px 0;
27881
27887
  `;
27882
- const Title$4 = styled__default["default"].h3`
27888
+ const Title$6 = styled__default["default"].h3`
27883
27889
  user-select: none;
27884
27890
  text-align: left;
27885
27891
  margin: 0;
@@ -27924,7 +27930,7 @@ const BarLabel = styled__default["default"].span`
27924
27930
  font-weight: 400;
27925
27931
  user-select: none;
27926
27932
  `;
27927
- const TooltipContainer$1 = styled__default["default"].div`
27933
+ const TooltipContainer$2 = styled__default["default"].div`
27928
27934
  position: absolute;
27929
27935
 
27930
27936
  top: ${props => props.top};
@@ -28034,7 +28040,7 @@ const Heatmap = props => {
28034
28040
  if (tooltip && tooltipPosition && tooltip.label === `${item.label} - ${Math.round(item.value / totalValue * 100)}%`) {
28035
28041
  const top = `${tooltipPosition.y}px`;
28036
28042
  const left = `${tooltipPosition.x}px`;
28037
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$1, {
28043
+ return /*#__PURE__*/React__default["default"].createElement(TooltipContainer$2, {
28038
28044
  className: "TooltipContainer",
28039
28045
  top: top,
28040
28046
  left: left
@@ -28154,7 +28160,7 @@ const Heatmap = props => {
28154
28160
  className: "HeatmapWrapper"
28155
28161
  }, /*#__PURE__*/React__default["default"].createElement(TitleContainer, {
28156
28162
  className: "TitleContainer"
28157
- }, /*#__PURE__*/React__default["default"].createElement(Title$4, {
28163
+ }, /*#__PURE__*/React__default["default"].createElement(Title$6, {
28158
28164
  className: "Title"
28159
28165
  }, title)), refreshRequired && renderBars(), !refreshRequired && renderBars(), renderLegend()));
28160
28166
  };
@@ -28568,12 +28574,12 @@ const TooltipLabel$1 = styled__default["default"].div`
28568
28574
  font-weight: 400;
28569
28575
  width: fit-content;
28570
28576
  `;
28571
- const TooltipTitle$2 = styled__default["default"].div`
28577
+ const TooltipTitle$3 = styled__default["default"].div`
28572
28578
  color: #212121;
28573
28579
  font-size: 14px;
28574
28580
  font-weight: 600;
28575
28581
  `;
28576
- const Title$3 = styled__default["default"].h5`
28582
+ const Title$5 = styled__default["default"].h5`
28577
28583
  font-weight: 500;
28578
28584
  font-size: 18px;
28579
28585
  line-height: 20px;
@@ -28650,7 +28656,7 @@ const BarChart = props => {
28650
28656
  if (!active || !payload || payload?.length === 0) return null;
28651
28657
  let currentTooltipValue = 0;
28652
28658
  if (payload[0].payload?.value) currentTooltipValue = payload[0].payload?.value;
28653
- 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)}`));
28659
+ 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)}`));
28654
28660
  };
28655
28661
  const CustomizedTickBarChart = props => {
28656
28662
  const {
@@ -28733,7 +28739,7 @@ const BarChart = props => {
28733
28739
  height: height,
28734
28740
  width: width,
28735
28741
  ref: controlsContainerRef
28736
- }, /*#__PURE__*/React__default["default"].createElement(Controls$3, null, /*#__PURE__*/React__default["default"].createElement(Title$3, null, title), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
28742
+ }, /*#__PURE__*/React__default["default"].createElement(Controls$3, null, /*#__PURE__*/React__default["default"].createElement(Title$5, null, title), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
28737
28743
  width: "100%",
28738
28744
  height: 400
28739
28745
  }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
@@ -28904,7 +28910,7 @@ const Controls$2 = styled__default["default"].div`
28904
28910
  flex-direction: column;
28905
28911
  background-color: white;
28906
28912
  `;
28907
- const Title$2 = styled__default["default"].h5`
28913
+ const Title$4 = styled__default["default"].h5`
28908
28914
  font-size: 18px;
28909
28915
  font-weight: 400;
28910
28916
  margin: 0 0 30px;
@@ -28937,7 +28943,7 @@ const TooltipLabel = styled__default["default"].div`
28937
28943
  font-weight: 400;
28938
28944
  width: fit-content;
28939
28945
  `;
28940
- const TooltipTitle$1 = styled__default["default"].div`
28946
+ const TooltipTitle$2 = styled__default["default"].div`
28941
28947
  color: #212121;
28942
28948
  font-size: 14px;
28943
28949
  font-weight: 600;
@@ -29090,7 +29096,7 @@ const DoubleBarSingleLine = props => {
29090
29096
  } else {
29091
29097
  `${currentTooltipValue.toFixed(1)}`;
29092
29098
  }
29093
- return /*#__PURE__*/React__default["default"].createElement(TooltipDiv, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$1, null, `${label}`), payload.map((item, idx) => {
29099
+ return /*#__PURE__*/React__default["default"].createElement(TooltipDiv, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle$2, null, `${label}`), payload.map((item, idx) => {
29094
29100
  const dataStateItem = dataState.find(state => state.key === item.dataKey);
29095
29101
  return /*#__PURE__*/React__default["default"].createElement(TooltipLabel, {
29096
29102
  key: item.dataKey || idx
@@ -29163,7 +29169,7 @@ const DoubleBarSingleLine = props => {
29163
29169
  noDataText: noDataText
29164
29170
  }) : /*#__PURE__*/React__default["default"].createElement(Controls$2, {
29165
29171
  className: "Controls"
29166
- }, title && title.trim() !== '' && /*#__PURE__*/React__default["default"].createElement(Title$2, null, title), /*#__PURE__*/React__default["default"].createElement(ChartsWrapper, {
29172
+ }, title && title.trim() !== '' && /*#__PURE__*/React__default["default"].createElement(Title$4, null, title), /*#__PURE__*/React__default["default"].createElement(ChartsWrapper, {
29167
29173
  width: hasScroll ? `${data.length * 178}px` : 'auto'
29168
29174
  }, /*#__PURE__*/React__default["default"].createElement(LineChartWrapper, null, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, null, /*#__PURE__*/React__default["default"].createElement(recharts.LineChart, _extends({
29169
29175
  data: transformedData
@@ -29262,7 +29268,7 @@ const CheckboxGroupContainer = styled__default["default"].div`
29262
29268
  height: 21px;
29263
29269
  gap: 20px;
29264
29270
  `;
29265
- const Title$1 = styled__default["default"].h5`
29271
+ const Title$3 = styled__default["default"].h5`
29266
29272
  font-weight: 500;
29267
29273
  font-size: 18px;
29268
29274
  line-height: 20px;
@@ -29282,7 +29288,7 @@ const LegendIcon = styled__default["default"].div`
29282
29288
  margin-right: 5px;
29283
29289
  background-color: ${props => props.color};
29284
29290
  `;
29285
- const TooltipContainer = styled__default["default"].div`
29291
+ const TooltipContainer$1 = styled__default["default"].div`
29286
29292
  background: white;
29287
29293
  padding: 10px;
29288
29294
  border-radius: 5px;
@@ -29292,12 +29298,12 @@ const TooltipContainer = styled__default["default"].div`
29292
29298
  font-weight: 500;
29293
29299
  font-size: 14px;
29294
29300
  `;
29295
- const TooltipTitle = styled__default["default"].p`
29301
+ const TooltipTitle$1 = styled__default["default"].p`
29296
29302
  font-weight: 700;
29297
29303
  margin-top: 5px;
29298
29304
  margin-bottom: 5px;
29299
29305
  `;
29300
- const TooltipText = styled__default["default"].p`
29306
+ const TooltipText$1 = styled__default["default"].p`
29301
29307
  margin-top: 5px;
29302
29308
  margin-bottom: 5px;
29303
29309
  `;
@@ -29538,10 +29544,10 @@ const AreaChart = props => {
29538
29544
  payload
29539
29545
  } = _ref3;
29540
29546
  if (active && payload && payload.length) {
29541
- return /*#__PURE__*/React__default["default"].createElement(TooltipContainer, null, /*#__PURE__*/React__default["default"].createElement(TooltipTitle, null, `${payload[0].payload.label}`), payload.map((data, index) => {
29547
+ 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) => {
29542
29548
  const chart = areaChartsState.find(chart => chart.key === data.dataKey);
29543
29549
  if (chart) {
29544
- return /*#__PURE__*/React__default["default"].createElement(TooltipText, {
29550
+ return /*#__PURE__*/React__default["default"].createElement(TooltipText$1, {
29545
29551
  key: index
29546
29552
  }, `${chart.name}: ${displayFormattedValue(data.value, chart.isDollar)}`);
29547
29553
  }
@@ -29590,7 +29596,7 @@ const AreaChart = props => {
29590
29596
  height: height
29591
29597
  }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(HeaderContainer$2, {
29592
29598
  "data-testid": "header-container"
29593
- }, /*#__PURE__*/React__default["default"].createElement(Title$1, {
29599
+ }, /*#__PURE__*/React__default["default"].createElement(Title$3, {
29594
29600
  "data-testid": "title"
29595
29601
  }, title), /*#__PURE__*/React__default["default"].createElement(CheckboxGroupContainer, {
29596
29602
  "data-testid": "checkbox-group-container"
@@ -30088,7 +30094,7 @@ const HeaderContainer$1 = styled__default["default"].div`
30088
30094
  align-items: center;
30089
30095
  padding-bottom: 8px;
30090
30096
  `;
30091
- const Title = styled__default["default"].h3`
30097
+ const Title$2 = styled__default["default"].h3`
30092
30098
  font-size: 18px;
30093
30099
  font-weight: 400;
30094
30100
  margin: 0;
@@ -30157,7 +30163,7 @@ const BreakdownPanel = props => {
30157
30163
  height: height
30158
30164
  }) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(HeaderContainer$1, {
30159
30165
  "data-testid": "header-container"
30160
- }, /*#__PURE__*/React__default["default"].createElement(Title, {
30166
+ }, /*#__PURE__*/React__default["default"].createElement(Title$2, {
30161
30167
  "data-testid": "title"
30162
30168
  }, title)), /*#__PURE__*/React__default["default"].createElement(CategorySalesMainContainer, {
30163
30169
  "data-testid": "category-sales-main-container"
@@ -31399,42 +31405,29 @@ const BatteryChart = props => {
31399
31405
  }))))))), starText !== "" && /*#__PURE__*/React__default["default"].createElement(StarText, null, starText));
31400
31406
  };
31401
31407
 
31402
- // const originalData = [
31403
- // { label: "Vendor Selling Event: Week 34", inc_sales: 20000, inc_roi: 1.2 },
31404
- // { label: "Vendor Selling Event: Week 36", inc_sales: 10000, inc_roi: 1.2 },
31405
- // { label: "Vendor Selling Event: Week 38", inc_sales: 8000, inc_roi: 0.8 },
31406
- // { label: "Vendor Selling Event: Week 33", inc_sales: 12000, inc_roi: 1.1 },
31407
- // { label: "Vendor Selling Event: Week 29", inc_sales: 8000, inc_roi: 1.2 },
31408
- // { label: "Vendor Selling Event: Week 28", inc_sales: 8000, inc_roi: 0.7 },
31409
- // { label: "Vendor Selling Event: Week 35", inc_sales: 8000, inc_roi: 0.8 },
31410
- // { label: "Vendor Selling Event: Week 30", inc_sales: 9000, inc_roi: 1.1 },
31411
- // ];
31412
-
31413
31408
  const SeparatedLineBarChart = ({
31414
- barlineData
31409
+ barlineData = []
31415
31410
  }) => {
31416
- // Sort the data by week number extracted from the label
31417
- const sortedData = barlineData?.sort((a, b) => {
31418
- const weekA = parseInt(a.label.match(/Week (\d+)/)[1], 10);
31419
- const weekB = parseInt(b.label.match(/Week (\d+)/)[1], 10);
31420
- return weekA - weekB;
31411
+ const [startIndex, setStartIndex] = React$1.useState(0);
31412
+ React$1.useState(6);
31413
+ // Use simple data processing like in the working example
31414
+ const processedData = barlineData.map(item => {
31415
+ return {
31416
+ ...item,
31417
+ // Keep the full label for tooltip and filtering
31418
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31419
+ };
31421
31420
  });
31422
- const dataWithIndex = sortedData.map((item, index) => ({
31423
- ...item,
31424
- index,
31425
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31426
- }));
31427
- const CustomizedTick = ({
31428
- x,
31429
- y,
31430
- payload,
31431
- viewableIndices
31432
- }) => {
31433
- const label = dataWithIndex[payload.value]?.label ?? "";
31421
+
31422
+ // CustomTick component for the X-axis (similar to working example)
31423
+ const CustomizedTick = props => {
31424
+ const {
31425
+ x,
31426
+ y,
31427
+ payload
31428
+ } = props;
31429
+ const label = payload.value;
31434
31430
  const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31435
- if (!viewableIndices.includes(payload.value)) {
31436
- return null;
31437
- }
31438
31431
  return /*#__PURE__*/React__default["default"].createElement("g", {
31439
31432
  transform: `translate(${x},${y})`
31440
31433
  }, /*#__PURE__*/React__default["default"].createElement("text", {
@@ -31444,7 +31437,7 @@ const SeparatedLineBarChart = ({
31444
31437
  textAnchor: "middle",
31445
31438
  fill: "#212121",
31446
31439
  fontSize: 11,
31447
- fontWeight: "400",
31440
+ fontWeight: 400,
31448
31441
  fontFamily: "Poppins"
31449
31442
  }, /*#__PURE__*/React__default["default"].createElement("tspan", {
31450
31443
  x: 0,
@@ -31454,51 +31447,57 @@ const SeparatedLineBarChart = ({
31454
31447
  dy: 18
31455
31448
  }, "Event: ", parts.join(" "))));
31456
31449
  };
31457
- const CustomLabelListFilter = props => {
31458
- const {
31459
- viewableIndices,
31460
- dataKey,
31461
- position,
31462
- formatter,
31463
- fill,
31464
- fontSize,
31465
- fontWeight,
31466
- fontFamily
31467
- } = props;
31468
- return /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31469
- dataKey: dataKey,
31470
- position: position,
31471
- formatter: (value, name, props) => {
31472
- if (!viewableIndices.includes(props.index)) {
31473
- return "";
31474
- }
31475
- return formatter ? formatter(value) : value;
31476
- },
31477
- fill: fill || "#212121",
31478
- fontSize: fontSize || 12,
31479
- fontWeight: fontWeight || "400",
31480
- fontFamily: fontFamily || "Poppins"
31481
- });
31450
+
31451
+ // Custom tooltip (similar to the working example)
31452
+ const CustomTooltip = ({
31453
+ active,
31454
+ payload,
31455
+ label
31456
+ }) => {
31457
+ if (!active || !payload || !payload.length) return null;
31458
+
31459
+ // Find the data item based on index
31460
+ const data = payload[0]?.payload;
31461
+ if (!data) return null;
31462
+ return /*#__PURE__*/React__default["default"].createElement("div", {
31463
+ style: {
31464
+ backgroundColor: "white",
31465
+ padding: "10px",
31466
+ border: "1px solid #ccc",
31467
+ borderRadius: "4px",
31468
+ fontFamily: "Poppins"
31469
+ }
31470
+ }, /*#__PURE__*/React__default["default"].createElement("p", {
31471
+ style: {
31472
+ margin: "0 0 5px",
31473
+ fontWeight: "bold"
31474
+ }
31475
+ }, "EVENT_NAME.DIM_EVENTS: ", data.label), /*#__PURE__*/React__default["default"].createElement("p", {
31476
+ style: {
31477
+ margin: "0 0 5px"
31478
+ }
31479
+ }, "EVENT_DESCRIPTION.DIM_EVENTS: ", data.description || "N/A"), /*#__PURE__*/React__default["default"].createElement("p", {
31480
+ style: {
31481
+ margin: "0 0 5px"
31482
+ }
31483
+ }, "INC Sales: ", data.inc_sales?.toLocaleString()), /*#__PURE__*/React__default["default"].createElement("p", {
31484
+ style: {
31485
+ margin: "0"
31486
+ }
31487
+ }, "INC Sales ROI: ", data.inc_roi?.toFixed(1)));
31482
31488
  };
31489
+
31490
+ // Chart margins (same as in both examples)
31483
31491
  const chartMargins = {
31484
- top: 15,
31485
- right: 40,
31492
+ top: 30,
31493
+ right: 30,
31486
31494
  left: 20,
31487
- bottom: 40
31495
+ bottom: 60
31488
31496
  };
31489
- const [viewWindow, setViewWindow] = React$1.useState({
31490
- startIndex: 0,
31491
- endIndex: dataWithIndex.length - 1
31492
- });
31493
- const viewableIndices = [];
31494
- for (let i = viewWindow.startIndex; i <= viewWindow.endIndex; i++) {
31495
- viewableIndices.push(i);
31496
- }
31497
- dataWithIndex.filter(item => viewableIndices.includes(item.index));
31498
31497
  return /*#__PURE__*/React__default["default"].createElement("div", {
31499
31498
  style: {
31500
31499
  width: "100%",
31501
- height: 700
31500
+ height: "700px"
31502
31501
  }
31503
31502
  }, /*#__PURE__*/React__default["default"].createElement("div", {
31504
31503
  style: {
@@ -31508,24 +31507,21 @@ const SeparatedLineBarChart = ({
31508
31507
  width: "100%",
31509
31508
  height: "100%"
31510
31509
  }, /*#__PURE__*/React__default["default"].createElement(recharts.LineChart, {
31511
- data: dataWithIndex,
31510
+ data: processedData,
31512
31511
  margin: chartMargins
31513
31512
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
31514
31513
  strokeDasharray: "3 3",
31515
31514
  vertical: false
31516
31515
  }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
31517
- dataKey: "index",
31518
- type: "number",
31519
- domain: ['dataMin', 'dataMax'],
31520
- padding: {
31521
- left: 20,
31522
- right: 20
31523
- },
31516
+ dataKey: "label",
31517
+ tick: false,
31524
31518
  hide: true
31525
31519
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
31526
31520
  domain: [0, 2],
31527
31521
  hide: true
31528
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Line, {
31522
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
31523
+ content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
31524
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Line, {
31529
31525
  type: "monotone",
31530
31526
  dataKey: "inc_roi",
31531
31527
  stroke: "#F8CD00",
@@ -31536,11 +31532,14 @@ const SeparatedLineBarChart = ({
31536
31532
  },
31537
31533
  activeDot: false,
31538
31534
  name: "INC Sales ROI"
31539
- }, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
31535
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31540
31536
  dataKey: "inc_roi",
31541
31537
  position: "top",
31542
31538
  formatter: value => value.toFixed(1),
31543
- viewableIndices: viewableIndices
31539
+ fill: "#212121",
31540
+ fontSize: 12,
31541
+ fontWeight: "400",
31542
+ fontFamily: "Poppins"
31544
31543
  }))))), /*#__PURE__*/React__default["default"].createElement("div", {
31545
31544
  style: {
31546
31545
  height: "60%"
@@ -31549,59 +31548,48 @@ const SeparatedLineBarChart = ({
31549
31548
  width: "100%",
31550
31549
  height: "100%"
31551
31550
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ComposedChart, {
31552
- data: dataWithIndex,
31551
+ data: processedData,
31553
31552
  margin: chartMargins
31554
31553
  }, /*#__PURE__*/React__default["default"].createElement(recharts.CartesianGrid, {
31555
31554
  strokeDasharray: "3 3",
31556
31555
  vertical: false
31557
31556
  }), /*#__PURE__*/React__default["default"].createElement(recharts.XAxis, {
31558
- dataKey: "index",
31559
- type: "number",
31560
- domain: ['dataMin', 'dataMax'],
31561
- padding: {
31562
- left: 20,
31563
- right: 20
31564
- },
31565
- tick: props => /*#__PURE__*/React__default["default"].createElement(CustomizedTick, _extends({}, props, {
31566
- viewableIndices: viewableIndices
31567
- })),
31557
+ dataKey: "label",
31558
+ tick: /*#__PURE__*/React__default["default"].createElement(CustomizedTick, null),
31568
31559
  interval: 0,
31569
31560
  height: 60,
31570
- tickLine: false,
31571
- ticks: dataWithIndex.map(item => item.index)
31561
+ tickLine: false
31572
31562
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
31573
31563
  tickFormatter: v => `${v / 1000}k`,
31574
31564
  hide: true
31575
- }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, null), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31565
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
31566
+ content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
31567
+ }), /*#__PURE__*/React__default["default"].createElement(recharts.Bar, {
31576
31568
  dataKey: "inc_sales",
31577
31569
  fill: "#CCDCDD",
31578
- gap: "4px",
31570
+ gap: 4,
31579
31571
  borderRadius: [4, 4, 0, 8],
31580
31572
  barSize: 40,
31581
31573
  name: "INC Sales"
31582
- }, /*#__PURE__*/React__default["default"].createElement(CustomLabelListFilter, {
31574
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.LabelList, {
31583
31575
  dataKey: "inc_sales",
31584
31576
  position: "top",
31585
31577
  formatter: value => `${value / 1000}k`,
31586
- viewableIndices: viewableIndices
31578
+ fill: "#212121",
31579
+ fontSize: 12,
31580
+ fontWeight: "400",
31581
+ fontFamily: "Poppins"
31587
31582
  })), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
31588
- dataKey: "index",
31583
+ dataKey: "label",
31589
31584
  height: 30,
31590
31585
  stroke: "#212121",
31591
- startIndex: viewWindow.startIndex,
31592
- endIndex: viewWindow.endIndex,
31593
- onChange: e => {
31594
- setViewWindow({
31595
- startIndex: e.startIndex ?? 0,
31596
- endIndex: e.endIndex ?? dataWithIndex.length - 1
31597
- });
31598
- },
31599
- travellerWidth: 12
31600
- })), /*#__PURE__*/React__default["default"].createElement("div", {
31601
- style: {
31602
- marginTop: "-28px"
31603
- }
31604
- }, /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
31586
+ startIndex: startIndex,
31587
+ endIndex: Math.min(4, processedData.length - 1),
31588
+ onChange: onChange,
31589
+ y: 330,
31590
+ travellerWidth: 10,
31591
+ tickFormatter: (value, index) => index + 1
31592
+ })), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
31605
31593
  legendData: [{
31606
31594
  iconColor: "#CCDCDD",
31607
31595
  iconType: "Square",
@@ -31615,7 +31603,9 @@ const SeparatedLineBarChart = ({
31615
31603
  };
31616
31604
 
31617
31605
  function SingleChart({
31618
- lineChartData
31606
+ lineChartData,
31607
+ height = 450,
31608
+ width = "100%"
31619
31609
  }) {
31620
31610
  const dataWithIndex = lineChartData?.map((item, index) => ({
31621
31611
  ...item,
@@ -31648,20 +31638,15 @@ function SingleChart({
31648
31638
  dy: 18
31649
31639
  }, "Event: ", parts.join(" "))));
31650
31640
  };
31651
- const [startIndex, setStartIndex] = React$1.useState(0);
31652
- const [endIndex, setEndIndex] = React$1.useState(dataWithIndex?.length - 1);
31641
+ React$1.useState(0);
31642
+ React$1.useState(dataWithIndex?.length - 1);
31653
31643
  return /*#__PURE__*/React__default["default"].createElement("div", {
31654
31644
  style: {
31655
- width: "100%",
31656
- height: 600
31657
- }
31658
- }, /*#__PURE__*/React__default["default"].createElement("div", {
31659
- style: {
31660
- height: "100%"
31645
+ width: "100%"
31661
31646
  }
31662
31647
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
31663
- width: "100%",
31664
- height: "100%"
31648
+ width: width,
31649
+ height: height
31665
31650
  }, /*#__PURE__*/React__default["default"].createElement(recharts.ComposedChart, {
31666
31651
  data: dataWithIndex,
31667
31652
  margin: {
@@ -31702,23 +31687,18 @@ function SingleChart({
31702
31687
  fontWeight: "400",
31703
31688
  fontFamily: "Poppins"
31704
31689
  })), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
31705
- dataKey: "index",
31706
31690
  height: 30,
31707
- stroke: "#212121",
31708
- startIndex: startIndex,
31709
- endIndex: endIndex,
31710
- onChange: e => {
31711
- setStartIndex(e.startIndex ?? 0);
31712
- setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
31713
- },
31714
- travellerWidth: 12
31691
+ travellerWidth: 10,
31692
+ startIndex: 0,
31693
+ endIndex: 5,
31694
+ y: 380
31715
31695
  })), /*#__PURE__*/React__default["default"].createElement(PerformanceAnalyticsLegend, {
31716
31696
  legendData: [{
31717
31697
  iconColor: "#CCDCDD",
31718
31698
  iconType: "Square",
31719
31699
  title: "INC Units"
31720
31700
  }]
31721
- }))));
31701
+ })));
31722
31702
  }
31723
31703
 
31724
31704
  styled__default["default"].div`
@@ -31948,6 +31928,65 @@ SegmentedButton.defaultProps = {
31948
31928
  onClick: () => {}
31949
31929
  };
31950
31930
 
31931
+ const Container = styled__default["default"].div`
31932
+ width: ${props => props.width};
31933
+ height: ${props => props.height};
31934
+ padding: 15px;
31935
+ display: flex;
31936
+ flex-direction: column;
31937
+ #Segment {
31938
+ width: auto;
31939
+ white-space: nowrap;
31940
+ font-size: 14px;
31941
+ font-weight: 500;
31942
+ font-family: "Poppins"
31943
+ }
31944
+ `;
31945
+ const Title$1 = styled__default["default"].h2`
31946
+ color: #212121;
31947
+ font-family: "Poppins";
31948
+ font-size: 18px;
31949
+ font-style: normal;
31950
+ font-weight: 400;
31951
+ line-height: normal;
31952
+ margin: 0 0 16px 0;
31953
+ `;
31954
+ styled__default["default"].div`
31955
+ font-family: sans-serif;
31956
+ text-align: center;
31957
+ `;
31958
+ styled__default["default"].div`
31959
+ height: 25%;
31960
+ `;
31961
+ styled__default["default"].div`
31962
+ height: 75%;
31963
+ `;
31964
+ styled__default["default"].div`
31965
+ height: 100%;
31966
+ display: flex;
31967
+ flex-direction: column;
31968
+ background-color: white;
31969
+ `;
31970
+ const TooltipContainer = styled__default["default"].div`
31971
+ background: white;
31972
+ padding: 10px;
31973
+ border-radius: 5px;
31974
+ box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
31975
+ border: 1px solid #ddd;
31976
+ font-family: Poppins, sans-serif;
31977
+ font-weight: 500;
31978
+ font-size: 14px;
31979
+ `;
31980
+ const TooltipTitle = styled__default["default"].p`
31981
+ font-weight: 700;
31982
+ margin-top: 5px;
31983
+ margin-bottom: 5px;
31984
+ `;
31985
+ const TooltipText = styled__default["default"].p`
31986
+ margin-top: 5px;
31987
+ margin-bottom: 5px;
31988
+ `;
31989
+
31951
31990
  function InnerBarChart({
31952
31991
  data
31953
31992
  }) {
@@ -32012,9 +32051,8 @@ function InnerBarChart({
32012
32051
  }) => {
32013
32052
  if (!active || !payload || !payload.length) return null;
32014
32053
  const data = payload[0].payload;
32015
- return /*#__PURE__*/React__default["default"].createElement("div", {
32016
- className: "bg-white border border-gray-300 p-2 rounded-lg text-sm"
32017
- }, /*#__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)));
32054
+ const repeaterPercentage = (data.actual / data.total * 100).toFixed(1);
32055
+ 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: ${format(data.total)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `Repeaters: ${format(data.actual)}`), /*#__PURE__*/React__default["default"].createElement(TooltipText, null, `% Repeaters: ${repeaterPercentage}%`));
32018
32056
  };
32019
32057
  const CustomizedTick = props => {
32020
32058
  const {
@@ -32046,9 +32084,7 @@ function InnerBarChart({
32046
32084
  };
32047
32085
  return /*#__PURE__*/React__default["default"].createElement("div", {
32048
32086
  className: "w-full"
32049
- }, /*#__PURE__*/React__default["default"].createElement("h3", {
32050
- className: "text-lg font-medium mb-4 text-center"
32051
- }, "Vendor Selling Events Comparison"), /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
32087
+ }, /*#__PURE__*/React__default["default"].createElement(recharts.ResponsiveContainer, {
32052
32088
  width: "100%",
32053
32089
  height: 450
32054
32090
  }, /*#__PURE__*/React__default["default"].createElement(recharts.BarChart, {
@@ -32070,7 +32106,8 @@ function InnerBarChart({
32070
32106
  }), /*#__PURE__*/React__default["default"].createElement(recharts.YAxis, {
32071
32107
  type: "number",
32072
32108
  domain: [0, "dataMax + 2000"],
32073
- tickFormatter: format
32109
+ tickFormatter: format,
32110
+ hide: true
32074
32111
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Tooltip, {
32075
32112
  content: /*#__PURE__*/React__default["default"].createElement(CustomTooltip, null)
32076
32113
  }), /*#__PURE__*/React__default["default"].createElement(recharts.Brush, {
@@ -32086,51 +32123,22 @@ function InnerBarChart({
32086
32123
  }))));
32087
32124
  }
32088
32125
 
32089
- const Container = styled__default["default"].div`
32090
- width: ${props => props.width};
32091
- height: ${props => props.height};
32092
- padding: 15px;
32093
- display: flex;
32094
- flex-direction: column;
32095
- #Segment {
32096
- width: auto;
32097
- white-space: nowrap;
32098
- font-size: 14px;
32099
- font-weight: 500;
32100
- font-family: "Poppins"
32101
- }
32102
- `;
32103
- styled__default["default"].div`
32104
- font-family: sans-serif;
32105
- text-align: center;
32106
- `;
32107
- styled__default["default"].div`
32108
- height: 25%;
32109
- `;
32110
- styled__default["default"].div`
32111
- height: 75%;
32112
- `;
32113
- styled__default["default"].div`
32114
- height: 100%;
32115
- display: flex;
32116
- flex-direction: column;
32117
- background-color: white;
32118
- `;
32119
-
32120
32126
  const BrushChart = props => {
32121
32127
  const {
32122
32128
  width,
32123
32129
  height,
32124
32130
  data,
32125
32131
  barlineData,
32126
- lineChartData
32132
+ lineChartData,
32133
+ linearData,
32134
+ title
32127
32135
  } = props;
32128
32136
  const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
32129
32137
  const [selectedOption, setSelectedOption] = React$1.useState(segmentedbuttonOptions[0]);
32130
32138
  return /*#__PURE__*/React__default["default"].createElement(Container, {
32131
32139
  height: height,
32132
32140
  width: width
32133
- }, /*#__PURE__*/React__default["default"].createElement(SegmentedButton, {
32141
+ }, /*#__PURE__*/React__default["default"].createElement(Title$1, null, title), /*#__PURE__*/React__default["default"].createElement(SegmentedButton, {
32134
32142
  gap: "8px",
32135
32143
  options: segmentedbuttonOptions.map(value => ({
32136
32144
  value
@@ -32148,10 +32156,302 @@ const BrushChart = props => {
32148
32156
  }), selectedOption === "INC Units" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32149
32157
  lineChartData: lineChartData
32150
32158
  }), selectedOption === "Basket Lift" && /*#__PURE__*/React__default["default"].createElement(SingleChart, {
32151
- lineChartData: lineChartData
32159
+ lineChartData: linearData
32152
32160
  }));
32153
32161
  };
32154
32162
 
32163
+ const Overlay = styled__default["default"].div`
32164
+ position: fixed;
32165
+ top: 0;
32166
+ left: 0;
32167
+ width: 100%;
32168
+ height: 100%;
32169
+ background: rgba(0, 0, 0, 0.5);
32170
+ display: flex;
32171
+ justify-content: center;
32172
+ align-items: center;
32173
+ z-index: 999;
32174
+ `;
32175
+ const ModalContent = styled__default["default"].div`
32176
+ position: absolute;
32177
+ width: 69%;
32178
+ height: 100%;
32179
+ padding: 8rem 0 4rem;
32180
+ box-sizing: border-box;
32181
+ margin: 0 auto;
32182
+ font-family: 'Poppins', sans-serif;
32183
+
32184
+ @media (max-width: 768px) {
32185
+ width: 100%;
32186
+ max-width: 940px;
32187
+ padding: 1rem 0 3rem;
32188
+ }
32189
+ `;
32190
+ const Header = styled__default["default"].div`
32191
+ position: relative;
32192
+ display: flex;
32193
+ justify-content: space-between;
32194
+ align-items: center;
32195
+ margin-bottom: 4rem;
32196
+
32197
+ @media (max-width: 768px) {
32198
+ flex-direction: column;
32199
+ gap: 1rem;
32200
+ align-items: flex-start;
32201
+ }
32202
+ `;
32203
+ const CloseButton = styled__default["default"].button`
32204
+ position: absolute;
32205
+ top: -10px;
32206
+ right: 0px;
32207
+ background: transparent;
32208
+ border: none;
32209
+ color: ${props => props.$navcolor || "#fff"};
32210
+ font-size: 1.5rem;
32211
+ cursor: pointer;
32212
+
32213
+ &:hover {
32214
+ opacity: 0.8;
32215
+ }
32216
+
32217
+ @media (max-width: 768px) {
32218
+ position: static;
32219
+ align-self: flex-end;
32220
+ }
32221
+ `;
32222
+ const Title = styled__default["default"].h2`
32223
+ position: absolute;
32224
+ display: flex;
32225
+ align-items: center;
32226
+ gap: 0.5rem;
32227
+ top: -10px;
32228
+ color: ${props => props.$titleColor || "#fff"};
32229
+ font-size: 1.25rem;
32230
+ margin: 0;
32231
+ font-feature-settings: "liga" off;
32232
+ font-family: 'Poppins', sans-serif;
32233
+ font-size: 23.528px;
32234
+ font-style: normal;
32235
+ font-weight: 700;
32236
+ line-height: normal;
32237
+
32238
+ @media (max-width: 768px) {
32239
+ position: static;
32240
+ align-self: flex-start;
32241
+ }
32242
+ `;
32243
+ styled__default["default"].span`
32244
+ font-size: 1.5rem;
32245
+ margin-right: 0.5rem;
32246
+ color: ${props => props.$iconcolor || "#fff"};
32247
+ `;
32248
+ const CarouselContainer = styled__default["default"].div`
32249
+ position: relative;
32250
+ width: 100%;
32251
+ height: 75%;
32252
+ overflow: visible;
32253
+ margin: 0 auto;
32254
+ `;
32255
+ const VisibleCardsContainer = styled__default["default"].div`
32256
+ display: flex;
32257
+ justify-content: center;
32258
+ align-items: center;
32259
+ width: 100%;
32260
+ height: 100%;
32261
+ position: relative;
32262
+
32263
+ .prev-card,
32264
+ .next-card {
32265
+ opacity: 0.3;
32266
+ }
32267
+
32268
+ .prev-card {
32269
+ transform: translateX(-50%) scale(0.75);
32270
+ opacity: 0.3;
32271
+ }
32272
+
32273
+ .active-card {
32274
+ transform: translateX(0) scale(1);
32275
+ opacity: 1;
32276
+ z-index: 2;
32277
+ }
32278
+
32279
+ .next-card {
32280
+ transform: translateX(50%) scale(0.75);
32281
+ opacity: 0.3;
32282
+ }
32283
+
32284
+ .hidden-card {
32285
+ display: none;
32286
+ }
32287
+ `;
32288
+ const Card = styled__default["default"].div`
32289
+ position: absolute;
32290
+ width: 41%;
32291
+ height: 90%;
32292
+ background: #ffffff;
32293
+ border-radius: 16px;
32294
+ padding: 2rem;
32295
+ text-align: center;
32296
+ display: flex;
32297
+ flex-direction: column;
32298
+ align-items: center;
32299
+ justify-content: center;
32300
+ box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.05);
32301
+
32302
+ /* 🎯 תיקון: טרנזישן אחיד לכל שינויי תזוזה/שקיפות */
32303
+ transition: transform 0.4s ease-in-out, left 0.4s ease-in-out,
32304
+ right 0.4s ease-in-out, opacity 0.4s ease-in-out;
32305
+
32306
+ @media (max-width: 768px) {
32307
+ width: 280px;
32308
+ height: 250px;
32309
+ padding: 1.5rem;
32310
+ }
32311
+ `;
32312
+ const NavButton = styled__default["default"].div`
32313
+ position: absolute;
32314
+ top: 50%;
32315
+ transform: translateY(-50%);
32316
+ z-index: 1000;
32317
+ color: ${props => props.$navcolor || "#fff"};
32318
+ font-size: 2.5rem;
32319
+ cursor: pointer;
32320
+ user-select: none;
32321
+ width: 40px;
32322
+ height: 40px;
32323
+ display: flex;
32324
+ align-items: center;
32325
+ justify-content: center;
32326
+
32327
+ &.prev {
32328
+ left: 0;
32329
+ }
32330
+
32331
+ &.next {
32332
+ right: 0;
32333
+ }
32334
+
32335
+ &:hover {
32336
+ opacity: 0.8;
32337
+ }
32338
+ `;
32339
+ const Pagination = styled__default["default"].div`
32340
+ display: flex;
32341
+ justify-content: center;
32342
+ margin-top: 32px;
32343
+ position: relative;
32344
+ `;
32345
+ const Dot = styled__default["default"].button`
32346
+ width: 20px;
32347
+ height: 20px;
32348
+ border-radius: 50%;
32349
+ border: 2px solid #fff;
32350
+ background: transparent;
32351
+ opacity: 1;
32352
+ margin: 4px;
32353
+ cursor: pointer;
32354
+ transition: background 0.3s ease;
32355
+ padding: 0;
32356
+ position: relative;
32357
+
32358
+ &::after {
32359
+ content: "";
32360
+ position: absolute;
32361
+ top: 2px;
32362
+ left: 2px;
32363
+ width: 12px;
32364
+ height: 12px;
32365
+ background: ${props => props.active ? "#fff" : "transparent"};
32366
+ border-radius: 50%;
32367
+ }
32368
+
32369
+ &:focus {
32370
+ outline: none;
32371
+ }
32372
+ `;
32373
+
32374
+ const InsightsCarousel = _ref => {
32375
+ let {
32376
+ children,
32377
+ onClose,
32378
+ title = "Insights:",
32379
+ icon = /*#__PURE__*/React__default["default"].createElement(LampIcon, null),
32380
+ titleColor = "#fff",
32381
+ iconColor = "#fff",
32382
+ navColor = "#fff"
32383
+ } = _ref;
32384
+ const [currentIndex, setCurrentIndex] = React$1.useState(0);
32385
+ const containerRef = React$1.useRef(null);
32386
+ const childrenArray = React__default["default"].Children.toArray(children);
32387
+ const totalChildren = childrenArray.length;
32388
+ const goToSlide = index => {
32389
+ let normalizedIndex = index;
32390
+ if (index < 0) normalizedIndex = totalChildren - 1;
32391
+ if (index >= totalChildren) normalizedIndex = 0;
32392
+ setCurrentIndex(normalizedIndex);
32393
+ };
32394
+ const goToPrev = () => {
32395
+ goToSlide(currentIndex - 1);
32396
+ };
32397
+ const goToNext = () => {
32398
+ goToSlide(currentIndex + 1);
32399
+ };
32400
+ const prevIndex = (currentIndex - 1 + totalChildren) % totalChildren;
32401
+ const nextIndex = (currentIndex + 1) % totalChildren;
32402
+ return /*#__PURE__*/React__default["default"].createElement(Overlay, null, /*#__PURE__*/React__default["default"].createElement(ModalContent, null, /*#__PURE__*/React__default["default"].createElement(Header, null, /*#__PURE__*/React__default["default"].createElement(Title, {
32403
+ $titleColor: titleColor
32404
+ }, /*#__PURE__*/React__default["default"].cloneElement(icon, {
32405
+ fill: iconColor
32406
+ }), title), /*#__PURE__*/React__default["default"].createElement(CloseButton, {
32407
+ onClick: () => onClose?.({
32408
+ label: "closeCrusel"
32409
+ }),
32410
+ "aria-label": "Close insights overlay",
32411
+ $navColor: navColor
32412
+ }, /*#__PURE__*/React__default["default"].createElement(CloseXIcon, {
32413
+ fill: navColor,
32414
+ width: 18.82,
32415
+ height: 18.82
32416
+ }))), /*#__PURE__*/React__default["default"].createElement(CarouselContainer, {
32417
+ ref: containerRef
32418
+ }, totalChildren > 1 && /*#__PURE__*/React__default["default"].createElement(NavButton, {
32419
+ className: "prev",
32420
+ onClick: goToPrev,
32421
+ $navColor: navColor
32422
+ }, /*#__PURE__*/React__default["default"].createElement(ChervronLeftIcon, {
32423
+ fill: navColor,
32424
+ width: 41,
32425
+ height: 42
32426
+ })), /*#__PURE__*/React__default["default"].createElement(VisibleCardsContainer, null, childrenArray.map((child, index) => {
32427
+ let className = "hidden-card";
32428
+ if (totalChildren === 1) {
32429
+ className = "active-card";
32430
+ } else {
32431
+ if (index === prevIndex) className = "prev-card";
32432
+ if (index === currentIndex) className = "active-card";
32433
+ if (index === nextIndex) className = "next-card";
32434
+ }
32435
+ return /*#__PURE__*/React__default["default"].createElement(Card, {
32436
+ key: index,
32437
+ className: className
32438
+ }, child);
32439
+ })), totalChildren > 1 && /*#__PURE__*/React__default["default"].createElement(NavButton, {
32440
+ className: "next",
32441
+ onClick: goToNext,
32442
+ $navColor: navColor
32443
+ }, /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
32444
+ fill: navColor,
32445
+ width: 41,
32446
+ height: 42
32447
+ }))), /*#__PURE__*/React__default["default"].createElement(Pagination, null, childrenArray.map((_, index) => /*#__PURE__*/React__default["default"].createElement(Dot, {
32448
+ key: index,
32449
+ active: index === currentIndex,
32450
+ onClick: () => goToSlide(index),
32451
+ "aria-label": `Go to slide ${index + 1}`
32452
+ })))));
32453
+ };
32454
+
32155
32455
  exports.AreaChart = AreaChart;
32156
32456
  exports.BannerEventBoxList = BannerEventBoxList;
32157
32457
  exports.BarChart = BarChart;
@@ -32170,6 +32470,7 @@ exports.EventList = EventList;
32170
32470
  exports.FilterPanel = FilterPanel;
32171
32471
  exports.Heatmap = Heatmap;
32172
32472
  exports.IconButton = IconButton;
32473
+ exports.InsightsCarousel = InsightsCarousel;
32173
32474
  exports.LinkButton = LinkButton;
32174
32475
  exports.LinnerDataBox = LinnerDataBox;
32175
32476
  exports.MarketShareDescription = MarketShareDescription;