sag_components 1.0.30 → 1.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/dist/App.js DELETED
@@ -1,111 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
9
- var _logo = _interopRequireDefault(require("./logo.svg"));
10
- require("./App.css");
11
- var _react = require("react");
12
- var _Button = _interopRequireDefault(require("./stories/components/Button"));
13
- var _Dropdown = _interopRequireDefault(require("./stories/components/Dropdown"));
14
- var _SegmentedButton = _interopRequireDefault(require("./stories/components/SegmentedButton"));
15
- var _TotalDoughnutChart = _interopRequireDefault(require("./stories/components/TotalDoughnutChart"));
16
- var _OneColumnContainer = _interopRequireDefault(require("./stories/components/OneColumnContainer"));
17
- var onChangehandler = function onChangehandler(event, newValue) {
18
- console.log("Dropdown onChange event returned:");
19
- console.log(newValue);
20
- };
21
- var onInputChangeHandler = function onInputChangeHandler(event, newInputValue) {
22
- console.log("Dropdown onInputChange event returned:");
23
- console.log(newInputValue);
24
- };
25
- function App() {
26
- var options = [{
27
- id: "1",
28
- label: "Shufersal"
29
- }, {
30
- id: "2",
31
- label: "EPC"
32
- }, {
33
- id: "3",
34
- label: "Food Lion"
35
- }, {
36
- id: "4",
37
- label: "Hannaford"
38
- }, {
39
- id: "5",
40
- label: "Giant Food"
41
- }, {
42
- id: "6",
43
- label: "The Giant Company"
44
- }, {
45
- id: "7",
46
- label: "Stop&Shop"
47
- }, {
48
- id: "8",
49
- label: "Price Chopper"
50
- }, {
51
- id: "9",
52
- label: "South Eastern Grocers"
53
- }];
54
- var segmentsArr1 = [{
55
- label: "Complete",
56
- value: "complete"
57
- }, {
58
- label: "Incomplete",
59
- value: "incomplete"
60
- }, {
61
- label: "Pending",
62
- value: "pending"
63
- }];
64
- var segmentsArr2 = [{
65
- label: "First",
66
- value: "first"
67
- }, {
68
- label: "Second",
69
- value: "second"
70
- }, {
71
- label: "Third",
72
- value: "third"
73
- }];
74
- var _useState = (0, _react.useState)("complete"),
75
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
76
- selectedValue1 = _useState2[0],
77
- setSelectedValue1 = _useState2[1];
78
- var _useState3 = (0, _react.useState)("complete"),
79
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
80
- selectedValue2 = _useState4[0],
81
- setSelectedValue2 = _useState4[1];
82
- return /*#__PURE__*/React.createElement("div", {
83
- className: "App"
84
- }, /*#__PURE__*/React.createElement(_OneColumnContainer.default, {
85
- height: "250px",
86
- infoText: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
87
- width: "250px"
88
- }), /*#__PURE__*/React.createElement(_TotalDoughnutChart.default, {
89
- currency: true,
90
- currencyType: "USD",
91
- dotCut: true,
92
- height: 374,
93
- legendData: [{
94
- color: "#85A1D2",
95
- currency: "USD",
96
- name: "Package Cost",
97
- value: 30000
98
- }, {
99
- color: "#9AE6FF",
100
- currency: "USD",
101
- name: "Redemption Cost",
102
- value: 6500
103
- }],
104
- textColor: "#212121",
105
- title: "Total Cost",
106
- value: 36500,
107
- width: 336
108
- }));
109
- }
110
- var _default = App;
111
- exports.default = _default;
package/dist/App.test.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _react = require("@testing-library/react");
5
- var _App = _interopRequireDefault(require("./App"));
6
- test('renders learn react link', function () {
7
- (0, _react.render)( /*#__PURE__*/React.createElement(_App.default, null));
8
- var linkElement = _react.screen.getByText(/learn react/i);
9
- expect(linkElement).toBeInTheDocument();
10
- });
@@ -1,122 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.LessAvarage = exports.GreaterAvarage = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _Benchmark = require("./components/Benchmark");
10
- var _default = {
11
- title: "SAG BI/Benchmark",
12
- component: _Benchmark.Benchmark,
13
- tags: ["autodocs"],
14
- argTypes: {
15
- currentValue: {
16
- name: "currentValue",
17
- control: {
18
- type: "number",
19
- min: 0,
20
- max: 100000000000000
21
- },
22
- description: "curent value (<=100%) "
23
- },
24
- totalValue: {
25
- name: "totalValue",
26
- control: {
27
- type: "number",
28
- min: 0,
29
- max: 100000000000000
30
- },
31
- description: "total value (100%) "
32
- },
33
- width: {
34
- name: "width",
35
- control: {
36
- type: "number",
37
- min: 0,
38
- max: 600
39
- },
40
- description: "width of the control (in px)"
41
- },
42
- height: {
43
- name: "height",
44
- control: {
45
- type: "number",
46
- min: 0,
47
- max: 600
48
- },
49
- description: "height of the control (in px)"
50
- },
51
- color: {
52
- name: "color",
53
- description: "Sets the color of current value when it is greater then 50% of total value",
54
- control: {
55
- type: "color",
56
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
57
- }
58
- },
59
- linearGradientColor: {
60
- name: "linearGradientColor",
61
- description: "Sets the linear-Gradient color of current value when it is greater then 50% of total value",
62
- control: {
63
- type: "color",
64
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
65
- }
66
- },
67
- underAvarageColor: {
68
- name: "underAvarageColor",
69
- description: "Sets the color of current value when it is under 50% of total value",
70
- control: {
71
- type: "color",
72
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
73
- }
74
- },
75
- linearGradientUnderAvarageColor: {
76
- name: "linearGradientUnderAvarageColor",
77
- description: "Sets the linear-Gradient color of current value when it is under 50% of total value",
78
- control: {
79
- type: "color",
80
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
81
- }
82
- },
83
- backgroundColor: {
84
- name: "backgroundColor",
85
- description: "Sets the background color of the control",
86
- control: {
87
- type: "color",
88
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
89
- }
90
- }
91
- }
92
- };
93
- exports.default = _default;
94
- var Template = function Template(args) {
95
- return /*#__PURE__*/_react.default.createElement(_Benchmark.Benchmark, args);
96
- };
97
- var GreaterAvarage = Template.bind({});
98
- exports.GreaterAvarage = GreaterAvarage;
99
- GreaterAvarage.args = {
100
- totalValue: 100000,
101
- currentValue: 60000,
102
- width: 100,
103
- height: 12,
104
- color: "#79DB95",
105
- linearGradientColor: "#C3EFD0",
106
- underAvarageColor: "#FD5959",
107
- linearGradientUnderAvarageColor: "#FDB1B1",
108
- backgroundColor: "#F2F2F2"
109
- };
110
- var LessAvarage = Template.bind({});
111
- exports.LessAvarage = LessAvarage;
112
- LessAvarage.args = {
113
- totalValue: 1000,
114
- currentValue: 400,
115
- width: 100,
116
- height: 12,
117
- color: "#79DB95",
118
- linearGradientColor: "#C3EFD0",
119
- underAvarageColor: "#FD5959",
120
- linearGradientUnderAvarageColor: "#FDB1B1",
121
- backgroundColor: "#F2F2F2"
122
- };
@@ -1,117 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.SmallContainedStyle = exports.MediumOutlinedStyle = exports.LargeTextStyle = exports.DisabledContainedStyle = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _Button = require("./components/Button");
10
- // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
11
- var _default = {
12
- title: "SAG/Button",
13
- component: _Button.Button,
14
- tags: ["autodocs"],
15
- argTypes: {
16
- text: {
17
- name: "text",
18
- control: {
19
- type: "text"
20
- },
21
- description: "text inside of the button",
22
- defaultValue: ""
23
- },
24
- shape: {
25
- control: {
26
- type: "radio"
27
- },
28
- options: ["contained", "outlined", "text"],
29
- description: "shape of the button"
30
- },
31
- radius: {
32
- name: "radius",
33
- control: {
34
- type: "number"
35
- },
36
- description: "radius of the button",
37
- defaultValue: 50
38
- },
39
- size: {
40
- control: {
41
- type: "radio"
42
- },
43
- options: ["small", "medium", "large"],
44
- description: "size of the button"
45
- },
46
- disabled: {
47
- name: "disabled",
48
- control: {
49
- type: "boolean"
50
- },
51
- description: "changes the button to be enabled/disabled",
52
- defaultValue: ""
53
- },
54
- backgroundColor: {
55
- control: {
56
- type: "color",
57
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"],
58
- description: "Sets Background Color"
59
- }
60
- },
61
- textColor: {
62
- control: {
63
- type: "select"
64
- },
65
- options: ["none", "inherit", "black", "green", "red", "yellow", "blue", "white"],
66
- description: "text color of the button"
67
- },
68
- onClick: {
69
- action: "onClick",
70
- description: "returns an event click object when user clicks on a button"
71
- }
72
- }
73
- };
74
- exports.default = _default;
75
- var Template = function Template(args) {
76
- return /*#__PURE__*/_react.default.createElement(_Button.Button, args);
77
- };
78
- var SmallContainedStyle = Template.bind({});
79
- exports.SmallContainedStyle = SmallContainedStyle;
80
- SmallContainedStyle.args = {
81
- text: "Confirm",
82
- shape: "contained",
83
- radius: 50,
84
- size: "small",
85
- textColor: "none",
86
- disabled: false
87
- };
88
- var DisabledContainedStyle = Template.bind({});
89
- exports.DisabledContainedStyle = DisabledContainedStyle;
90
- DisabledContainedStyle.args = {
91
- size: "small",
92
- text: "Confirm",
93
- shape: "contained",
94
- radius: 50,
95
- textColor: "inherit",
96
- disabled: true
97
- };
98
- var MediumOutlinedStyle = Template.bind({});
99
- exports.MediumOutlinedStyle = MediumOutlinedStyle;
100
- MediumOutlinedStyle.args = {
101
- text: "Confirm",
102
- size: "medium",
103
- radius: 50,
104
- shape: "outlined",
105
- textColor: "",
106
- disabled: false
107
- };
108
- var LargeTextStyle = Template.bind({});
109
- exports.LargeTextStyle = LargeTextStyle;
110
- LargeTextStyle.args = {
111
- text: "Confirm",
112
- size: "large",
113
- radius: 50,
114
- shape: "text",
115
- textColor: "inherit",
116
- disabled: false
117
- };
@@ -1,252 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.UpDownArrowIcon = exports.SmallSquare = exports.SmallRound = exports.SearchIcon = exports.MultiSelectWithIcons = exports.MultiSelectSmall = exports.MultiSelectLarge = exports.LargeSquareWithIcons = exports.LargeRoundWithoutIcons = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _Dropdown = require("./components/Dropdown");
10
- var options = [{
11
- id: 0,
12
- label: "Shufersal"
13
- }, {
14
- id: 1,
15
- label: "EPC"
16
- }, {
17
- id: 2,
18
- label: "Food Lion"
19
- }, {
20
- id: 3,
21
- label: "Hannaford"
22
- }, {
23
- id: 4,
24
- label: "Giant Food"
25
- }, {
26
- id: 5,
27
- label: "The Giant Company"
28
- }, {
29
- id: 6,
30
- label: "Stop&Shop"
31
- }, {
32
- id: 7,
33
- label: "Price Chopper"
34
- }, {
35
- id: 8,
36
- label: "South Eastern Grocers"
37
- }];
38
-
39
- // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
40
- var _default = {
41
- title: "SAG/Dropdown",
42
- component: _Dropdown.Dropdown,
43
- tags: ["autodocs"],
44
- argTypes: {
45
- width: {
46
- control: {
47
- type: "number"
48
- },
49
- description: "width of the input field",
50
- defaultValue: 300
51
- },
52
- size: {
53
- control: {
54
- type: "radio"
55
- },
56
- options: ["small", "large"],
57
- description: "size: small/large"
58
- },
59
- text: {
60
- name: "text",
61
- control: {
62
- type: "text"
63
- },
64
- description: "text inside of the input field",
65
- defaultValue: 'Search...'
66
- },
67
- placeHolder: {
68
- name: "placeHolder",
69
- control: {
70
- type: "text"
71
- },
72
- description: "notify the user how to type a text",
73
- defaultValue: "Type..."
74
- },
75
- multiSelect: {
76
- name: "multiSelect",
77
- // control: { type: "boolean",
78
- // },
79
- control: false,
80
- description: "true/false - allows multi select - (switch multiSelect / singleSelect is disabled in this story)"
81
- },
82
- limitTagsOnMultiSelect: {
83
- name: "limitTagsOnMultiSelect",
84
- control: {
85
- type: "number"
86
- },
87
- description: "limit noumber displayed tags on multi select when not focused"
88
- },
89
- options: {
90
- description: "array [] of objects: {id: string1 , label: string2 } to fill dropdown options "
91
- },
92
- shape: {
93
- control: {
94
- type: "radio"
95
- },
96
- options: ["round", "square"],
97
- description: "shape: round/square"
98
- },
99
- showPopupIcon: {
100
- name: "showPopupIcon",
101
- control: {
102
- type: "boolean"
103
- },
104
- description: "show/hide popup (up/down arrow) icon"
105
- },
106
- showSearchIcon: {
107
- name: "showSearchIcon",
108
- control: {
109
- type: "boolean"
110
- },
111
- description: "show/hide search icon "
112
- },
113
- onChange: {
114
- action: "onChange",
115
- description: "returns an option (object) selected by the user"
116
- },
117
- onInputChange: {
118
- action: "onInputChange",
119
- description: "returns a value (string) displayed in the textbox"
120
- }
121
- }
122
- };
123
- exports.default = _default;
124
- var Template = function Template(args) {
125
- return /*#__PURE__*/_react.default.createElement(_Dropdown.Dropdown, args);
126
- };
127
- var SmallSquare = Template.bind({});
128
- exports.SmallSquare = SmallSquare;
129
- SmallSquare.args = {
130
- width: 300,
131
- size: "small",
132
- text: "Retailer",
133
- multiSelect: false,
134
- limitTagsOnMultiSelect: 0,
135
- placeHolder: "Type...",
136
- shape: "square",
137
- showPopupIcon: false,
138
- showSearchIcon: false,
139
- options: options
140
- };
141
- var SmallRound = Template.bind({});
142
- exports.SmallRound = SmallRound;
143
- SmallRound.args = {
144
- width: 300,
145
- size: "small",
146
- text: "Retailer",
147
- multiSelect: false,
148
- limitTagsOnMultiSelect: 0,
149
- placeHolder: "Type...",
150
- shape: "round",
151
- showPopupIcon: false,
152
- showSearchIcon: false,
153
- options: options
154
- };
155
- var UpDownArrowIcon = Template.bind({});
156
- exports.UpDownArrowIcon = UpDownArrowIcon;
157
- UpDownArrowIcon.args = {
158
- width: 300,
159
- size: "small",
160
- text: "Retailer",
161
- multiSelect: false,
162
- limitTagsOnMultiSelect: 0,
163
- placeHolder: "Type...",
164
- shape: "round",
165
- showPopupIcon: true,
166
- showSearchIcon: false,
167
- options: options
168
- };
169
- var SearchIcon = Template.bind({});
170
- exports.SearchIcon = SearchIcon;
171
- SearchIcon.args = {
172
- width: 300,
173
- size: "small",
174
- text: "Retailer",
175
- multiSelect: false,
176
- limitTagsOnMultiSelect: 0,
177
- placeHolder: "Type...",
178
- shape: "round",
179
- showPopupIcon: false,
180
- showSearchIcon: true,
181
- options: options
182
- };
183
- var MultiSelectSmall = Template.bind({});
184
- exports.MultiSelectSmall = MultiSelectSmall;
185
- MultiSelectSmall.args = {
186
- width: 400,
187
- size: "small",
188
- text: "Retailer",
189
- multiSelect: true,
190
- limitTagsOnMultiSelect: 2,
191
- placeHolder: "Type...",
192
- shape: "square",
193
- showPopupIcon: false,
194
- showSearchIcon: false,
195
- options: options
196
- };
197
- var MultiSelectLarge = Template.bind({});
198
- exports.MultiSelectLarge = MultiSelectLarge;
199
- MultiSelectLarge.args = {
200
- width: 500,
201
- size: "large",
202
- text: "Retailer",
203
- multiSelect: true,
204
- limitTagsOnMultiSelect: 2,
205
- placeHolder: "Type...",
206
- shape: "round",
207
- showPopupIcon: false,
208
- showSearchIcon: false,
209
- options: options
210
- };
211
- var MultiSelectWithIcons = Template.bind({});
212
- exports.MultiSelectWithIcons = MultiSelectWithIcons;
213
- MultiSelectWithIcons.args = {
214
- width: 500,
215
- size: "large",
216
- text: "Retailer",
217
- multiSelect: true,
218
- limitTagsOnMultiSelect: 2,
219
- placeHolder: "Type...",
220
- shape: "square",
221
- showPopupIcon: true,
222
- showSearchIcon: true,
223
- options: options
224
- };
225
- var LargeRoundWithoutIcons = Template.bind({});
226
- exports.LargeRoundWithoutIcons = LargeRoundWithoutIcons;
227
- LargeRoundWithoutIcons.args = {
228
- width: 400,
229
- size: "large",
230
- text: "Retailer",
231
- multiSelect: false,
232
- limitTagsOnMultiSelect: 0,
233
- placeHolder: "Type part of name...",
234
- shape: "round",
235
- showPopupIcon: false,
236
- showSearchIcon: false,
237
- options: options
238
- };
239
- var LargeSquareWithIcons = Template.bind({});
240
- exports.LargeSquareWithIcons = LargeSquareWithIcons;
241
- LargeSquareWithIcons.args = {
242
- width: 400,
243
- size: "large",
244
- text: "Retailer",
245
- multiSelect: false,
246
- limitTagsOnMultiSelect: 0,
247
- placeHolder: "Type part of name...",
248
- shape: "square",
249
- showPopupIcon: true,
250
- showSearchIcon: true,
251
- options: options
252
- };
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.Primary = void 0;
7
- var _OneColumnContainer = require("./components/OneColumnContainer");
8
- // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
9
- var _default = {
10
- title: 'Sag BI/OneColumnContainer',
11
- component: _OneColumnContainer.OneColumnContainer,
12
- tags: ['autodocs']
13
- }; // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
14
- exports.default = _default;
15
- var Primary = {
16
- args: {
17
- infoText: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s",
18
- width: "250px",
19
- height: "250px"
20
- }
21
- };
22
- exports.Primary = Primary;
@@ -1,187 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.SegmentedFilter = exports.Period = exports.DollarsOrUnits = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _SegmentedButton = require("./components/SegmentedButton");
10
- var arrSegmentedFilters = [{
11
- value: "Total"
12
- }, {
13
- value: "Ecommerce"
14
- }, {
15
- value: "In Store"
16
- }];
17
- var arrDollarsOrUnits = [{
18
- value: "Dollars"
19
- }, {
20
- value: "Units"
21
- }];
22
- var arrPeriod = [{
23
- value: "52 w"
24
- }, {
25
- value: "26 w"
26
- }, {
27
- value: "13 w"
28
- }];
29
- var _default = {
30
- title: "SAG/SegmentedButton",
31
- component: _SegmentedButton.SegmentedButton,
32
- tags: ["autodocs"],
33
- argTypes: {
34
- name: {
35
- name: "name",
36
- control: {
37
- type: "text"
38
- },
39
- description: "name of the object"
40
- },
41
- backgroundColor: {
42
- name: "backgroundColor",
43
- description: "Sets Background Color",
44
- control: {
45
- type: "color",
46
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
47
- }
48
- },
49
- selectedSegmentColor: {
50
- name: "selectedSegmentColor",
51
- description: "Sets selected Segment Color Color",
52
- control: {
53
- type: "color",
54
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
55
- }
56
- },
57
- selectedTextColor: {
58
- name: "selectedTextColor",
59
- description: "Sets selected text Color",
60
- control: {
61
- type: "color",
62
- presetColors: ["#000000", "#ffffff", "#ff0000", "#00ff00", "#0000ff"]
63
- }
64
- },
65
- unselectedTextColor: {
66
- name: "unselectedTextColor",
67
- description: "Sets unselected text Color",
68
- control: {
69
- type: "color",
70
- presetColors: ["#000000", "#ffffff", "#ff0000", "#00ff00", "#0000ff"]
71
- }
72
- },
73
- defaultIndex: {
74
- name: "defaultIndex",
75
- control: {
76
- type: "number",
77
- min: 0,
78
- max: 20
79
- },
80
- description: "set default index to init segmented button component (in px)"
81
- },
82
- segmentWidth: {
83
- name: "segmentWidth",
84
- control: {
85
- type: "number",
86
- min: 0,
87
- max: 300
88
- },
89
- description: "width of the segment in the control (in px)"
90
- },
91
- controlRadius: {
92
- name: "controlRadius",
93
- control: {
94
- type: "number",
95
- min: 0,
96
- max: 40
97
- },
98
- description: "radius of the control corners (in px) "
99
- },
100
- segmentRadius: {
101
- name: "segmentRadius",
102
- control: {
103
- type: "number",
104
- min: 0,
105
- max: 40
106
- },
107
- description: "radius of the selected segment corners (in px)"
108
- },
109
- segmentHeigth: {
110
- name: "segmentHeigth",
111
- control: {
112
- type: "number",
113
- min: 0,
114
- max: 100
115
- },
116
- description: "height of the segments "
117
- },
118
- fontSize: {
119
- name: "fontSize",
120
- control: {
121
- type: "number",
122
- min: 9,
123
- max: 40
124
- },
125
- description: "font size (in px)"
126
- },
127
- options: {
128
- description: "array [] of objects: {value: string } to fill segmented buttons "
129
- },
130
- onClick: {
131
- action: "onClick",
132
- description: "onClick event - returns an object of selected button {index: number, value: string} "
133
- }
134
- }
135
- };
136
- exports.default = _default;
137
- var Template = function Template(args) {
138
- return /*#__PURE__*/_react.default.createElement(_SegmentedButton.SegmentedButton, args);
139
- };
140
- var SegmentedFilter = Template.bind({});
141
- exports.SegmentedFilter = SegmentedFilter;
142
- SegmentedFilter.args = {
143
- name: "segmentedFilter",
144
- options: arrSegmentedFilters,
145
- defaultIndex: 0,
146
- segmentWidth: 120,
147
- controlRadius: 8,
148
- segmentRadius: 8,
149
- segmentHeigth: 40,
150
- fontSize: 14,
151
- backgroundColor: "#ECF0FF",
152
- selectedSegmentColor: '#fcfcfc',
153
- selectedTextColor: '#000000',
154
- unselectedTextColor: '#000000'
155
- };
156
- var DollarsOrUnits = Template.bind({});
157
- exports.DollarsOrUnits = DollarsOrUnits;
158
- DollarsOrUnits.args = {
159
- name: "segmentedDollarsOrUnits",
160
- options: arrDollarsOrUnits,
161
- defaultIndex: 1,
162
- segmentWidth: 100,
163
- controlRadius: 8,
164
- segmentRadius: 8,
165
- segmentHeigth: 40,
166
- fontSize: 14,
167
- backgroundColor: "#ECF0FF",
168
- selectedSegmentColor: 'rgba(61, 154, 242, 0.83)',
169
- selectedTextColor: '#ffffff',
170
- unselectedTextColor: '#000000'
171
- };
172
- var Period = Template.bind({});
173
- exports.Period = Period;
174
- Period.args = {
175
- name: "period",
176
- options: arrPeriod,
177
- defaultIndex: 1,
178
- segmentWidth: 60,
179
- controlRadius: 8,
180
- segmentRadius: 8,
181
- segmentHeigth: 41,
182
- fontSize: 14,
183
- backgroundColor: "#ECF0FF",
184
- selectedSegmentColor: 'rgba(61, 154, 242, 0.83)',
185
- selectedTextColor: '#ffffff',
186
- unselectedTextColor: '#000000'
187
- };
@@ -1,136 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.TotalCost3rows = exports.TotalCost = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _TotalDoughnutChart = require("./components/TotalDoughnutChart");
10
- var arrLegendData = [{
11
- name: "Package Cost",
12
- value: 30000,
13
- color: "#85A1D2"
14
- }, {
15
- name: "Redemption Cost",
16
- value: 6500,
17
- color: "#9AE6FF"
18
- }];
19
- var arrLegendDat3rows = [{
20
- name: "Package Cost",
21
- value: 30000,
22
- color: "#85A1D2"
23
- }, {
24
- name: "Existing Redeemers",
25
- value: 6500,
26
- color: "#9AE6FF"
27
- }, {
28
- name: "Others",
29
- value: 20000,
30
- color: "#FD5959"
31
- }
32
- // { name: "My test 2", value: 35000, color: "#79DB95"},
33
- ];
34
- var _default = {
35
- title: "SAG BI/TotalDoughnutChart",
36
- component: _TotalDoughnutChart.TotalDoughnutChart,
37
- tags: ["autodocs"],
38
- argTypes: {
39
- title: {
40
- name: "title",
41
- control: {
42
- type: "text"
43
- },
44
- description: "title on top of the component"
45
- },
46
- value: {
47
- name: "value",
48
- control: {
49
- type: "number",
50
- min: 0,
51
- max: 100000000000000
52
- },
53
- description: "value (total) "
54
- },
55
- dotCut: {
56
- name: "dotCut",
57
- control: {
58
- type: "boolean"
59
- },
60
- description: "true/false - format total value with dot cut"
61
- },
62
- currency: {
63
- name: "currency",
64
- control: {
65
- type: "boolean"
66
- },
67
- description: "true/false - show/hide currency before total value"
68
- },
69
- currencyType: {
70
- name: "currencyType",
71
- options: ["USD", "EUR", "ILS", "GBP", "JPY"],
72
- control: {
73
- type: "select"
74
- }
75
- },
76
- width: {
77
- name: "width",
78
- control: {
79
- type: "number",
80
- min: 0,
81
- max: 600
82
- },
83
- description: "width of the control (in px)"
84
- },
85
- height: {
86
- name: "height",
87
- control: {
88
- type: "number",
89
- min: 0,
90
- max: 600
91
- },
92
- description: "height of the control (in px)"
93
- },
94
- textColor: {
95
- name: "textColor",
96
- description: "Sets the text color",
97
- control: {
98
- type: "color",
99
- presetColors: ["#ffffff", "#ff0000", "#00ff00", "#0000ff"]
100
- }
101
- },
102
- legendData: {
103
- description: "array [] of objects: {displayName: string, value:number} to fill the pie chart "
104
- }
105
- }
106
- };
107
- exports.default = _default;
108
- var Template = function Template(args) {
109
- return /*#__PURE__*/_react.default.createElement(_TotalDoughnutChart.TotalDoughnutChart, args);
110
- };
111
- var TotalCost = Template.bind({});
112
- exports.TotalCost = TotalCost;
113
- TotalCost.args = {
114
- title: "Total Cost",
115
- value: 36500,
116
- dotCut: true,
117
- currency: true,
118
- currencyType: "USD",
119
- legendData: arrLegendData,
120
- width: 260,
121
- height: 350,
122
- textColor: "#212121"
123
- };
124
- var TotalCost3rows = Template.bind({});
125
- exports.TotalCost3rows = TotalCost3rows;
126
- TotalCost3rows.args = {
127
- title: "Total Cost",
128
- value: 56500,
129
- dotCut: true,
130
- currency: true,
131
- currencyType: "USD",
132
- legendData: arrLegendDat3rows,
133
- width: 260,
134
- height: 350,
135
- textColor: "#212121"
136
- };