sag_components 2.0.0-beta53 → 2.0.0-beta56

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
@@ -9484,70 +9484,67 @@ const DropdownMain = styled.div`
9484
9484
  `;
9485
9485
 
9486
9486
  /* eslint-disable react/prop-types */
9487
- const DropdownNew = _ref => {
9488
- let {
9489
- isMulti,
9490
- label,
9491
- labelEmptyValue,
9492
- options,
9493
- selectedValue,
9494
- placeHolder,
9495
- onChange,
9496
- required,
9497
- disabled,
9498
- width,
9499
- error,
9500
- errorMessage,
9501
- labelColor,
9502
- checkBoxColor,
9503
- xIconShow,
9504
- showLabelOnTop,
9505
- orderBy,
9506
- elementType
9507
- } = _ref;
9508
- return /*#__PURE__*/React$1.createElement(DropdownMain, {
9509
- className: "DropdownMain",
9510
- width: width
9511
- }, isMulti ? /*#__PURE__*/React$1.createElement(DropdownMultiNew, {
9512
- className: "DropdownMultiNew",
9513
- placeHolder: placeHolder,
9514
- label: label,
9515
- labelEmptyValue: labelEmptyValue,
9516
- labelColor: labelColor,
9517
- checkBoxColor: checkBoxColor,
9518
- required: required,
9519
- options: options,
9520
- width: width,
9521
- disabled: disabled,
9522
- error: error,
9523
- errorMessage: errorMessage,
9524
- selectedValue: selectedValue,
9525
- xIconShow: xIconShow,
9526
- onChange: onChange,
9527
- showLabelOnTop: showLabelOnTop,
9528
- orderBy: orderBy,
9529
- elementType: elementType
9530
- }) : /*#__PURE__*/React$1.createElement(DropdownSingleNew, {
9531
- className: "DropdownSingleNew",
9532
- placeHolder: placeHolder,
9533
- label: label,
9534
- labelEmptyValue: labelEmptyValue,
9535
- labelColor: labelColor,
9536
- checkBoxColor: checkBoxColor,
9537
- required: required,
9538
- options: options,
9539
- width: width,
9540
- disabled: disabled,
9541
- error: error,
9542
- errorMessage: errorMessage,
9543
- selectedValue: selectedValue,
9544
- xIconShow: xIconShow,
9545
- onChange: onChange,
9546
- showLabelOnTop: showLabelOnTop,
9547
- orderBy: orderBy,
9548
- elementType: elementType
9549
- }));
9550
- };
9487
+ const DropdownNew = ({
9488
+ isMulti,
9489
+ label,
9490
+ labelEmptyValue,
9491
+ options,
9492
+ selectedValue,
9493
+ placeHolder,
9494
+ onChange,
9495
+ required,
9496
+ disabled,
9497
+ width,
9498
+ error,
9499
+ errorMessage,
9500
+ labelColor,
9501
+ checkBoxColor,
9502
+ xIconShow,
9503
+ showLabelOnTop,
9504
+ orderBy,
9505
+ elementType
9506
+ }) => /*#__PURE__*/React$1.createElement(DropdownMain, {
9507
+ className: "DropdownMain",
9508
+ width: width
9509
+ }, isMulti ? /*#__PURE__*/React$1.createElement(DropdownMultiNew, {
9510
+ className: "DropdownMultiNew",
9511
+ placeHolder: placeHolder,
9512
+ label: label,
9513
+ labelEmptyValue: labelEmptyValue,
9514
+ labelColor: labelColor,
9515
+ checkBoxColor: checkBoxColor,
9516
+ required: required,
9517
+ options: options,
9518
+ width: width,
9519
+ disabled: disabled,
9520
+ error: error,
9521
+ errorMessage: errorMessage,
9522
+ selectedValue: selectedValue,
9523
+ xIconShow: xIconShow,
9524
+ onChange: onChange,
9525
+ showLabelOnTop: showLabelOnTop,
9526
+ orderBy: orderBy,
9527
+ elementType: elementType
9528
+ }) : /*#__PURE__*/React$1.createElement(DropdownSingleNew, {
9529
+ className: "DropdownSingleNew",
9530
+ placeHolder: placeHolder,
9531
+ label: label,
9532
+ labelEmptyValue: labelEmptyValue,
9533
+ labelColor: labelColor,
9534
+ checkBoxColor: checkBoxColor,
9535
+ required: required,
9536
+ options: options,
9537
+ width: width,
9538
+ disabled: disabled,
9539
+ error: error,
9540
+ errorMessage: errorMessage,
9541
+ selectedValue: selectedValue,
9542
+ xIconShow: xIconShow,
9543
+ onChange: onChange,
9544
+ showLabelOnTop: showLabelOnTop,
9545
+ orderBy: orderBy,
9546
+ elementType: elementType
9547
+ }));
9551
9548
  DropdownNew.propTypes = {
9552
9549
  placeHolder: PropTypes.string,
9553
9550
  label: PropTypes.string,
@@ -9720,26 +9717,34 @@ const OptionsContainer$4 = styled.div`
9720
9717
  padding-top: 8px;
9721
9718
  `;
9722
9719
 
9723
- const ChervronRightIcon = () => /*#__PURE__*/React$1.createElement("svg", {
9724
- width: "8",
9725
- height: "13",
9720
+ const ChervronRightIcon = ({
9721
+ width = "8",
9722
+ height = "13",
9723
+ fill = "#777575"
9724
+ }) => /*#__PURE__*/React$1.createElement("svg", {
9725
+ width: width,
9726
+ height: height,
9726
9727
  viewBox: "0 0 8 13",
9727
9728
  fill: "none",
9728
9729
  xmlns: "http://www.w3.org/2000/svg"
9729
9730
  }, /*#__PURE__*/React$1.createElement("path", {
9730
9731
  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",
9731
- fill: "#777575"
9732
+ fill: fill
9732
9733
  }));
9733
9734
 
9734
- const ChervronLeftIcon = () => /*#__PURE__*/React$1.createElement("svg", {
9735
- width: "7",
9736
- height: "13",
9735
+ const ChervronLeftIcon = ({
9736
+ width = 7,
9737
+ height = 13,
9738
+ fill = "#777575"
9739
+ }) => /*#__PURE__*/React$1.createElement("svg", {
9740
+ width: width,
9741
+ height: height,
9737
9742
  viewBox: "0 0 7 13",
9738
9743
  fill: "none",
9739
9744
  xmlns: "http://www.w3.org/2000/svg"
9740
9745
  }, /*#__PURE__*/React$1.createElement("path", {
9741
9746
  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",
9742
- fill: "#777575"
9747
+ fill: fill
9743
9748
  }));
9744
9749
 
9745
9750
  /* eslint-disable react/prop-types */
@@ -9961,21 +9966,20 @@ const DatePicker = ({
9961
9966
  };
9962
9967
 
9963
9968
  /* eslint-disable import/no-extraneous-dependencies */
9964
- const RangePicker = _ref => {
9965
- let {
9966
- label,
9967
- onChange,
9968
- borderRadius,
9969
- required,
9970
- width,
9971
- height,
9972
- placeholder,
9973
- disabled,
9974
- borderColor,
9975
- borderColorFocus,
9976
- textColor,
9977
- selectedValue
9978
- } = _ref;
9969
+ const RangePicker = ({
9970
+ label,
9971
+ onChange,
9972
+ borderRadius,
9973
+ required,
9974
+ width,
9975
+ height,
9976
+ placeholder,
9977
+ disabled,
9978
+ borderColor,
9979
+ borderColorFocus,
9980
+ textColor,
9981
+ selectedValue
9982
+ }) => {
9979
9983
  const [isFocused, setIsFocused] = useState(false);
9980
9984
  const [isOpen, setIsOpen] = useState(false);
9981
9985
  const [value, setValue] = useState(''); // Added value state
@@ -10037,6 +10041,7 @@ const RangePicker = _ref => {
10037
10041
  setValue(e.target.value);
10038
10042
  };
10039
10043
  const toggleDatePicker = () => {
10044
+ if (disabled) return;
10040
10045
  setIsOpen(!isOpen);
10041
10046
  };
10042
10047
  const handleFocus = () => {
@@ -10329,7 +10334,15 @@ const DateCell$1 = styled.div`
10329
10334
  color: #ccc;
10330
10335
  }
10331
10336
  `;
10332
- const years$1 = [2022, 2023, 2024];
10337
+ const generateYearsArray$1 = (startYear, endDate) => {
10338
+ const years = [];
10339
+ const endYear = endDate.getFullYear();
10340
+ for (let year = startYear; year <= endYear; year++) {
10341
+ years.push(`${year}`);
10342
+ }
10343
+ return years;
10344
+ };
10345
+ const years$1 = generateYearsArray$1(2022, new Date());
10333
10346
  const QuarterPopupPicker = ({
10334
10347
  isOpen,
10335
10348
  onChangeDate,
@@ -10407,23 +10420,22 @@ const QuarterPopupPicker = ({
10407
10420
  };
10408
10421
 
10409
10422
  /* eslint-disable import/no-extraneous-dependencies */
10410
- const QuarterPicker = _ref => {
10411
- let {
10412
- availableQuarters,
10413
- // ["Q1-2024"]
10414
- label,
10415
- onChange,
10416
- borderRadius,
10417
- required,
10418
- width,
10419
- height,
10420
- placeholder,
10421
- disabled,
10422
- borderColor,
10423
- borderColorFocus,
10424
- textColor,
10425
- selectedValue
10426
- } = _ref;
10423
+ const QuarterPicker = ({
10424
+ availableQuarters,
10425
+ // ["Q1-2024"]
10426
+ label,
10427
+ onChange,
10428
+ borderRadius,
10429
+ required,
10430
+ width,
10431
+ height,
10432
+ placeholder,
10433
+ disabled,
10434
+ borderColor,
10435
+ borderColorFocus,
10436
+ textColor,
10437
+ selectedValue
10438
+ }) => {
10427
10439
  const [isFocused, setIsFocused] = useState(false);
10428
10440
  const [isOpen, setIsOpen] = useState(false);
10429
10441
  const [value, setValue] = useState('');
@@ -10758,7 +10770,15 @@ const DateCell = styled.div`
10758
10770
  color: #ccc;
10759
10771
  }
10760
10772
  `;
10761
- const years = [2022, 2023, 2024];
10773
+ const generateYearsArray = (startYear, endDate) => {
10774
+ const years = [];
10775
+ const endYear = endDate.getFullYear();
10776
+ for (let year = startYear; year <= endYear; year++) {
10777
+ years.push(`${year}`);
10778
+ }
10779
+ return years;
10780
+ };
10781
+ const years = generateYearsArray(2022, new Date());
10762
10782
  const MonthPopupPicker = ({
10763
10783
  isOpen,
10764
10784
  onChangeDate,
@@ -10862,22 +10882,21 @@ const MonthPopupPicker = ({
10862
10882
  };
10863
10883
 
10864
10884
  /* eslint-disable import/no-extraneous-dependencies */
10865
- const MonthPicker = _ref => {
10866
- let {
10867
- availableMonths,
10868
- label,
10869
- onChange,
10870
- borderRadius,
10871
- required,
10872
- width,
10873
- height,
10874
- placeholder,
10875
- disabled,
10876
- borderColor,
10877
- borderColorFocus,
10878
- textColor,
10879
- selectedValue
10880
- } = _ref;
10885
+ const MonthPicker = ({
10886
+ availableMonths,
10887
+ label,
10888
+ onChange,
10889
+ borderRadius,
10890
+ required,
10891
+ width,
10892
+ height,
10893
+ placeholder,
10894
+ disabled,
10895
+ borderColor,
10896
+ borderColorFocus,
10897
+ textColor,
10898
+ selectedValue
10899
+ }) => {
10881
10900
  const [isFocused, setIsFocused] = useState(false);
10882
10901
  const [isOpen, setIsOpen] = useState(false);
10883
10902
  const [value, setValue] = useState('');
@@ -24103,22 +24122,21 @@ const DeleteIcon = styled.div`
24103
24122
  position: absolute;
24104
24123
  `;
24105
24124
 
24106
- const QuickFilterDropdownSingle = _ref => {
24107
- let {
24108
- label,
24109
- hoverColor,
24110
- options,
24111
- selectedValue,
24112
- placeHolder,
24113
- onChange,
24114
- disabled,
24115
- width,
24116
- error,
24117
- errorMessage,
24118
- xIconShow,
24119
- labelColor,
24120
- showLabelOnTop
24121
- } = _ref;
24125
+ const QuickFilterDropdownSingle = ({
24126
+ label,
24127
+ hoverColor,
24128
+ options,
24129
+ selectedValue,
24130
+ placeHolder,
24131
+ onChange,
24132
+ disabled,
24133
+ width,
24134
+ error,
24135
+ errorMessage,
24136
+ xIconShow,
24137
+ labelColor,
24138
+ showLabelOnTop
24139
+ }) => {
24122
24140
  const [isFocused, setIsFocused] = useState(false);
24123
24141
  const [showOptions, setShowOptions] = useState(false);
24124
24142
  const [inputValue, setInputValue] = useState("");
@@ -24516,24 +24534,23 @@ const IconContainer$2 = styled.div`
24516
24534
  cursor: pointer;
24517
24535
  `;
24518
24536
 
24519
- const QuickFilterDropdownMultiSelection = _ref => {
24520
- let {
24521
- label,
24522
- labelEmptyValue,
24523
- options,
24524
- selectedValue,
24525
- placeHolder,
24526
- onChange,
24527
- required,
24528
- disabled,
24529
- width,
24530
- error,
24531
- errorMessage,
24532
- labelColor,
24533
- xIconShow,
24534
- checkBoxColor,
24535
- showLabelOnTop
24536
- } = _ref;
24537
+ const QuickFilterDropdownMultiSelection = ({
24538
+ label,
24539
+ labelEmptyValue,
24540
+ options,
24541
+ selectedValue,
24542
+ placeHolder,
24543
+ onChange,
24544
+ required,
24545
+ disabled,
24546
+ width,
24547
+ error,
24548
+ errorMessage,
24549
+ labelColor,
24550
+ xIconShow,
24551
+ checkBoxColor,
24552
+ showLabelOnTop
24553
+ }) => {
24537
24554
  const [isFocused, setIsFocused] = useState(false);
24538
24555
  const [showOptions, setShowOptions] = useState(false);
24539
24556
  const [inputValue, setInputValue] = useState('');
@@ -25147,8 +25164,8 @@ function styleInject(css, ref) {
25147
25164
  }
25148
25165
  }
25149
25166
 
25150
- var css_248z$1 = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: var(\n --custom-highlight-background,\n linear-gradient(\n 90deg,\n var(--base-color) 0%,\n var(--highlight-color) 50%,\n var(--base-color) 100%\n )\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
25151
- styleInject(css_248z$1);
25167
+ var css_248z = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n user-select: none;\n overflow: hidden;\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: var(\n --custom-highlight-background,\n linear-gradient(\n 90deg,\n var(--base-color) 0%,\n var(--highlight-color) 50%,\n var(--base-color) 100%\n )\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n\n@media (prefers-reduced-motion) {\n .react-loading-skeleton {\n --pseudo-element-display: none; /* Disable animation */\n }\n}\n";
25168
+ styleInject(css_248z);
25152
25169
 
25153
25170
  const OneColumnContainer = props => {
25154
25171
  const {
@@ -31372,83 +31389,102 @@ const BatteryChart = props => {
31372
31389
  }))))))), starText !== "" && /*#__PURE__*/React$1.createElement(StarText, null, starText));
31373
31390
  };
31374
31391
 
31375
- const originalData$1 = [{
31376
- label: "Vendor Selling Event: Week 28",
31377
- inc_unit: 20000,
31378
- inc_roi: 1.2
31379
- }, {
31380
- label: "Vendor Selling Event: Week 29",
31381
- inc_unit: 10000,
31382
- inc_roi: 1.2
31383
- }, {
31384
- label: "Vendor Selling Event: Week 30",
31385
- inc_unit: 8000,
31386
- inc_roi: 0.8
31387
- }, {
31388
- label: "Vendor Selling Event: Week 33",
31389
- inc_unit: 12000,
31390
- inc_roi: 1.1
31391
- }, {
31392
- label: "Vendor Selling Event: Week 36",
31393
- inc_unit: 8000,
31394
- inc_roi: 1.2
31395
- }, {
31396
- label: "Vendor Selling Event: Week 34",
31397
- inc_unit: 8000,
31398
- inc_roi: 0.7
31399
- }, {
31400
- label: "Vendor Selling Event: Week 35",
31401
- inc_unit: 8000,
31402
- inc_roi: 0.8
31403
- }, {
31404
- label: "Vendor Selling Event: Week 38",
31405
- inc_unit: 9000,
31406
- inc_roi: 1.1
31407
- }];
31408
- const dataWithIndex$1 = originalData$1.map((item, index) => ({
31409
- ...item,
31410
- index,
31411
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31412
- }));
31413
- const CustomizedTick$1 = ({
31414
- x,
31415
- y,
31416
- payload
31392
+ // const originalData = [
31393
+ // { label: "Vendor Selling Event: Week 34", inc_sales: 20000, inc_roi: 1.2 },
31394
+ // { label: "Vendor Selling Event: Week 36", inc_sales: 10000, inc_roi: 1.2 },
31395
+ // { label: "Vendor Selling Event: Week 38", inc_sales: 8000, inc_roi: 0.8 },
31396
+ // { label: "Vendor Selling Event: Week 33", inc_sales: 12000, inc_roi: 1.1 },
31397
+ // { label: "Vendor Selling Event: Week 29", inc_sales: 8000, inc_roi: 1.2 },
31398
+ // { label: "Vendor Selling Event: Week 28", inc_sales: 8000, inc_roi: 0.7 },
31399
+ // { label: "Vendor Selling Event: Week 35", inc_sales: 8000, inc_roi: 0.8 },
31400
+ // { label: "Vendor Selling Event: Week 30", inc_sales: 9000, inc_roi: 1.1 },
31401
+ // ];
31402
+
31403
+ const SeparatedLineBarChart = ({
31404
+ barlineData
31417
31405
  }) => {
31418
- const label = dataWithIndex$1[payload.value]?.label ?? "";
31419
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31420
- return /*#__PURE__*/React$1.createElement("g", {
31421
- transform: `translate(${x},${y})`
31422
- }, /*#__PURE__*/React$1.createElement("text", {
31423
- x: 0,
31424
- y: 0,
31425
- dy: 16,
31426
- textAnchor: "middle",
31427
- fill: "#212121",
31428
- fontSize: 11,
31429
- fontWeight: "400",
31430
- fontFamily: "Poppins"
31431
- }, /*#__PURE__*/React$1.createElement("tspan", {
31432
- x: 0,
31433
- dy: 8
31434
- }, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
31435
- x: 0,
31436
- dy: 18
31437
- }, "Event: ", parts.join(" "))));
31438
- };
31439
-
31440
- // Common chart configuration
31441
- const chartMargins = {
31442
- top: 15,
31443
- right: 40,
31444
- left: 20,
31445
- bottom: 40
31446
- };
31447
- const SeparatedLineBarChart = () => {
31406
+ // Sort the data by week number extracted from the label
31407
+ const sortedData = barlineData?.sort((a, b) => {
31408
+ const weekA = parseInt(a.label.match(/Week (\d+)/)[1], 10);
31409
+ const weekB = parseInt(b.label.match(/Week (\d+)/)[1], 10);
31410
+ return weekA - weekB;
31411
+ });
31412
+ const dataWithIndex = sortedData.map((item, index) => ({
31413
+ ...item,
31414
+ index,
31415
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31416
+ }));
31417
+ const CustomizedTick = ({
31418
+ x,
31419
+ y,
31420
+ payload,
31421
+ viewableIndices
31422
+ }) => {
31423
+ const label = dataWithIndex[payload.value]?.label ?? "";
31424
+ const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31425
+ if (!viewableIndices.includes(payload.value)) {
31426
+ return null;
31427
+ }
31428
+ return /*#__PURE__*/React$1.createElement("g", {
31429
+ transform: `translate(${x},${y})`
31430
+ }, /*#__PURE__*/React$1.createElement("text", {
31431
+ x: 0,
31432
+ y: 0,
31433
+ dy: 16,
31434
+ textAnchor: "middle",
31435
+ fill: "#212121",
31436
+ fontSize: 11,
31437
+ fontWeight: "400",
31438
+ fontFamily: "Poppins"
31439
+ }, /*#__PURE__*/React$1.createElement("tspan", {
31440
+ x: 0,
31441
+ dy: 8
31442
+ }, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
31443
+ x: 0,
31444
+ dy: 18
31445
+ }, "Event: ", parts.join(" "))));
31446
+ };
31447
+ const CustomLabelListFilter = props => {
31448
+ const {
31449
+ viewableIndices,
31450
+ dataKey,
31451
+ position,
31452
+ formatter,
31453
+ fill,
31454
+ fontSize,
31455
+ fontWeight,
31456
+ fontFamily
31457
+ } = props;
31458
+ return /*#__PURE__*/React$1.createElement(LabelList, {
31459
+ dataKey: dataKey,
31460
+ position: position,
31461
+ formatter: (value, name, props) => {
31462
+ if (!viewableIndices.includes(props.index)) {
31463
+ return "";
31464
+ }
31465
+ return formatter ? formatter(value) : value;
31466
+ },
31467
+ fill: fill || "#212121",
31468
+ fontSize: fontSize || 12,
31469
+ fontWeight: fontWeight || "400",
31470
+ fontFamily: fontFamily || "Poppins"
31471
+ });
31472
+ };
31473
+ const chartMargins = {
31474
+ top: 15,
31475
+ right: 40,
31476
+ left: 20,
31477
+ bottom: 40
31478
+ };
31448
31479
  const [viewWindow, setViewWindow] = useState({
31449
31480
  startIndex: 0,
31450
- endIndex: dataWithIndex$1.length - 1
31481
+ endIndex: dataWithIndex.length - 1
31451
31482
  });
31483
+ const viewableIndices = [];
31484
+ for (let i = viewWindow.startIndex; i <= viewWindow.endIndex; i++) {
31485
+ viewableIndices.push(i);
31486
+ }
31487
+ dataWithIndex.filter(item => viewableIndices.includes(item.index));
31452
31488
  return /*#__PURE__*/React$1.createElement("div", {
31453
31489
  style: {
31454
31490
  width: "100%",
@@ -31462,8 +31498,7 @@ const SeparatedLineBarChart = () => {
31462
31498
  width: "100%",
31463
31499
  height: "100%"
31464
31500
  }, /*#__PURE__*/React$1.createElement(LineChart, {
31465
- data: dataWithIndex$1 // Use full dataset for alignment
31466
- ,
31501
+ data: dataWithIndex,
31467
31502
  margin: chartMargins
31468
31503
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
31469
31504
  strokeDasharray: "3 3",
@@ -31491,10 +31526,11 @@ const SeparatedLineBarChart = () => {
31491
31526
  },
31492
31527
  activeDot: false,
31493
31528
  name: "INC Sales ROI"
31494
- }, /*#__PURE__*/React$1.createElement(LabelList, {
31529
+ }, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
31495
31530
  dataKey: "inc_roi",
31496
31531
  position: "top",
31497
- formatter: value => value.toFixed(1)
31532
+ formatter: value => value.toFixed(1),
31533
+ viewableIndices: viewableIndices
31498
31534
  }))))), /*#__PURE__*/React$1.createElement("div", {
31499
31535
  style: {
31500
31536
  height: "60%"
@@ -31503,7 +31539,7 @@ const SeparatedLineBarChart = () => {
31503
31539
  width: "100%",
31504
31540
  height: "100%"
31505
31541
  }, /*#__PURE__*/React$1.createElement(ComposedChart, {
31506
- data: dataWithIndex$1,
31542
+ data: dataWithIndex,
31507
31543
  margin: chartMargins
31508
31544
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
31509
31545
  strokeDasharray: "3 3",
@@ -31516,30 +31552,28 @@ const SeparatedLineBarChart = () => {
31516
31552
  left: 20,
31517
31553
  right: 20
31518
31554
  },
31519
- tick: /*#__PURE__*/React$1.createElement(CustomizedTick$1, null),
31520
- interval: 0 // Force display all ticks
31521
- ,
31555
+ tick: props => /*#__PURE__*/React$1.createElement(CustomizedTick, _extends({}, props, {
31556
+ viewableIndices: viewableIndices
31557
+ })),
31558
+ interval: 0,
31522
31559
  height: 60,
31523
31560
  tickLine: false,
31524
- ticks: dataWithIndex$1.map(item => item.index)
31561
+ ticks: dataWithIndex.map(item => item.index)
31525
31562
  }), /*#__PURE__*/React$1.createElement(YAxis, {
31526
- tickFormatter: v => `$${v / 1000}k`,
31563
+ tickFormatter: v => `${v / 1000}k`,
31527
31564
  hide: true
31528
31565
  }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
31529
- dataKey: "inc_unit",
31566
+ dataKey: "inc_sales",
31530
31567
  fill: "#CCDCDD",
31531
31568
  gap: "4px",
31532
31569
  borderRadius: [4, 4, 0, 8],
31533
31570
  barSize: 40,
31534
31571
  name: "INC Sales"
31535
- }, /*#__PURE__*/React$1.createElement(LabelList, {
31536
- dataKey: "inc_unit",
31572
+ }, /*#__PURE__*/React$1.createElement(CustomLabelListFilter, {
31573
+ dataKey: "inc_sales",
31537
31574
  position: "top",
31538
- formatter: value => `$${value / 1000}k`,
31539
- fill: "#212121",
31540
- fontSize: 12,
31541
- fontWeight: "400",
31542
- fontFamily: "Poppins"
31575
+ formatter: value => `${value / 1000}k`,
31576
+ viewableIndices: viewableIndices
31543
31577
  })), /*#__PURE__*/React$1.createElement(Brush, {
31544
31578
  dataKey: "index",
31545
31579
  height: 30,
@@ -31549,7 +31583,7 @@ const SeparatedLineBarChart = () => {
31549
31583
  onChange: e => {
31550
31584
  setViewWindow({
31551
31585
  startIndex: e.startIndex ?? 0,
31552
- endIndex: e.endIndex ?? dataWithIndex$1.length - 1
31586
+ endIndex: e.endIndex ?? dataWithIndex.length - 1
31553
31587
  });
31554
31588
  },
31555
31589
  travellerWidth: 12
@@ -31570,68 +31604,42 @@ const SeparatedLineBarChart = () => {
31570
31604
  })))));
31571
31605
  };
31572
31606
 
31573
- const originalData = [{
31574
- label: "Vendor Selling Event: Week 28",
31575
- inc_unit: 20000
31576
- }, {
31577
- label: "Vendor Selling Event: Week 29",
31578
- inc_unit: 10000
31579
- }, {
31580
- label: "Vendor Selling Event: Week 30",
31581
- inc_unit: 8000
31582
- }, {
31583
- label: "Vendor Selling Event: Week 33",
31584
- inc_unit: 12000
31585
- }, {
31586
- label: "Vendor Selling Event: Week 36",
31587
- inc_unit: 8000
31588
- }, {
31589
- label: "Vendor Selling Event: Week 34",
31590
- inc_unit: 8000
31591
- }, {
31592
- label: "Vendor Selling Event: Week 35",
31593
- inc_unit: 8000
31594
- }, {
31595
- label: "Vendor Selling Event: Week 38",
31596
- inc_unit: 9000
31597
- }];
31598
-
31599
- // Adding index and shortLabel to original data
31600
- const dataWithIndex = originalData.map((item, index) => ({
31601
- ...item,
31602
- index,
31603
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31604
- }));
31605
- const CustomizedTick = ({
31606
- x,
31607
- y,
31608
- payload
31609
- }) => {
31610
- const label = dataWithIndex[payload.value]?.label ?? "";
31611
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31612
- return /*#__PURE__*/React$1.createElement("g", {
31613
- transform: `translate(${x},${y})`
31614
- }, /*#__PURE__*/React$1.createElement("text", {
31615
- x: 0,
31616
- y: 0,
31617
- dy: 16,
31618
- textAnchor: "middle",
31619
- fill: "#212121",
31620
- fontSize: 11,
31621
- fontWeight: "400",
31622
- fontFamily: "Poppins"
31623
- }, /*#__PURE__*/React$1.createElement("tspan", {
31624
- x: 0,
31625
- dy: 8
31626
- }, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
31627
- x: 0,
31628
- dy: 18
31629
- }, "Event: ", parts.join(" "))));
31630
- };
31631
- const SingleChart = () => {
31607
+ function SingleChart({
31608
+ lineChartData
31609
+ }) {
31610
+ const dataWithIndex = lineChartData?.map((item, index) => ({
31611
+ ...item,
31612
+ index,
31613
+ shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
31614
+ }));
31615
+ const CustomizedTick = ({
31616
+ x,
31617
+ y,
31618
+ payload
31619
+ }) => {
31620
+ const label = dataWithIndex[payload.value]?.label ?? "";
31621
+ const parts = label.replace("Vendor Selling Event: ", "").split(" ");
31622
+ return /*#__PURE__*/React$1.createElement("g", {
31623
+ transform: `translate(${x},${y})`
31624
+ }, /*#__PURE__*/React$1.createElement("text", {
31625
+ x: 0,
31626
+ y: 0,
31627
+ dy: 16,
31628
+ textAnchor: "middle",
31629
+ fill: "#212121",
31630
+ fontSize: 11,
31631
+ fontWeight: "400",
31632
+ fontFamily: "Poppins"
31633
+ }, /*#__PURE__*/React$1.createElement("tspan", {
31634
+ x: 0,
31635
+ dy: 8
31636
+ }, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
31637
+ x: 0,
31638
+ dy: 18
31639
+ }, "Event: ", parts.join(" "))));
31640
+ };
31632
31641
  const [startIndex, setStartIndex] = useState(0);
31633
- const [endIndex, setEndIndex] = useState(dataWithIndex.length - 1);
31634
- dataWithIndex.slice(startIndex, endIndex + 1);
31642
+ const [endIndex, setEndIndex] = useState(dataWithIndex?.length - 1);
31635
31643
  return /*#__PURE__*/React$1.createElement("div", {
31636
31644
  style: {
31637
31645
  width: "100%",
@@ -31669,14 +31677,14 @@ const SingleChart = () => {
31669
31677
  tickFormatter: v => `$${v / 1000}k`,
31670
31678
  hide: true
31671
31679
  }), /*#__PURE__*/React$1.createElement(Tooltip$2, null), /*#__PURE__*/React$1.createElement(Bar, {
31672
- dataKey: "inc_unit",
31680
+ dataKey: "value",
31673
31681
  fill: "#CCDCDD",
31674
31682
  gap: "4px",
31675
31683
  borderRadius: [4, 4, 0, 8],
31676
31684
  barSize: 40,
31677
31685
  name: "INC Sales"
31678
31686
  }, /*#__PURE__*/React$1.createElement(LabelList, {
31679
- dataKey: "inc_unit",
31687
+ dataKey: "value",
31680
31688
  position: "top",
31681
31689
  formatter: value => `$${value / 1000}k`,
31682
31690
  fill: "#212121",
@@ -31691,7 +31699,7 @@ const SingleChart = () => {
31691
31699
  endIndex: endIndex,
31692
31700
  onChange: e => {
31693
31701
  setStartIndex(e.startIndex ?? 0);
31694
- setEndIndex(e.endIndex ?? dataWithIndex.length - 1);
31702
+ setEndIndex(e.endIndex ?? dataWithIndex?.length - 1);
31695
31703
  },
31696
31704
  travellerWidth: 12
31697
31705
  })), /*#__PURE__*/React$1.createElement(PerformanceAnalyticsLegend, {
@@ -31701,7 +31709,7 @@ const SingleChart = () => {
31701
31709
  title: "INC Units"
31702
31710
  }]
31703
31711
  }))));
31704
- };
31712
+ }
31705
31713
 
31706
31714
  styled.div`
31707
31715
  display: flex;
@@ -31833,15 +31841,17 @@ const SegmentedButton = props => {
31833
31841
  }, [defaultIndex]);
31834
31842
  useEffect(() => {
31835
31843
  const activeSegmentRef = optionsRef[activeIndex].ref;
31836
- const {
31837
- offsetWidth,
31838
- offsetLeft
31839
- } = activeSegmentRef.current;
31840
- const {
31841
- style
31842
- } = controlRef.current;
31843
- style.setProperty('--highlight-width', `${offsetWidth}px`);
31844
- style.setProperty('--highlight-x-pos', `${offsetLeft}px`);
31844
+ setTimeout(() => {
31845
+ const {
31846
+ offsetWidth,
31847
+ offsetLeft
31848
+ } = activeSegmentRef.current;
31849
+ const {
31850
+ style
31851
+ } = controlRef.current;
31852
+ style.setProperty("--highlight-width", `${offsetWidth}px`);
31853
+ style.setProperty("--highlight-x-pos", `${offsetLeft}px`);
31854
+ }, 0);
31845
31855
  }, [activeIndex, controlRef, optionsRef]);
31846
31856
  const onInputChangeHandler = (value, index) => {
31847
31857
  setActiveIndex(index);
@@ -31864,14 +31874,14 @@ const SegmentedButton = props => {
31864
31874
  gap: gap,
31865
31875
  controlradius: controlradius,
31866
31876
  segmentwidth: segmentwidth,
31867
- className: `controls ${componentReady.current ? 'ready' : 'idle'}`
31877
+ className: `controls ${componentReady.current ? "ready" : "idle"}`
31868
31878
  }, optionsRef?.map((item, i) => /*#__PURE__*/React$1.createElement(Segment, {
31869
31879
  id: "Segment",
31870
31880
  key: item.id,
31871
31881
  selectedsegmentcolor: selectedsegmentcolor,
31872
31882
  controlradius: controlradius,
31873
31883
  segmentwidth: segmentwidth,
31874
- className: `${activeIndex === i ? 'active' : 'inactive'}`,
31884
+ className: `${activeIndex === i ? "active" : "inactive"}`,
31875
31885
  ref: item.ref
31876
31886
  }, /*#__PURE__*/React$1.createElement(ControlsInput, {
31877
31887
  type: "radio",
@@ -31885,7 +31895,7 @@ const SegmentedButton = props => {
31885
31895
  selectedtextcolor: selectedtextcolor,
31886
31896
  unselectedtextcolor: unselectedtextcolor,
31887
31897
  segmentheight: height / 5,
31888
- className: `${activeIndex === i ? 'active' : 'inactive'} `,
31898
+ className: `${activeIndex === i ? "active" : "inactive"} `,
31889
31899
  htmlFor: item.value
31890
31900
  }, item.value)))));
31891
31901
  };
@@ -31907,116 +31917,38 @@ SegmentedButton.propTypes = {
31907
31917
  onClick: PropTypes.func
31908
31918
  };
31909
31919
  SegmentedButton.defaultProps = {
31910
- name: '',
31920
+ name: "",
31911
31921
  options: [{
31912
- value: '4 w'
31922
+ value: "4 w"
31913
31923
  }, {
31914
- value: '8 w'
31924
+ value: "8 w"
31915
31925
  }, {
31916
- value: '13 w'
31926
+ value: "13 w"
31917
31927
  }],
31918
31928
  width: 120,
31919
31929
  height: 40,
31920
31930
  controlradius: 8,
31921
31931
  segmentradius: 8,
31922
- gap: '0px',
31932
+ gap: "0px",
31923
31933
  fontSize: 14,
31924
- selectedsegmentcolor: '#3a9df9',
31925
- selectedtextcolor: '#212121',
31926
- unselectedtextcolor: 'black',
31934
+ selectedsegmentcolor: "#3a9df9",
31935
+ selectedtextcolor: "#212121",
31936
+ unselectedtextcolor: "black",
31927
31937
  defaultIndex: 0,
31928
31938
  onClick: () => {}
31929
31939
  };
31930
31940
 
31931
- var css_248z = ".BarLine {\r\n font-family: sans-serif;\r\n text-align: center;\r\n }\r\n \r\n /* Make brush background darker */\r\n /* .recharts-brush .recharts-brush-slide {\r\n fill: #a52a2a !important;\r\n stroke: none;\r\n }\r\n \r\n /* Style draggable handles (travellers) */\r\n /* .recharts-brush-traveller {\r\n fill: limegreen !important; /* bright green like in the image */\r\n /* cursor: ew-resize;\r\n } */\r\n */\r\n \r\n /* Optional: center grip arrows (you can fake it with CSS) */\r\n /* .recharts-brush .recharts-brush-traveller > rect {\r\n rx: 2;\r\n ry: 2;\r\n width: 6;\r\n fill: #a52a2a !important; /* dark gray */\r\n /* } */ */\r\n */\r\n \r\n /* Remove tick labels if needed */\r\n .recharts-brush .recharts-layer text {\r\n display: none;\r\n }\r\n ";
31932
- styleInject(css_248z);
31933
-
31934
- function InnerBarChart() {
31935
- const data = [{
31936
- week: "Week 28",
31937
- total: 20000,
31938
- actual: 4000
31939
- }, {
31940
- week: "Week 29",
31941
- total: 10000,
31942
- actual: 8000
31943
- }, {
31944
- week: "Week 30",
31945
- total: 8000,
31946
- actual: 950
31947
- }, {
31948
- week: "Week 33",
31949
- total: 12000,
31950
- actual: 1000
31951
- }, {
31952
- week: "Week 36",
31953
- total: 16000,
31954
- actual: 13000
31955
- }, {
31956
- week: "Week 34",
31957
- total: 30000,
31958
- actual: 3000
31959
- }, {
31960
- week: "Week 35",
31961
- total: 8000,
31962
- actual: 950
31963
- }, {
31964
- week: "Week 37",
31965
- total: 9000,
31966
- actual: 3000
31967
- }];
31968
- const originalData = [{
31969
- label: "Vendor Selling Event: Week 28",
31970
- inc_unit: 20000,
31971
- inc_roi: 1.2
31972
- }, {
31973
- label: "Vendor Selling Event: Week 29",
31974
- inc_unit: 10000,
31975
- inc_roi: 1.2
31976
- }, {
31977
- label: "Vendor Selling Event: Week 30",
31978
- inc_unit: 8000,
31979
- inc_roi: 0.8
31980
- }, {
31981
- label: "Vendor Selling Event: Week 33",
31982
- inc_unit: 12000,
31983
- inc_roi: 1.1
31984
- }, {
31985
- label: "Vendor Selling Event: Week 36",
31986
- inc_unit: 8000,
31987
- inc_roi: 1.2
31988
- }, {
31989
- label: "Vendor Selling Event: Week 34",
31990
- inc_unit: 8000,
31991
- inc_roi: 0.7
31992
- }, {
31993
- label: "Vendor Selling Event: Week 35",
31994
- inc_unit: 8000,
31995
- inc_roi: 0.8
31996
- }, {
31997
- label: "Vendor Selling Event: Week 38",
31998
- inc_unit: 9000,
31999
- inc_roi: 1.1
32000
- }];
31941
+ function InnerBarChart({
31942
+ data
31943
+ }) {
31944
+ const processedData = data.map(item => {
31945
+ const parts = item.label.replace("Vendor Selling Event:", "").trim();
31946
+ return {
31947
+ ...item,
31948
+ shortLabel: parts
31949
+ };
31950
+ });
32001
31951
  const format = v => v >= 1000 ? `${v / 1000}K` : v;
32002
- const CustomBarLabel = ({
32003
- x,
32004
- y,
32005
- width,
32006
- payload
32007
- }) => {
32008
- if (!payload || typeof payload.total === "undefined") {
32009
- console.error("Invalid payload:", payload);
32010
- return null;
32011
- }
32012
- const centerX = x + width / 2;
32013
- return /*#__PURE__*/React$1.createElement("text", {
32014
- x: centerX,
32015
- y: Math.max(y - 8, 10),
32016
- textAnchor: "middle",
32017
- fill: "black"
32018
- }, format(payload.total));
32019
- };
32020
31952
  const BarWithInner = props => {
32021
31953
  const {
32022
31954
  x,
@@ -32071,27 +32003,16 @@ function InnerBarChart() {
32071
32003
  if (!active || !payload || !payload.length) return null;
32072
32004
  const data = payload[0].payload;
32073
32005
  return /*#__PURE__*/React$1.createElement("div", {
32074
- style: {
32075
- background: "white",
32076
- border: "1px solid #ccc",
32077
- padding: "10px",
32078
- borderRadius: "8px",
32079
- fontSize: "14px"
32080
- }
32081
- }, /*#__PURE__*/React$1.createElement("strong", null, label), /*#__PURE__*/React$1.createElement("div", null, "Actual: ", format(data.actual)), /*#__PURE__*/React$1.createElement("div", null, "Total: ", format(data.total)));
32006
+ className: "bg-white border border-gray-300 p-2 rounded-lg text-sm"
32007
+ }, /*#__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)));
32082
32008
  };
32083
- const dataWithIndex = originalData.map((item, index) => ({
32084
- ...item,
32085
- index,
32086
- shortLabel: item.label.replace("Vendor Selling Event: ", "Wk ")
32087
- }));
32088
- const CustomizedTick = ({
32089
- x,
32090
- y,
32091
- payload
32092
- }) => {
32093
- const label = dataWithIndex[payload.value]?.label ?? "";
32094
- const parts = label.replace("Vendor Selling Event: ", "").split(" ");
32009
+ const CustomizedTick = props => {
32010
+ const {
32011
+ x,
32012
+ y,
32013
+ payload
32014
+ } = props;
32015
+ const labelText = payload.value.replace("Vendor Selling Event:", "").trim();
32095
32016
  return /*#__PURE__*/React$1.createElement("g", {
32096
32017
  transform: `translate(${x},${y})`
32097
32018
  }, /*#__PURE__*/React$1.createElement("text", {
@@ -32100,54 +32021,75 @@ function InnerBarChart() {
32100
32021
  dy: 16,
32101
32022
  textAnchor: "middle",
32102
32023
  fill: "#212121",
32103
- fontSize: 11,
32104
- fontWeight: "400",
32024
+ fontSize: 10,
32105
32025
  fontFamily: "Poppins"
32106
32026
  }, /*#__PURE__*/React$1.createElement("tspan", {
32107
32027
  x: 0,
32108
- dy: 8
32109
- }, "Vendor Selling"), /*#__PURE__*/React$1.createElement("tspan", {
32028
+ dy: "0.71em"
32029
+ }, "Vendor"), /*#__PURE__*/React$1.createElement("tspan", {
32110
32030
  x: 0,
32111
- dy: 18
32112
- }, "Event: ", parts.join(" "))));
32031
+ dy: "1.2em"
32032
+ }, "Selling"), /*#__PURE__*/React$1.createElement("tspan", {
32033
+ x: 0,
32034
+ dy: "1.2em"
32035
+ }, labelText)));
32113
32036
  };
32114
- return /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
32037
+ return /*#__PURE__*/React$1.createElement("div", {
32038
+ className: "w-full"
32039
+ }, /*#__PURE__*/React$1.createElement("h3", {
32040
+ className: "text-lg font-medium mb-4 text-center"
32041
+ }, "Vendor Selling Events Comparison"), /*#__PURE__*/React$1.createElement(ResponsiveContainer, {
32115
32042
  width: "100%",
32116
- height: 400
32043
+ height: 450
32117
32044
  }, /*#__PURE__*/React$1.createElement(BarChart$1, {
32118
- data: data,
32045
+ data: processedData,
32119
32046
  margin: {
32120
- top: 20,
32047
+ top: 30,
32121
32048
  right: 30,
32122
32049
  left: 20,
32123
- bottom: 10
32050
+ bottom: 60
32124
32051
  }
32125
32052
  }, /*#__PURE__*/React$1.createElement(CartesianGrid, {
32126
32053
  strokeDasharray: "3 3",
32127
32054
  vertical: false
32128
32055
  }), /*#__PURE__*/React$1.createElement(XAxis, {
32129
- dataKey: "week",
32130
- tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null)
32056
+ dataKey: "shortLabel",
32057
+ tick: /*#__PURE__*/React$1.createElement(CustomizedTick, null),
32058
+ height: 70,
32059
+ interval: 0
32131
32060
  }), /*#__PURE__*/React$1.createElement(YAxis, {
32132
32061
  type: "number",
32133
32062
  domain: [0, "dataMax + 2000"],
32134
- hide: true
32063
+ tickFormatter: format
32135
32064
  }), /*#__PURE__*/React$1.createElement(Tooltip$2, {
32136
32065
  content: /*#__PURE__*/React$1.createElement(CustomTooltip, null)
32137
32066
  }), /*#__PURE__*/React$1.createElement(Brush, {
32138
32067
  height: 30,
32139
32068
  travellerWidth: 10,
32140
- startIndex: 1,
32069
+ startIndex: 0,
32141
32070
  endIndex: 5,
32142
- y: 369
32071
+ y: 380
32143
32072
  }), /*#__PURE__*/React$1.createElement(Bar, {
32144
32073
  dataKey: "total",
32145
32074
  shape: /*#__PURE__*/React$1.createElement(BarWithInner, null),
32146
- label: /*#__PURE__*/React$1.createElement(CustomBarLabel, null),
32147
- barSize: 30
32148
- })));
32075
+ barSize: 36
32076
+ }))));
32149
32077
  }
32150
32078
 
32079
+ const Container = styled.div`
32080
+ width: ${props => props.width};
32081
+ height: ${props => props.height};
32082
+ padding: 15px;
32083
+ display: flex;
32084
+ flex-direction: column;
32085
+ #Segment {
32086
+ width: auto;
32087
+ white-space: nowrap;
32088
+ font-size: 14px;
32089
+ font-weight: 500;
32090
+ font-family: "Poppins"
32091
+ }
32092
+ `;
32151
32093
  styled.div`
32152
32094
  font-family: sans-serif;
32153
32095
  text-align: center;
@@ -32164,49 +32106,22 @@ styled.div`
32164
32106
  flex-direction: column;
32165
32107
  background-color: white;
32166
32108
  `;
32167
- const Container = styled.div`
32168
- width: 100%;
32169
- height: 100%;
32170
- display: flex;
32171
- flex-direction: column;
32172
- #Segment {
32173
- width: auto;
32174
- white-space: nowrap;
32175
- font-size: 14px;
32176
- font-weight: 500;
32177
- font-family: "Poppins"
32178
- }
32179
- `;
32180
- /* Make brush background darker */
32181
- /* .recharts-brush .recharts-brush-slide {
32182
- fill: #a52a2a !important;
32183
- stroke: none;
32184
- }
32185
-
32186
- /* Style draggable handles (travellers) */
32187
- /* .recharts-brush-traveller {
32188
- fill: limegreen !important; /* bright green like in the image */
32189
- /* cursor: ew-resize;
32190
- } */
32191
-
32192
- /* Optional: center grip arrows (you can fake it with CSS) */
32193
- /* .recharts-brush .recharts-brush-traveller > rect {
32194
- rx: 2;
32195
- ry: 2;
32196
- width: 6;
32197
- fill: #a52a2a !important; /* dark gray */
32198
- /* } */
32199
-
32200
- /* Remove tick labels if needed */
32201
- // .recharts-brush .recharts-layer text {
32202
- // display: none;
32203
- // }
32204
32109
 
32205
- const BrushChart = () => {
32110
+ const BrushChart = props => {
32111
+ const {
32112
+ width,
32113
+ height,
32114
+ data,
32115
+ barlineData,
32116
+ lineChartData
32117
+ } = props;
32206
32118
  const segmentedbuttonOptions = ["New Shoppers & Repeaters", "INC Sales & ROI", "INC Units", "Basket Lift"];
32207
32119
  const [selectedOption, setSelectedOption] = useState(segmentedbuttonOptions[0]);
32208
- return /*#__PURE__*/React$1.createElement(Container, null, /*#__PURE__*/React$1.createElement(SegmentedButton, {
32209
- gap: '8px',
32120
+ return /*#__PURE__*/React$1.createElement(Container, {
32121
+ height: height,
32122
+ width: width
32123
+ }, /*#__PURE__*/React$1.createElement(SegmentedButton, {
32124
+ gap: "8px",
32210
32125
  options: segmentedbuttonOptions.map(value => ({
32211
32126
  value
32212
32127
  })),
@@ -32216,7 +32131,15 @@ const BrushChart = () => {
32216
32131
  } = _ref;
32217
32132
  return setSelectedOption(value);
32218
32133
  }
32219
- }), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React$1.createElement(InnerBarChart, null), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React$1.createElement(SeparatedLineBarChart, null), selectedOption === "INC Units" && /*#__PURE__*/React$1.createElement(SingleChart, null), selectedOption === "Basket Lift" && /*#__PURE__*/React$1.createElement(SingleChart, null));
32134
+ }), selectedOption === "New Shoppers & Repeaters" && /*#__PURE__*/React$1.createElement(InnerBarChart, {
32135
+ data: data
32136
+ }), selectedOption === "INC Sales & ROI" && /*#__PURE__*/React$1.createElement(SeparatedLineBarChart, {
32137
+ barlineData: barlineData
32138
+ }), selectedOption === "INC Units" && /*#__PURE__*/React$1.createElement(SingleChart, {
32139
+ lineChartData: lineChartData
32140
+ }), selectedOption === "Basket Lift" && /*#__PURE__*/React$1.createElement(SingleChart, {
32141
+ lineChartData: lineChartData
32142
+ }));
32220
32143
  };
32221
32144
 
32222
32145
  export { AreaChart, BannerEventBoxList, BarChart, BarChartsByWeeks, BatteryChart, BreakdownPanel, BrushChart, BubbleChart, Button, CollapseHeader, DialogOverlay, DoubleBarSingleLine, DoublePanelDataRow, EventDetailsCard, EventList, FilterPanel, Heatmap, IconButton, LinkButton, LinnerDataBox, MarketShareDescription, OneColumnContainer, PerformanceAnalyticsLegend, PieChart, PopupCharts, QuickFilter, ReportTable, TabMenu, TopToggleList, TotalDoughnutChart, TotalHorizontalCharts };