sag_components 1.0.737 → 1.0.739

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.
@@ -4,16 +4,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
7
+ exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
11
11
  const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n color: #212121;\n width: ", ";\n height: ", ";\n min-width: 250px;\n"])), props => props.width, props => props.height);
12
- const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n background: #ffffff;\n"])));
12
+ const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n background: white;\n display: flex;\n flex-direction: column;\n"])));
13
13
  const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 5px;\n padding: 8px 12px;\n background: white;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n margin: 0;\n"])));
14
14
  const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n width: fit-content;\n"])));
15
- const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 600;\n line-height: normal;\n"])));
16
- const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 1rem;\n"])));
17
- const Title = exports.Title = _styledComponents.default.h5(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 18px;\n line-height: 20px;\n margin: 0 0 30px;\n @media (max-width: 1536px) {\n font-size: 16px;\n margin: 0 0 20px;\n }\n @media (max-width: 1366px) {\n font-size: 14px;\n }\n"])));
18
- const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 12px;\n }\n"])));
19
- const LabelText = exports.LabelText = _styledComponents.default.tspan(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 10px;\n }\n @media (max-width: 1366px) {\n font-size: 8px;\n }\n"])));
15
+ const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 600;\n"])));
16
+ const Title = exports.Title = _styledComponents.default.h5(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 18px;\n line-height: 20px;\n margin: 0 0 30px;\n @media (max-width: 1536px) {\n font-size: 16px;\n margin: 0 0 20px;\n }\n @media (max-width: 1366px) {\n font-size: 14px;\n }\n"])));
17
+ const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 12px;\n }\n"])));
18
+ const LabelText = exports.LabelText = _styledComponents.default.tspan(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 10px;\n }\n @media (max-width: 1366px) {\n font-size: 8px;\n }\n"])));
@@ -30,7 +30,11 @@ const TwoBarCharts = props => {
30
30
  barChartColorFirst,
31
31
  barChartColorSecond,
32
32
  showLegend,
33
- legendData
33
+ legendData,
34
+ showReferenceLine,
35
+ referenceLinePoint,
36
+ referenceLineColor,
37
+ referenceLineDashed
34
38
  } = props;
35
39
  const controlsContainerRef = (0, _react.useRef)();
36
40
  const displayFormattedValue = value => {
@@ -105,20 +109,12 @@ const TwoBarCharts = props => {
105
109
  };
106
110
  return /*#__PURE__*/_react.default.createElement(_TwoBarCharts.ControlsContainer, {
107
111
  className: className,
108
- id: "ControlsContainer",
109
112
  height: height,
110
113
  width: width,
111
114
  ref: controlsContainerRef
112
- }, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.Controls, {
113
- id: "Controls"
114
- }, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.TitleAndValueContainer, {
115
- id: "TitleAndValueContainer"
116
- }, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.Title, {
117
- id: "Title"
118
- }, title)), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
119
- id: "ResponsiveContainer",
115
+ }, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.Controls, null, /*#__PURE__*/_react.default.createElement(_TwoBarCharts.Title, null, title), /*#__PURE__*/_react.default.createElement(_recharts.ResponsiveContainer, {
120
116
  width: "100%",
121
- height: showLegend ? '80%' : '86%'
117
+ height: "100%"
122
118
  }, /*#__PURE__*/_react.default.createElement(_recharts.BarChart, {
123
119
  width: width,
124
120
  height: height,
@@ -126,10 +122,14 @@ const TwoBarCharts = props => {
126
122
  margin: {
127
123
  top: 20,
128
124
  right: 0,
129
- bottom: -25,
125
+ bottom: 0,
130
126
  left: -5
131
127
  }
132
- }, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
128
+ }, showReferenceLine && /*#__PURE__*/_react.default.createElement(_recharts.ReferenceLine, {
129
+ y: referenceLinePoint,
130
+ stroke: referenceLineColor,
131
+ strokeDasharray: referenceLineDashed
132
+ }), /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
133
133
  dataKey: "title",
134
134
  tick: CustomizedTickBarChart,
135
135
  tickLine: false,
@@ -200,5 +200,9 @@ TwoBarCharts.defaultProps = {
200
200
  title: 'Incremental Sales',
201
201
  iconType: ICON_TYPE_SQUARE,
202
202
  iconColor: '#BD9EFF'
203
- }]
203
+ }],
204
+ showReferenceLine: false,
205
+ referenceLinePoint: 0,
206
+ referenceLineColor: '#212121',
207
+ referenceLineDashed: '5'
204
208
  };
@@ -4,16 +4,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.TitleAndValueContainer = exports.Title = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
7
+ exports.TooltipTitle = exports.TooltipLabel = exports.TooltipDiv = exports.Title = exports.LabelText = exports.LabelBoldText = exports.ControlsContainer = exports.Controls = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
9
9
  var _styledComponents = _interopRequireDefault(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
11
11
  const ControlsContainer = exports.ControlsContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n font-family: \"Poppins\", sans-serif;\n color: #212121;\n width: ", ";\n height: ", ";\n min-width: 250px;\n"])), props => props.width, props => props.height);
12
- const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n background: #ffffff;\n"])));
12
+ const Controls = exports.Controls = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n width: 100%;\n background: white;\n display: flex;\n flex-direction: column;\n"])));
13
13
  const TooltipDiv = exports.TooltipDiv = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 5px;\n padding: 8px 12px;\n background: white;\n box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2);\n margin: 0;\n"])));
14
14
  const TooltipLabel = exports.TooltipLabel = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n width: fit-content;\n"])));
15
- const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 600;\n line-height: normal;\n"])));
16
- const TitleAndValueContainer = exports.TitleAndValueContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 1rem;\n"])));
17
- const Title = exports.Title = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-family: \"Poppins\", sans-serif;\n font-weight: 500;\n font-size: 18px;\n line-height: 20px;\n @media (max-width: 1536px) {\n font-size: 16px;\n }\n @media (max-width: 1366px) {\n font-size: 14px;\n }\n\n"])));
18
- const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 12px;\n }\n"])));
19
- const LabelText = exports.LabelText = _styledComponents.default.tspan(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 10px;\n }\n @media (max-width: 1366px) {\n font-size: 8px;\n }\n"])));
15
+ const TooltipTitle = exports.TooltipTitle = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: #212121;\n font-size: 14px;\n font-weight: 600;\n"])));
16
+ const Title = exports.Title = _styledComponents.default.h5(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 500;\n font-size: 18px;\n line-height: 20px;\n margin: 0 0 30px;\n @media (max-width: 1536px) {\n font-size: 16px;\n margin: 0 0 20px;\n }\n @media (max-width: 1366px) {\n font-size: 14px;\n }\n"])));
17
+ const LabelBoldText = exports.LabelBoldText = _styledComponents.default.tspan(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 12px;\n }\n"])));
18
+ const LabelText = exports.LabelText = _styledComponents.default.tspan(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 16px;\n @media (max-width: 1536px) {\n font-size: 10px;\n }\n @media (max-width: 1366px) {\n font-size: 8px;\n }\n"])));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.737",
3
+ "version": "1.0.739",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {