sag_components 1.0.975 → 1.0.976

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.
Files changed (140) hide show
  1. package/dist/Button.test.js +10 -10
  2. package/dist/LinkButton.test.js +10 -10
  3. package/dist/SingleBar.test.js +2 -2
  4. package/dist/index.js +1 -1
  5. package/dist/stories/components/AttachedFile/AttachedFile.js +1 -1
  6. package/dist/stories/components/AttachedFile/AttachedFile.style.js +40 -6
  7. package/dist/stories/components/BannerEventBox/BannerEventBox.js +33 -23
  8. package/dist/stories/components/BannerEventBox/BannerEventBox.style.js +71 -15
  9. package/dist/stories/components/BannerEventBoxList/BannerEventBoxList.js +10 -5
  10. package/dist/stories/components/BannerEventBoxList/BannerEventBoxList.style.js +182 -16
  11. package/dist/stories/components/BannersDropdown/BannersDropdown.style.js +91 -10
  12. package/dist/stories/components/BarChart/BarChart.js +5 -3
  13. package/dist/stories/components/BarChart/BarChart.stories.js +29 -20
  14. package/dist/stories/components/BarChart/BarChart.style.js +52 -10
  15. package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.js +53 -44
  16. package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.stories.js +166 -40
  17. package/dist/stories/components/BarChartTwoRows/BarChartTwoRows.style.js +72 -11
  18. package/dist/stories/components/BarChartsByWeeks/BarChartsByWeeks.js +7 -3
  19. package/dist/stories/components/BarChartsByWeeks/BarChartsByWeeks.style.js +88 -13
  20. package/dist/stories/components/Benchmark/Benchmark.style.js +53 -7
  21. package/dist/stories/components/Button/Button.js +1 -1
  22. package/dist/stories/components/Button/Button.style.js +82 -7
  23. package/dist/stories/components/CampaignDemoReport/CampaignDemoReport.style.js +40 -7
  24. package/dist/stories/components/Card/Card.style.js +57 -10
  25. package/dist/stories/components/CheckBox/CheckBox.style.js +28 -6
  26. package/dist/stories/components/CheckBoxButton/CheckBoxButton.style.js +31 -6
  27. package/dist/stories/components/CodeEditor/CodeEditor.style.js +4 -3
  28. package/dist/stories/components/CollapseData/CollapseData.js +5 -5
  29. package/dist/stories/components/CollapseData/CollapseData.style.js +119 -13
  30. package/dist/stories/components/CollapseHeader/CollapseHeader.js +2 -1
  31. package/dist/stories/components/CollapseHeader/CollapseHeader.style.js +192 -27
  32. package/dist/stories/components/CollapseMenuItem/CollapseMenuItem.style.js +53 -9
  33. package/dist/stories/components/Datepicker/Datepicker.style.js +9 -3
  34. package/dist/stories/components/DownloadProgress/DownloadProgress.style.js +43 -6
  35. package/dist/stories/components/Dropdown/Dropdown.style.js +9 -3
  36. package/dist/stories/components/DropdownMulti/DropdownMulti.js +290 -0
  37. package/dist/stories/components/DropdownMulti/DropdownMulti.stories.js +220 -0
  38. package/dist/stories/components/DropdownMulti/DropdownMulti.style.js +11 -0
  39. package/dist/stories/components/DropdownMultiNew/DropdownMultiNew.js +49 -36
  40. package/dist/stories/components/DropdownMultiNew/DropdownMultiNew.style.js +204 -16
  41. package/dist/stories/components/DropdownNew/DropdownNew.js +21 -11
  42. package/dist/stories/components/DropdownNew/DropdownNew.stories.js +18 -9
  43. package/dist/stories/components/DropdownNew/DropdownNew.style.js +13 -3
  44. package/dist/stories/components/DropdownSingleNew/DropdownSingleNew.js +30 -10
  45. package/dist/stories/components/DropdownSingleNew/DropdownSingleNew.style.js +175 -14
  46. package/dist/stories/components/EventDetailsCard/EventDetailsCard.style.js +86 -10
  47. package/dist/stories/components/EventList/EventList.style.js +30 -6
  48. package/dist/stories/components/EventListItem/EventListItem.style.js +39 -6
  49. package/dist/stories/components/FilterContainer/FilterContainer.style.js +22 -5
  50. package/dist/stories/components/FilterPanel/FilterPanel.js +22 -17
  51. package/dist/stories/components/FilterPanel/FilterPanel.style.js +81 -13
  52. package/dist/stories/components/FilterPanel.js +4 -0
  53. package/dist/stories/components/FormattedValue/FormattedValue.style.js +83 -10
  54. package/dist/stories/components/IconButton/IconButton.style.js +56 -7
  55. package/dist/stories/components/Input/Input.style.js +122 -9
  56. package/dist/stories/components/InputOld/InputOld.style.js +61 -8
  57. package/dist/stories/components/KpiFilter/KpiFilter.js +18 -1
  58. package/dist/stories/components/KpiFilter/KpiFilter.style.js +124 -18
  59. package/dist/stories/components/LinkButton/LinkButton.style.js +45 -6
  60. package/dist/stories/components/LinnerDataBox/LinnerDataBox.js +4 -2
  61. package/dist/stories/components/LinnerDataBox/LinnerDataBox.stories.js +32 -10
  62. package/dist/stories/components/LinnerDataBox/LinnerDataBox.style.js +60 -14
  63. package/dist/stories/components/ListBox/ListBox.style.js +40 -6
  64. package/dist/stories/components/MarketShareDescription/MarketShareDescription.stories.js +17 -3
  65. package/dist/stories/components/MarketShareDescription/MarketShareDescription.style.js +207 -19
  66. package/dist/stories/components/Modal/Modal.style.js +56 -8
  67. package/dist/stories/components/Modal/ModalTotalBenchmark.js +6 -6
  68. package/dist/stories/components/MonthPicker/MonthPicker.js +2 -2
  69. package/dist/stories/components/MonthPicker/MonthPicker.style.js +95 -10
  70. package/dist/stories/components/MonthPicker/MonthPopupPicker.js +91 -13
  71. package/dist/stories/components/MultipleCard/MultipleCard.style.js +5 -3
  72. package/dist/stories/components/NoDataFoundMessage/NoDataFoundMessage.style.js +31 -5
  73. package/dist/stories/components/OneColumnContainer/OneColumnContainer.style.js +99 -12
  74. package/dist/stories/components/PageFilterBar/PageFilterBar.style.js +14 -4
  75. package/dist/stories/components/PerformanceAnalytics/PerformanceAnalytics.js +16 -9
  76. package/dist/stories/components/PerformanceAnalytics/PerformanceAnalytics.style.js +136 -17
  77. package/dist/stories/components/PerformanceAnalyticsLegend/PerformanceAnalyticsLegend.js +14 -13
  78. package/dist/stories/components/PerformanceAnalyticsLegend/PerformanceAnalyticsLegend.style.js +55 -8
  79. package/dist/stories/components/PerformanceAnalyticsOneColumn/PerformanceAnalyticsOneColumn.js +12 -5
  80. package/dist/stories/components/PerformanceAnalyticsOneColumn/PerformanceAnalyticsOneColumn.style.js +108 -15
  81. package/dist/stories/components/PerformanceAnalyticsTotals/PerformanceAnalyticsTotals.js +1 -1
  82. package/dist/stories/components/PerformanceAnalyticsTotals/PerformanceAnalyticsTotals.style.js +81 -12
  83. package/dist/stories/components/Popup/Popup.style.js +114 -16
  84. package/dist/stories/components/PopupCharts/PopupCharts.style.js +100 -15
  85. package/dist/stories/components/PopupContent/PopupContent.style.js +64 -11
  86. package/dist/stories/components/ProductsVariety/ProductsVariety.style.js +78 -12
  87. package/dist/stories/components/ProgressBar/ProgressBar.style.js +15 -4
  88. package/dist/stories/components/QuarterPicker/QuarterPicker.js +2 -2
  89. package/dist/stories/components/QuarterPicker/QuarterPicker.style.js +94 -10
  90. package/dist/stories/components/QuarterPicker/QuarterPopupPicker.js +85 -12
  91. package/dist/stories/components/QuickFilter/QuickFilter.style.js +13 -3
  92. package/dist/stories/components/QuickFilter/QuickFilterDropdownMultiSelection.js +2 -2
  93. package/dist/stories/components/QuickFilter/QuickFilterDropdownMultiSelection.style.js +182 -16
  94. package/dist/stories/components/QuickFilter/QuickFilterDropdownSingle.js +1 -1
  95. package/dist/stories/components/QuickFilter/QuickFilterDropdownSingle.style.js +127 -15
  96. package/dist/stories/components/QuickFilterDropdownMultiSelection.js +1 -1
  97. package/dist/stories/components/QuickFilterDropdownSingle.js +1 -1
  98. package/dist/stories/components/RangePicker/RangeDatePicker.js +95 -12
  99. package/dist/stories/components/RangePicker/RangePicker.js +2 -2
  100. package/dist/stories/components/RangePicker/RangePicker.style.js +99 -10
  101. package/dist/stories/components/ReportTable/ReportTable.style.js +123 -14
  102. package/dist/stories/components/SagButton/SagButton.style.js +39 -5
  103. package/dist/stories/components/SagIconButton/SagIconButton.style.js +22 -4
  104. package/dist/stories/components/SagInput/SagInput.style.js +33 -5
  105. package/dist/stories/components/SalesAndROI/SalesAndROI.style.js +103 -11
  106. package/dist/stories/components/SearchInput/SearchInput.style.js +29 -4
  107. package/dist/stories/components/SegmentedButton/SegmentedButton.js +5 -5
  108. package/dist/stories/components/SegmentedButton/SegmentedButton.style.js +90 -9
  109. package/dist/stories/components/Select/Select.style.js +92 -9
  110. package/dist/stories/components/TabMenu/TabMenu.js +19 -7
  111. package/dist/stories/components/TabMenu/TabMenu.style.js +105 -14
  112. package/dist/stories/components/Table/Table.js +2 -2
  113. package/dist/stories/components/Table/Table.style.js +78 -9
  114. package/dist/stories/components/TextField/TextField.style.js +10 -3
  115. package/dist/stories/components/TitleDescription/TitleDescription.style.js +214 -28
  116. package/dist/stories/components/Tooltip/Tooltip.js +1 -1
  117. package/dist/stories/components/Tooltip/Tooltip.style.js +90 -5
  118. package/dist/stories/components/TopToggleList/TopToggleList.style.js +43 -8
  119. package/dist/stories/components/TotalBenchmark/TotalBenchmark.style.js +71 -11
  120. package/dist/stories/components/TotalBenchmarkAreachart/TotalBenchmarkAreachart.js +3 -3
  121. package/dist/stories/components/TotalBenchmarkAreachart/TotalBenchmarkAreachart.style.js +163 -22
  122. package/dist/stories/components/TotalBenchmarkArrows/TotalBenchmarkArrows.style.js +100 -16
  123. package/dist/stories/components/TotalBenchmarkBarchart/TotalBenchmarkBarchart.style.js +69 -12
  124. package/dist/stories/components/TotalDoughnutChart/TotalDoughnutChart.js +3 -3
  125. package/dist/stories/components/TotalDoughnutChart/TotalDoughnutChart.style.js +170 -22
  126. package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.js +47 -32
  127. package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.stories.js +52 -14
  128. package/dist/stories/components/TotalHorizontalCharts/TotalHorizontalCharts.style.js +51 -13
  129. package/dist/stories/components/TspanTooltip/TspanTooltip.js +3 -3
  130. package/dist/stories/components/TspanTooltip/TspanTooltip.style.js +97 -5
  131. package/dist/stories/components/TwoBarCharts/TwoBarCharts.js +6 -4
  132. package/dist/stories/components/TwoBarCharts/TwoBarCharts.stories.js +88 -23
  133. package/dist/stories/components/TwoBarCharts/TwoBarCharts.style.js +52 -10
  134. package/dist/stories/utils/CommonFunctions.js +13 -8
  135. package/package.json +1 -1
  136. package/dist/stories/components/HaiTooltip.js +0 -71
  137. package/dist/stories/components/HaiTooltip.style.js +0 -12
  138. package/dist/stories/components/Rbackup.js +0 -453
  139. package/dist/stories/components/TableTooltip.js +0 -71
  140. package/dist/stories/components/TableTooltip.style.js +0 -12
@@ -5,26 +5,174 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.TextAfterValue = exports.LegendTitleAndFormatedValueContainer = exports.LegendTitle = exports.LegendFormattedValue = exports.LegendFormatedValueContainer = exports.LegendControlsContainer = exports.LegendContainer = exports.LegendColorRectangle = exports.FormattedValue = exports.DoughnutChartContainer = exports.DoughnutChartAndLegendContainer = exports.CurrencySignAndFormattedValueContainer = exports.CurrencySign = exports.ControlsContainer = exports.Controls = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
11
- const scrollableStyles = "\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-track {\n background: #E8E8E8;\n border-radius: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #D0D0D0;\n border-radius: 5px;\n }\n";
12
- const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n font-style: normal;\n font-size: ", ";\n color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 12px;\n display: flex;\n align-items: center;\n @media (max-width: 1536px) {\n ", "\n }\n\n > * {\n box-sizing: border-box;\n }\n"])), props => props.rootFont, props => props.textColor, props => props.width, props => props.height, scrollableStyles);
13
- const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: white;\n border-radius: 12px; \n"])));
14
- const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n background: white;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n border-radius: 5px;\n padding: 6px 10px;\n margin: 0;\n"])));
15
- const TooltipLabel = exports.TooltipLabel = _styledComponents.default.p(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-family: \"Poppins\", sans-serif;\n font-size: 12px;\n font-weight: 400;\n font-style: normal;\n width: max-content; // fit-content;\n line-height: normal;\n margin: 0;\n"])));
16
- const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n padding: 0 20px;\n"])));
17
- const Title = exports.Title = _styledComponents.default.h4(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 1rem;\n margin: 0;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 12px;\n }\n"])));
18
- const CurrencySignAndFormattedValueContainer = exports.CurrencySignAndFormattedValueContainer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n gap: 5px;\n align-items: baseline;\n"])));
19
- const CurrencySign = exports.CurrencySign = _styledComponents.default.span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 11px;\n }\n"])));
20
- const FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 40px;\n @media (max-width: 1536px) {\n font-size: 24px;\n }\n @media (max-width: 1366px) {\n font-size: 20px;\n }\n"])));
21
- const TextAfterValue = exports.TextAfterValue = _styledComponents.default.div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)([" \n font-weight: 400;\n font-size: 12px;\n @media (max-width: 1536px) {\n font-size: 11px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])));
22
- const DoughnutChartAndLegendContainer = exports.DoughnutChartAndLegendContainer = _styledComponents.default.div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n margin-top: auto;\n padding: 0 20px ;\n margin-bottom: 20px; \n"])));
23
- const DoughnutChartContainer = exports.DoughnutChartContainer = _styledComponents.default.div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center; \n min-width: 90px;\n min-height: 90px; \n"])));
24
- const LegendContainer = exports.LegendContainer = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n padding-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: space-evenly; \n"])));
25
- const LegendControlsContainer = exports.LegendControlsContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 0.5rem;\n align-items: center;\n margin-bottom: 0.375rem;\n"])));
26
- const LegendTitleAndFormatedValueContainer = exports.LegendTitleAndFormatedValueContainer = _styledComponents.default.div(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n"])));
27
- const LegendFormatedValueContainer = exports.LegendFormatedValueContainer = _styledComponents.default.div(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 0.875rem;\n"])));
28
- const LegendColorRectangle = exports.LegendColorRectangle = _styledComponents.default.div(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n width: 0.875rem;\n min-width: 0.875rem;\n height: 0.875rem;\n border-radius: 2px;\n background: ", ";\n"])), props => props.color);
29
- const LegendTitle = exports.LegendTitle = _styledComponents.default.h5(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 16px;\n gap: 5px;\n margin: 0;\n display: flex;\n justify-content: space-between;\n @media (max-width: 1536px) {\n font-size: 11px;\n }\n @media (max-width: 1366px) {\n font-size: 10px;\n }\n"])));
30
- const LegendFormattedValue = exports.LegendFormattedValue = _styledComponents.default.span(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n white-space: nowrap;\n"])));
9
+ const scrollableStyles = `
10
+ overflow-y: auto;
11
+
12
+ &::-webkit-scrollbar {
13
+ width: 8px;
14
+ }
15
+
16
+ &::-webkit-scrollbar-track {
17
+ background: #E8E8E8;
18
+ border-radius: 5px;
19
+ }
20
+
21
+ &::-webkit-scrollbar-thumb {
22
+ background: #D0D0D0;
23
+ border-radius: 5px;
24
+ }
25
+ `;
26
+ const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
27
+ position: relative;
28
+ font-family: "Poppins", sans-serif;
29
+ font-style: normal;
30
+ font-size: ${props => props.rootFont};
31
+ color: ${props => props.textColor};
32
+ width: ${props => props.width};
33
+ height: ${props => props.height};
34
+ border-radius: 12px;
35
+ display: flex;
36
+ align-items: center;
37
+ @media (max-width: 1536px) {
38
+ ${scrollableStyles}
39
+ }
40
+
41
+ > * {
42
+ box-sizing: border-box;
43
+ }
44
+ `;
45
+ const Controls = exports.Controls = _styledComponents.default.div`
46
+ display: flex;
47
+ flex-direction: column;
48
+ width: 100%;
49
+ height: 100%;
50
+ background: white;
51
+ border-radius: 12px;
52
+ `;
53
+ const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div`
54
+ display: flex;
55
+ background: white;
56
+ box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);
57
+ border-radius: 5px;
58
+ padding: 6px 10px;
59
+ margin: 0;
60
+ `;
61
+ const TooltipLabel = exports.TooltipLabel = _styledComponents.default.p`
62
+ color: #212121;
63
+ font-family: "Poppins", sans-serif;
64
+ font-size: 12px;
65
+ font-weight: 400;
66
+ font-style: normal;
67
+ width: max-content; // fit-content;
68
+ line-height: normal;
69
+ margin: 0;
70
+ `;
71
+ const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div`
72
+ display: flex;
73
+ flex-direction: column;
74
+ padding: 0 20px;
75
+ `;
76
+ const Title = exports.Title = _styledComponents.default.h4`
77
+ font-weight: 500;
78
+ font-size: 1rem;
79
+ margin: 0;
80
+ @media (max-width: 1536px) {
81
+ font-size: 14px;
82
+ }
83
+ @media (max-width: 1366px) {
84
+ font-size: 12px;
85
+ }
86
+ `;
87
+ const CurrencySignAndFormattedValueContainer = exports.CurrencySignAndFormattedValueContainer = _styledComponents.default.div`
88
+ display: flex;
89
+ align-items: center;
90
+ gap: 5px;
91
+ align-items: baseline;
92
+ `;
93
+ const CurrencySign = exports.CurrencySign = _styledComponents.default.span`
94
+ font-weight: 500;
95
+ font-size: 16px;
96
+ @media (max-width: 1536px) {
97
+ font-size: 14px;
98
+ }
99
+ @media (max-width: 1366px) {
100
+ font-size: 11px;
101
+ }
102
+ `;
103
+ const FormattedValue = exports.FormattedValue = _styledComponents.default.div`
104
+ font-weight: 500;
105
+ font-size: 40px;
106
+ @media (max-width: 1536px) {
107
+ font-size: 24px;
108
+ }
109
+ @media (max-width: 1366px) {
110
+ font-size: 20px;
111
+ }
112
+ `;
113
+ const TextAfterValue = exports.TextAfterValue = _styledComponents.default.div`
114
+ font-weight: 400;
115
+ font-size: 12px;
116
+ @media (max-width: 1536px) {
117
+ font-size: 11px;
118
+ }
119
+ @media (max-width: 1366px) {
120
+ font-size: 10px;
121
+ }
122
+ `;
123
+ const DoughnutChartAndLegendContainer = exports.DoughnutChartAndLegendContainer = _styledComponents.default.div`
124
+ display: flex;
125
+ justify-content: space-between;
126
+ margin-top: auto;
127
+ padding: 0 20px ;
128
+ margin-bottom: 20px;
129
+ `;
130
+ const DoughnutChartContainer = exports.DoughnutChartContainer = _styledComponents.default.div`
131
+ display: flex;
132
+ align-items: center;
133
+ min-width: 90px;
134
+ min-height: 90px;
135
+ `;
136
+ const LegendContainer = exports.LegendContainer = _styledComponents.default.div`
137
+ padding-left: 10px;
138
+ display: flex;
139
+ flex-direction: column;
140
+ justify-content: space-evenly;
141
+ `;
142
+ const LegendControlsContainer = exports.LegendControlsContainer = _styledComponents.default.div`
143
+ display: flex;
144
+ gap: 0.5rem;
145
+ align-items: center;
146
+ margin-bottom: 0.375rem;
147
+ `;
148
+ const LegendTitleAndFormatedValueContainer = exports.LegendTitleAndFormatedValueContainer = _styledComponents.default.div`
149
+ flex-grow: 1;
150
+ `;
151
+ const LegendFormatedValueContainer = exports.LegendFormatedValueContainer = _styledComponents.default.div`
152
+ font-size: 0.875rem;
153
+ `;
154
+ const LegendColorRectangle = exports.LegendColorRectangle = _styledComponents.default.div`
155
+ width: 0.875rem;
156
+ min-width: 0.875rem;
157
+ height: 0.875rem;
158
+ border-radius: 2px;
159
+ background: ${props => props.color};
160
+ `;
161
+ const LegendTitle = exports.LegendTitle = _styledComponents.default.h5`
162
+ font-weight: 400;
163
+ font-size: 16px;
164
+ gap: 5px;
165
+ margin: 0;
166
+ display: flex;
167
+ justify-content: space-between;
168
+ @media (max-width: 1536px) {
169
+ font-size: 11px;
170
+ }
171
+ @media (max-width: 1366px) {
172
+ font-size: 10px;
173
+ }
174
+ `;
175
+ const LegendFormattedValue = exports.LegendFormattedValue = _styledComponents.default.span`
176
+ font-weight: 500;
177
+ white-space: nowrap;
178
+ `;
@@ -12,6 +12,12 @@ var _TspanTooltip = _interopRequireDefault(require("../TspanTooltip/TspanTooltip
12
12
  var _NoDataFoundMessage = require("../NoDataFoundMessage/NoDataFoundMessage");
13
13
  var _CommonFunctions = require("../../utils/CommonFunctions");
14
14
  var _TotalHorizontalCharts = require("./TotalHorizontalCharts.style");
15
+ /* eslint-disable no-unused-vars */
16
+ /* eslint-disable react/prop-types */
17
+ /* eslint-disable react/no-unstable-nested-components */
18
+ /* eslint-disable no-shadow */
19
+ /* eslint-disable react/destructuring-assignment */
20
+
15
21
  const TotalHorizontalCharts = props => {
16
22
  const {
17
23
  title,
@@ -24,6 +30,7 @@ const TotalHorizontalCharts = props => {
24
30
  labelLimitedLetters,
25
31
  width,
26
32
  height,
33
+ barsMargin,
27
34
  rightGap,
28
35
  textColor,
29
36
  noDataText,
@@ -34,21 +41,32 @@ const TotalHorizontalCharts = props => {
34
41
  className
35
42
  } = props;
36
43
  const barBackgrounds = chartsData.map(bg => bg.color);
37
- const [widthChartContainer, setWidthChartContainer] = (0, _react.useState)(0);
38
- const [heightChartContainer, setHeightChartContainer] = (0, _react.useState)(0);
39
- const chartContainerRef = (0, _react.useRef)();
44
+ const topHeader = (0, _react.useRef)();
45
+ const wrapper = (0, _react.useRef)();
46
+ const [chartHeight, setChartHeight] = (0, _react.useState)('100%');
47
+ const calcHeight = () => {
48
+ if (wrapper.current && topHeader.current) {
49
+ const availableHeight = Math.max(wrapper.current.clientHeight - topHeader.current.clientHeight, 0);
50
+ return availableHeight / wrapper.current.clientHeight * 100;
51
+ }
52
+ return 100;
53
+ };
54
+ const updateChartHeight = () => {
55
+ setChartHeight(`${calcHeight()}%`);
56
+ };
57
+ (0, _react.useEffect)(() => {
58
+ updateChartHeight();
59
+ window.addEventListener('resize', updateChartHeight);
60
+ return () => {
61
+ window.removeEventListener('resize', updateChartHeight);
62
+ };
63
+ }, []);
40
64
  const [showLegendTooltip, setShowLegendTooltip] = (0, _react.useState)(false);
41
65
  const [tooltipText, setTooltipText] = (0, _react.useState)({
42
66
  content: '',
43
67
  clientX: 0,
44
68
  clientY: 0
45
69
  });
46
- (0, _react.useEffect)(() => {
47
- if (chartContainerRef.current) {
48
- setWidthChartContainer(chartContainerRef.current.clientWidth);
49
- setHeightChartContainer(chartContainerRef.current.clientHeight);
50
- }
51
- }, [width, height]);
52
70
  const CustomizedLabel = props => showPercentAsideValue ? /*#__PURE__*/_react.default.createElement("text", {
53
71
  x: props.x + (props.width <= 0 ? -12 : props.width) + 56,
54
72
  y: props.y + 4,
@@ -60,7 +78,7 @@ const TotalHorizontalCharts = props => {
60
78
  textAnchor: "middle"
61
79
  }, ''.concat((0, _CommonFunctions.getFormattedValue)(props.value), (0, _CommonFunctions.getFormattedUnits)(props.value)), /*#__PURE__*/_react.default.createElement("tspan", {
62
80
  fontWeight: 400
63
- }, " (".concat((props.value / value * 100).toFixed(0), "%)"))) : /*#__PURE__*/_react.default.createElement("text", {
81
+ }, ` (${(props.value / value * 100).toFixed(0)}%)`)) : /*#__PURE__*/_react.default.createElement("text", {
64
82
  x: props.x + (props.width <= 0 ? -12 : props.width) + 40,
65
83
  y: props.y + 4,
66
84
  dy: props.height / 2,
@@ -115,36 +133,34 @@ const TotalHorizontalCharts = props => {
115
133
  // verticalAnchor="middle"
116
134
  ,
117
135
  fill: fill
118
- }, payload.value.length > labelLimitedLetters - 1 ? "".concat(payload.value.slice(0, labelLimitedLetters), "...") : payload.value));
136
+ }, payload.value.length > labelLimitedLetters - 1 ? `${payload.value.slice(0, labelLimitedLetters)}...` : payload.value));
119
137
  }
120
138
  return null;
121
139
  }
122
140
  return null;
123
141
  };
124
142
  return /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.ControlsContainer, {
143
+ ref: wrapper,
125
144
  height: height,
126
145
  width: width,
127
146
  textColor: textColor,
128
147
  className: className
129
- }, (chartsData === null || chartsData === void 0 ? void 0 : chartsData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.TitleAndValueContainer, {
130
- id: "TitleAndValueContainer"
131
- }, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.Header, null, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.Title, null, title), /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.FormattedValue, {
132
- id: "FormattedValue"
133
- }, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.CurrencySign, {
134
- id: "CurrencySign"
135
- }, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, value) : ''), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1 !== 0 ? value === null || value === void 0 ? void 0 : value.toFixed(2) : value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : ''))), /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.ChartWrapper, null, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.ChartInner, {
136
- ref: chartContainerRef
137
- }, /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
138
- height: heightChartContainer - 10,
139
- width: widthChartContainer
148
+ }, (chartsData === null || chartsData === void 0 ? void 0 : chartsData.length) > 0 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.CardHeader, {
149
+ ref: topHeader,
150
+ className: "CardHeader"
151
+ }, /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.Title, null, title), /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.TotalValue, {
152
+ className: "TotalValue"
153
+ }, currencySign && /*#__PURE__*/_react.default.createElement(_TotalHorizontalCharts.CurrencySign, {
154
+ className: "CurrencySign"
155
+ }, (0, _CommonFunctions.getCurrencySign)(currencyType, value)), dotCut ? (0, _CommonFunctions.getFormattedValue)(value && Math.abs(value) > 0 && value % 1 !== 0 ? value === null || value === void 0 ? void 0 : value.toFixed(2) : value) : (0, _CommonFunctions.getNumberWithCommas)(value), dotCut ? (0, _CommonFunctions.getFormattedUnits)(value) : '')), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
156
+ height: chartHeight
140
157
  }, /*#__PURE__*/_react.default.createElement(_recharts.ComposedChart, {
141
- width: widthChartContainer * 0.4,
142
158
  layout: "vertical",
143
159
  data: chartsData,
144
160
  margin: {
145
161
  top: 10,
146
162
  right: 20,
147
- bottom: 50,
163
+ bottom: barsMargin,
148
164
  left: 10
149
165
  }
150
166
  }, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
@@ -155,13 +171,11 @@ const TotalHorizontalCharts = props => {
155
171
  }), /*#__PURE__*/_react.default.createElement(_recharts.YAxis, {
156
172
  dataKey: "name",
157
173
  type: "category",
158
- width: widthChartContainer * 0.3,
174
+ width: labelLimitedLetters * 10,
159
175
  tickLine: false,
176
+ axisLine: false,
160
177
  interval: 0,
161
178
  allowDataOverflow: true,
162
- axisLine: false
163
- // tick={{ fontSize: 12 }}
164
- ,
165
179
  tick: CustomizedTickBarChart
166
180
  }), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
167
181
  dataKey: "value",
@@ -176,7 +190,7 @@ const TotalHorizontalCharts = props => {
176
190
  /*#__PURE__*/
177
191
  // eslint-disable-next-line react/no-array-index-key
178
192
  _react.default.createElement(_recharts.Cell, {
179
- key: "cell-".concat(index),
193
+ key: `cell-${index}`,
180
194
  fill: barBackgrounds[index % 20]
181
195
  }))), showLegendTooltip && /*#__PURE__*/_react.default.createElement(_TspanTooltip.default, {
182
196
  direction: "top",
@@ -186,7 +200,7 @@ const TotalHorizontalCharts = props => {
186
200
  style: {
187
201
  pointerEvents: 'none'
188
202
  }
189
- })))))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
203
+ })))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
190
204
  noDataText: noDataText
191
205
  }));
192
206
  };
@@ -200,14 +214,15 @@ TotalHorizontalCharts.defaultProps = {
200
214
  currencySign: false,
201
215
  currencyType: 'USD',
202
216
  chartsData: [],
217
+ showPercentAsideValue: false,
203
218
  labelFontSize: 10,
204
219
  labelLimitedLetters: 12,
205
220
  width: '100%',
206
221
  height: '100%',
207
- rightGap: 1.25,
222
+ barsMargin: 0,
223
+ rightGap: 1,
208
224
  textColor: '#212121',
209
225
  noDataText: 'No Data',
210
- showPercentAsideValue: false,
211
226
  isDollar: true,
212
227
  isPercentage: false,
213
228
  showDollarSign: true
@@ -11,6 +11,22 @@ const chartsData1 = [{
11
11
  name: 'MTN DEW GE-SODA',
12
12
  value: 166898.22,
13
13
  color: 'rgba(31, 118, 119, 0.6)'
14
+ }, {
15
+ name: 'CHEETOS GE-CHIPS, SNACKS',
16
+ value: 33380.56798,
17
+ color: 'rgba(31, 118, 119, 0.9)'
18
+ }, {
19
+ name: 'CHEETOS SNACKING',
20
+ value: 12940.18567,
21
+ color: 'rgba(31, 118, 119, 0.8)'
22
+ }, {
23
+ name: 'CHEETOS GE-CHIPS, SNACKS',
24
+ value: 33380.98,
25
+ color: 'rgba(31, 118, 119, 0.9)'
26
+ }, {
27
+ name: 'CHEETOS SNACKING',
28
+ value: 12940.18,
29
+ color: 'rgba(31, 118, 119, 0.8)'
14
30
  }, {
15
31
  name: 'CHEETOS GE-CHIPS, SNACKS',
16
32
  value: 33380.98,
@@ -21,7 +37,7 @@ const chartsData1 = [{
21
37
  color: 'rgba(31, 118, 119, 0.8)'
22
38
  }, {
23
39
  name: 'LAMB WESTON FF-POTATOES ONIONS',
24
- value: -666828.24,
40
+ value: -6828.24,
25
41
  color: 'rgba(31, 118, 119, 0.7)'
26
42
  }];
27
43
  const chartsData2 = [{
@@ -94,6 +110,13 @@ var _default = exports.default = {
94
110
  type: 'select'
95
111
  }
96
112
  },
113
+ showPercentAsideValue: {
114
+ name: 'Show Percent Aside Value',
115
+ description: 'Show the percentage aside the value',
116
+ control: {
117
+ type: 'boolean'
118
+ }
119
+ },
97
120
  width: {
98
121
  name: 'Width',
99
122
  description: 'Width of the control (in px / %)',
@@ -108,6 +131,24 @@ var _default = exports.default = {
108
131
  type: 'text'
109
132
  }
110
133
  },
134
+ barsMargin: {
135
+ name: 'Bars Margin',
136
+ description: 'Margin between the bars',
137
+ control: {
138
+ type: 'number',
139
+ min: 0,
140
+ max: 10
141
+ }
142
+ },
143
+ rightGap: {
144
+ name: 'Right Gap',
145
+ description: 'Right gap',
146
+ control: {
147
+ type: 'number',
148
+ min: 0,
149
+ max: 10
150
+ }
151
+ },
111
152
  textColor: {
112
153
  name: 'Text Color',
113
154
  description: 'Sets the text color',
@@ -144,13 +185,6 @@ var _default = exports.default = {
144
185
  control: {
145
186
  type: 'text'
146
187
  }
147
- },
148
- showPercentAsideValue: {
149
- name: 'Show Percent Aside Value',
150
- description: 'Show the percentage aside the value',
151
- control: {
152
- type: 'boolean'
153
- }
154
188
  }
155
189
  }
156
190
  };
@@ -162,13 +196,15 @@ const SalesGreenTheme = exports.SalesGreenTheme = {
162
196
  currencySign: true,
163
197
  currencyType: 'USD',
164
198
  chartsData: chartsData1,
199
+ showPercentAsideValue: true,
165
200
  labelFontSize: 12,
166
201
  labelLimitedLetters: 12,
167
- width: '390px',
168
- height: '260px',
202
+ width: '600px',
203
+ height: '360px',
204
+ barsMargin: 5,
205
+ rightGap: 1.5,
169
206
  textColor: '#212121',
170
- noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.',
171
- showPercentAsideValue: true
207
+ noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.'
172
208
  }
173
209
  };
174
210
  const SalesBlueTheme = exports.SalesBlueTheme = {
@@ -179,12 +215,14 @@ const SalesBlueTheme = exports.SalesBlueTheme = {
179
215
  currencySign: true,
180
216
  currencyType: 'USD',
181
217
  chartsData: chartsData2,
218
+ showPercentAsideValue: false,
182
219
  labelFontSize: 12,
183
220
  labelLimitedLetters: 15,
184
221
  width: '100%',
185
222
  height: '240px',
223
+ barsMargin: 50,
224
+ rightGap: 1.25,
186
225
  textColor: '#212121',
187
- noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.',
188
- showPercentAsideValue: false
226
+ noDataText: 'The selected event is a TPR or has no offer, therefore there is no redeemers data to display.'
189
227
  }
190
228
  };
@@ -4,17 +4,55 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.TitleAndValueContainer = exports.Title = exports.OutBanner = exports.Header = exports.FormattedValue = exports.CurrencySign = exports.ControlsContainer = exports.ChartWrapper = exports.ChartInner = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
7
+ exports.TotalValue = exports.Title = exports.CurrencySign = exports.ControlsContainer = exports.CardHeader = void 0;
9
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
11
- const scrollableStyles = "\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #E8E8E8;\n border-radius: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #D0D0D0;\n border-radius: 5px;\n }\n";
12
- const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n color: ", ";\n width: ", ";\n height: ", ";\n background-color: white;\n display: flex;\n flex-direction: column;\n // justify-content: center;\n .top {\n text-align: center;\n white-space: normal;\n &:before {\n display: none;\n }\n }\n"])), props => props.textColor, props => props.width, props => props.height);
13
- const ChartWrapper = exports.ChartWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n width: 100%;\n ", "\n"])), scrollableStyles);
14
- const ChartInner = exports.ChartInner = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n min-height: 120%;\n width: 100%;\n"])));
15
- const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n padding: 16px;\n"])));
16
- const Header = exports.Header = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)([""])));
17
- const Title = exports.Title = _styledComponents.default.h4(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 18px;\n font-weight: 400;\n line-height: 1;\n margin: 0 0 8px;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 12px;\n }\n"])));
18
- const FormattedValue = exports.FormattedValue = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 40px;\n display: flex;\n align-items: baseline;\n line-height: 1;\n @media (max-width: 1536px) {\n font-size: 24px;\n }\n @media (max-width: 1366px) {\n font-size: 20px;\n }\n"])));
19
- const OutBanner = exports.OutBanner = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 8px;\n align-items: baseline;\n font-size: 14px;\n font-weight: 400;\n color: ", ";\n cursor: pointer;\n @media (max-width: 1536px) {\n font-size: 10px;\n }\n @media (max-width: 1366px) {\n font-size: 8px;\n }\n > svg {\n width: 14px;\n height: 14px;\n @media (max-width: 1536px) {\n width: 12px;\n height: 12px;\n }\n @media (max-width: 1366px) {\n width: 8px;\n height: 8px;\n }\n }\n"])), props => props.textColor);
20
- const CurrencySign = exports.CurrencySign = _styledComponents.default.span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 14px;\n }\n @media (max-width: 1366px) {\n font-size: 11px;\n }\n"])));
9
+ const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div`
10
+ font-family: "Poppins", sans-serif;
11
+ position: relative;
12
+ background-color: white;
13
+ color: ${props => props.textColor};
14
+ width: ${props => props.width};
15
+ height: ${props => props.height};
16
+ `;
17
+ const CardHeader = exports.CardHeader = _styledComponents.default.div`
18
+ padding: 16px;
19
+ position: sticky;
20
+ top: 0;
21
+ z-index: 10;
22
+ background-color: white;
23
+ `;
24
+ const TotalValue = exports.TotalValue = _styledComponents.default.div`
25
+ font-weight: 500;
26
+ font-size: 40px;
27
+ display: flex;
28
+ align-items: baseline;
29
+ line-height: 1;
30
+ @media (max-width: 1536px) {
31
+ font-size: 24px;
32
+ }
33
+ @media (max-width: 1366px) {
34
+ font-size: 20px;
35
+ }
36
+ `;
37
+ const Title = exports.Title = _styledComponents.default.h4`
38
+ font-size: 18px;
39
+ font-weight: 400;
40
+ line-height: 1;
41
+ margin: 0 0 8px;
42
+ @media (max-width: 1536px) {
43
+ font-size: 14px;
44
+ }
45
+ @media (max-width: 1366px) {
46
+ font-size: 12px;
47
+ }
48
+ `;
49
+ const CurrencySign = exports.CurrencySign = _styledComponents.default.span`
50
+ font-weight: 500;
51
+ font-size: 16px;
52
+ @media (max-width: 1536px) {
53
+ font-size: 14px;
54
+ }
55
+ @media (max-width: 1366px) {
56
+ font-size: 11px;
57
+ }
58
+ `;
@@ -17,10 +17,10 @@ const Tooltip = props => {
17
17
  } = props;
18
18
  return /*#__PURE__*/_react.default.createElement(_TspanTooltip.TooltipContainer, {
19
19
  className: className,
20
- top: "".concat(top, "px"),
21
- left: "".concat(left, "px")
20
+ top: `${top}px`,
21
+ left: `${left}px`
22
22
  }, /*#__PURE__*/_react.default.createElement(_TspanTooltip.TooltipWrapper, null, /*#__PURE__*/_react.default.createElement(_TspanTooltip.TooltipTip, {
23
- className: "controls ".concat(direction || 'top')
23
+ className: `controls ${direction || 'top'}`
24
24
  }, content)));
25
25
  };
26
26
  var _default = exports.default = Tooltip;