@scality/core-ui 0.166.0 → 0.167.0

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 (104) hide show
  1. package/.storybook/preview.js +6 -4
  2. package/README.md +27 -80
  3. package/dist/components/barchart/BarChart.component.d.ts +5 -0
  4. package/dist/components/barchart/BarChart.component.d.ts.map +1 -1
  5. package/dist/components/barchart/BarChart.component.js +5 -0
  6. package/dist/components/button/Button.component.d.ts +2 -1
  7. package/dist/components/button/Button.component.d.ts.map +1 -1
  8. package/dist/components/button/Button.component.js +2 -1
  9. package/dist/components/chartlegend/ChartLegend.d.ts.map +1 -1
  10. package/dist/components/chartlegend/ChartLegend.js +7 -13
  11. package/dist/components/chartlegend/ChartLegendWrapper.d.ts +1 -2
  12. package/dist/components/chartlegend/ChartLegendWrapper.d.ts.map +1 -1
  13. package/dist/components/chartlegend/ChartLegendWrapper.js +4 -9
  14. package/dist/components/icon/Icon.component.d.ts +9 -11
  15. package/dist/components/icon/Icon.component.d.ts.map +1 -1
  16. package/dist/components/icon/Icon.component.js +2 -0
  17. package/dist/components/linetemporalchart/ChartUtil.d.ts +3 -2
  18. package/dist/components/linetemporalchart/ChartUtil.d.ts.map +1 -1
  19. package/dist/components/linetemporalchart/ChartUtil.js +24 -20
  20. package/dist/components/linetemporalchart/LineTemporalChart.component.d.ts +4 -0
  21. package/dist/components/linetemporalchart/LineTemporalChart.component.d.ts.map +1 -1
  22. package/dist/components/linetemporalchart/LineTemporalChart.component.js +4 -0
  23. package/dist/components/linetimeseriechart/linetimeseriechart.component.d.ts +1 -1
  24. package/dist/components/linetimeseriechart/linetimeseriechart.component.d.ts.map +1 -1
  25. package/dist/index.d.ts +1 -11
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +0 -11
  28. package/dist/next.d.ts +1 -0
  29. package/dist/next.d.ts.map +1 -1
  30. package/jest.config.js +1 -0
  31. package/package.json +16 -37
  32. package/src/lib/components/barchart/BarChart.component.tsx +5 -0
  33. package/src/lib/components/button/Button.component.tsx +2 -1
  34. package/src/lib/components/chartlegend/ChartLegend.test.tsx +17 -0
  35. package/src/lib/components/chartlegend/ChartLegend.tsx +6 -12
  36. package/src/lib/components/chartlegend/ChartLegendWrapper.tsx +5 -13
  37. package/src/lib/components/icon/Icon.component.tsx +12 -1
  38. package/src/lib/components/linetemporalchart/ChartUtil.test.ts +23 -35
  39. package/src/lib/components/linetemporalchart/ChartUtil.ts +32 -26
  40. package/src/lib/components/linetemporalchart/LineTemporalChart.component.tsx +19 -15
  41. package/src/lib/components/linetimeseriechart/linetimeseriechart.component.tsx +5 -5
  42. package/src/lib/components/selectv2/selectv2.test.tsx +1 -1
  43. package/src/lib/components/toast/useMutationsHandler.test.tsx +22 -32
  44. package/src/lib/index.ts +6 -11
  45. package/src/lib/next.ts +1 -0
  46. package/stories/barchart.stories.tsx +1 -1
  47. package/stories/card.stories.tsx +7 -5
  48. package/stories/controls.ts +19 -20
  49. package/stories/linecharttemporal.stories.tsx +1 -1
  50. package/stories/linetimeseriechart.stories.tsx +49 -0
  51. package/stories/navbar.stories.tsx +103 -0
  52. package/stories/tabsv2.stories.tsx +51 -56
  53. package/dist/components/areachart/AreaChart.component.d.ts +0 -13
  54. package/dist/components/areachart/AreaChart.component.d.ts.map +0 -1
  55. package/dist/components/areachart/AreaChart.component.js +0 -27
  56. package/dist/components/chips/Chips.component.d.ts +0 -21
  57. package/dist/components/chips/Chips.component.d.ts.map +0 -1
  58. package/dist/components/chips/Chips.component.js +0 -105
  59. package/dist/components/cloudprogressbar/CloudProgressBar.component.d.ts +0 -10
  60. package/dist/components/cloudprogressbar/CloudProgressBar.component.d.ts.map +0 -1
  61. package/dist/components/cloudprogressbar/CloudProgressBar.component.js +0 -38
  62. package/dist/components/collapsiblepanel/CollapsiblePanel.component.d.ts +0 -9
  63. package/dist/components/collapsiblepanel/CollapsiblePanel.component.d.ts.map +0 -1
  64. package/dist/components/collapsiblepanel/CollapsiblePanel.component.js +0 -44
  65. package/dist/components/linechart/LineChart.component.d.ts +0 -21
  66. package/dist/components/linechart/LineChart.component.d.ts.map +0 -1
  67. package/dist/components/linechart/LineChart.component.js +0 -109
  68. package/dist/components/multiselect/MultiSelect.component.d.ts +0 -28
  69. package/dist/components/multiselect/MultiSelect.component.d.ts.map +0 -1
  70. package/dist/components/multiselect/MultiSelect.component.js +0 -73
  71. package/dist/components/select/Select.component.d.ts +0 -14
  72. package/dist/components/select/Select.component.d.ts.map +0 -1
  73. package/dist/components/select/Select.component.js +0 -71
  74. package/dist/components/spacedbox/SpacedBox.d.ts +0 -34
  75. package/dist/components/spacedbox/SpacedBox.d.ts.map +0 -1
  76. package/dist/components/spacedbox/SpacedBox.js +0 -64
  77. package/dist/components/sparkline/SparkLine.component.d.ts +0 -18
  78. package/dist/components/sparkline/SparkLine.component.d.ts.map +0 -1
  79. package/dist/components/sparkline/SparkLine.component.js +0 -148
  80. package/dist/components/vegachart/VegaChart.component.d.ts +0 -13
  81. package/dist/components/vegachart/VegaChart.component.d.ts.map +0 -1
  82. package/dist/components/vegachart/VegaChart.component.js +0 -120
  83. package/plopfile.js +0 -38
  84. package/src/lib/components/areachart/AreaChart.component.tsx +0 -49
  85. package/src/lib/components/chips/Chips.component.tsx +0 -169
  86. package/src/lib/components/cloudprogressbar/CloudProgressBar.component.tsx +0 -105
  87. package/src/lib/components/collapsiblepanel/CollapsiblePanel.component.tsx +0 -77
  88. package/src/lib/components/linechart/LineChart.component.tsx +0 -152
  89. package/src/lib/components/multiselect/MultiSelect.component.tsx +0 -158
  90. package/src/lib/components/select/Select.component.tsx +0 -98
  91. package/src/lib/components/spacedbox/SpacedBox.ts +0 -116
  92. package/src/lib/components/sparkline/SparkLine.component.tsx +0 -176
  93. package/src/lib/components/vegachart/VegaChart.component.tsx +0 -146
  94. package/stories/areachart.stories.tsx +0 -120
  95. package/stories/chips.stories.tsx +0 -107
  96. package/stories/cloudprogressbar.stories.tsx +0 -93
  97. package/stories/collapsiblepanel.stories.tsx +0 -57
  98. package/stories/data/areachart.ts +0 -122
  99. package/stories/data/sparklinechart.ts +0 -164
  100. package/stories/linechart.stories.tsx +0 -319
  101. package/stories/multiselect.stories.tsx +0 -126
  102. package/stories/select.stories.tsx +0 -52
  103. package/stories/sparkline.stories.tsx +0 -85
  104. package/stories/vegachart.stories.tsx +0 -98
@@ -1,122 +0,0 @@
1
- export const area_charts = [
2
- {
3
- time: '2019-10-01 00:00:00',
4
- Average: 'AvgIn',
5
- Bandwidth: 1.4,
6
- },
7
- {
8
- time: '2019-10-01 00:00:00',
9
- Average: 'AvgOut',
10
- Bandwidth: 1.2,
11
- },
12
- {
13
- time: '2019-10-01 00:15:00',
14
- Average: 'AvgIn',
15
- Bandwidth: 0.8,
16
- },
17
- {
18
- time: '2019-10-01 00:15:00',
19
- Average: 'AvgOut',
20
- Bandwidth: 1.2,
21
- },
22
- {
23
- time: '2019-10-01 00:30:00',
24
- Average: 'AvgIn',
25
- Bandwidth: 0.7,
26
- },
27
- {
28
- time: '2019-10-01 00:30:00',
29
- Average: 'AvgOut',
30
- Bandwidth: 2.1,
31
- },
32
- {
33
- time: '2019-10-01 00:45:00',
34
- Average: 'AvgIn',
35
- Bandwidth: 0.8,
36
- },
37
- {
38
- time: '2019-10-01 00:45:00',
39
- Average: 'AvgOut',
40
- Bandwidth: 0.9,
41
- },
42
- {
43
- time: '2019-10-01 01:00:00',
44
- Average: 'AvgIn',
45
- Bandwidth: 1.3,
46
- },
47
- {
48
- time: '2019-10-01 01:00:00',
49
- Average: 'AvgOut',
50
- Bandwidth: 0.8,
51
- },
52
- {
53
- time: '2019-10-01 01:15:00',
54
- Average: 'AvgIn',
55
- Bandwidth: 0.8,
56
- },
57
- {
58
- time: '2019-10-01 01:15:00',
59
- Average: 'AvgOut',
60
- Bandwidth: 2,
61
- },
62
- {
63
- time: '2019-10-01 01:30:00',
64
- Average: 'AvgIn',
65
- Bandwidth: 0.7,
66
- },
67
- {
68
- time: '2019-10-01 01:30:00',
69
- Average: 'AvgOut',
70
- Bandwidth: 0.2,
71
- },
72
- {
73
- time: '2019-10-01 01:45:00',
74
- Average: 'AvgIn',
75
- Bandwidth: 0.8,
76
- },
77
- {
78
- time: '2019-10-01 01:45:00',
79
- Average: 'AvgOut',
80
- Bandwidth: 0.9,
81
- },
82
- {
83
- time: '2019-10-01 02:00:00',
84
- Average: 'AvgIn',
85
- Bandwidth: 1.4,
86
- },
87
- {
88
- time: '2019-10-01 02:00:00',
89
- Average: 'AvgOut',
90
- Bandwidth: 1.2,
91
- },
92
- {
93
- time: '2019-10-01 02:15:00',
94
- Average: 'AvgIn',
95
- Bandwidth: 0.8,
96
- },
97
- {
98
- time: '2019-10-01 02:15:00',
99
- Average: 'AvgOut',
100
- Bandwidth: 1.2,
101
- },
102
- {
103
- time: '2019-10-01 02:30:00',
104
- Average: 'AvgIn',
105
- Bandwidth: 0.7,
106
- },
107
- {
108
- time: '2019-10-01 02:30:00',
109
- Average: 'AvgOut',
110
- Bandwidth: 2.1,
111
- },
112
- {
113
- time: '2019-10-01 02:45:00',
114
- Average: 'AvgIn',
115
- Bandwidth: 0.8,
116
- },
117
- {
118
- time: '2019-10-01 02:45:00',
119
- Average: 'AvgOut',
120
- Bandwidth: 0.9,
121
- },
122
- ];
@@ -1,164 +0,0 @@
1
- export const data = [
2
- {
3
- date: '2019-10-10 00:00:00',
4
- y: 33,
5
- symbol: 'Operation per sec',
6
- },
7
- {
8
- date: '2019-10-10 01:00:00',
9
- y: 100,
10
- symbol: 'Operation per sec',
11
- },
12
- {
13
- date: '2019-10-10 02:00:00',
14
- y: 103,
15
- symbol: 'Operation per sec',
16
- },
17
- {
18
- date: '2019-10-10 03:00:00',
19
- y: 350,
20
- symbol: 'Operation per sec',
21
- },
22
- {
23
- date: '2019-10-10 04:00:00',
24
- y: 225,
25
- symbol: 'Operation per sec',
26
- },
27
- {
28
- date: '2019-10-10 05:00:00',
29
- y: 124,
30
- symbol: 'Operation per sec',
31
- },
32
- {
33
- date: '2019-10-10 06:00:00',
34
- y: 248,
35
- symbol: 'Operation per sec',
36
- },
37
- {
38
- date: '2019-10-10 07:00:00',
39
- y: 99,
40
- symbol: 'Operation per sec',
41
- },
42
- ];
43
- export const multiLineData = [
44
- {
45
- date: '2019-10-10 00:00:00',
46
- y: 33,
47
- symbol: 'CPU',
48
- },
49
- {
50
- date: '2019-10-10 01:00:00',
51
- y: 100,
52
- symbol: 'CPU',
53
- },
54
- {
55
- date: '2019-10-10 02:00:00',
56
- y: 103,
57
- symbol: 'CPU',
58
- },
59
- {
60
- date: '2019-10-10 03:00:00',
61
- y: 350,
62
- symbol: 'CPU',
63
- },
64
- {
65
- date: '2019-10-10 04:00:00',
66
- y: 225,
67
- symbol: 'CPU',
68
- },
69
- {
70
- date: '2019-10-10 05:00:00',
71
- y: 124,
72
- symbol: 'CPU',
73
- },
74
- {
75
- date: '2019-10-10 06:00:00',
76
- y: 248,
77
- symbol: 'CPU',
78
- },
79
- {
80
- date: '2019-10-10 07:00:00',
81
- y: 99,
82
- symbol: 'CPU',
83
- },
84
- {
85
- date: '2019-10-10 00:00:00',
86
- y: 33,
87
- symbol: 'Load',
88
- },
89
- {
90
- date: '2019-10-10 01:00:00',
91
- y: 100,
92
- symbol: 'Load',
93
- },
94
- {
95
- date: '2019-10-10 02:00:00',
96
- y: 103,
97
- symbol: 'Load',
98
- },
99
- {
100
- date: '2019-10-10 03:00:00',
101
- y: 350,
102
- symbol: 'Load',
103
- },
104
- {
105
- date: '2019-10-10 04:00:00',
106
- y: 225,
107
- symbol: 'Load',
108
- },
109
- {
110
- date: '2019-10-10 05:00:00',
111
- y: 124,
112
- symbol: 'Load',
113
- },
114
- {
115
- date: '2019-10-10 06:00:00',
116
- y: 248,
117
- symbol: 'Load',
118
- },
119
- {
120
- date: '2019-10-10 07:00:00',
121
- y: 99,
122
- symbol: 'Load',
123
- },
124
- {
125
- date: '2019-10-10 00:00:00',
126
- y: 33,
127
- symbol: 'Memory',
128
- },
129
- {
130
- date: '2019-10-10 01:00:00',
131
- y: 100,
132
- symbol: 'Memory',
133
- },
134
- {
135
- date: '2019-10-10 02:00:00',
136
- y: 103,
137
- symbol: 'Memory',
138
- },
139
- {
140
- date: '2019-10-10 03:00:00',
141
- y: 350,
142
- symbol: 'Memory',
143
- },
144
- {
145
- date: '2019-10-10 04:00:00',
146
- y: 225,
147
- symbol: 'Memory',
148
- },
149
- {
150
- date: '2019-10-10 05:00:00',
151
- y: 124,
152
- symbol: 'Memory',
153
- },
154
- {
155
- date: '2019-10-10 06:00:00',
156
- y: 248,
157
- symbol: 'Memory',
158
- },
159
- {
160
- date: '2019-10-10 07:00:00',
161
- y: 99,
162
- symbol: 'Memory',
163
- },
164
- ];
@@ -1,319 +0,0 @@
1
- import React from 'react';
2
- import { LineChart } from '../src/lib/components/linechart/LineChart.component';
3
- import {
4
- data,
5
- data_graph_with_axis,
6
- forecast_data,
7
- in_out_data,
8
- } from './data/linechart';
9
- import { Wrapper, Title } from './common';
10
- const xAxis = {
11
- field: 'time',
12
- type: 'temporal',
13
- timeUnit: 'yearmonthdatehoursminutes',
14
- title: 'time',
15
- };
16
- const yAxis = [
17
- {
18
- field: 'total_space',
19
- type: 'quantitative',
20
- title: 'TOTAL SPACE (GB)',
21
- color: 'yellow',
22
- },
23
- {
24
- field: 'used_space',
25
- type: 'quantitative',
26
- title: 'USED SPACE (GB)',
27
- color: 'blue',
28
- },
29
- ];
30
- // the line chart without x axis and y axis
31
- const xAxis_without_axis = {
32
- field: 'time',
33
- type: 'temporal',
34
- timeUnit: 'yearmonthdatehoursminutes',
35
- title: 'time',
36
- axis: null,
37
- };
38
- const yAxis_without_axis = [
39
- {
40
- field: 'Latency',
41
- type: 'quantitative',
42
- color: '#18DFAD',
43
- axis: {
44
- title: null,
45
- ticks: false,
46
- labels: false,
47
- },
48
- },
49
- {
50
- field: 'Latency',
51
- type: 'quantitative',
52
- color: '#968BFF',
53
- axis: {
54
- title: null,
55
- ticks: false,
56
- labels: false,
57
- },
58
- },
59
- {
60
- field: 'Latency',
61
- type: 'quantitative',
62
- color: '#F6B187',
63
- axis: {
64
- title: null,
65
- ticks: false,
66
- labels: false,
67
- },
68
- },
69
- {
70
- field: 'Latency',
71
- type: 'quantitative',
72
- color: '#4BE4E2',
73
- axis: {
74
- title: null,
75
- ticks: false,
76
- labels: false,
77
- },
78
- },
79
- ];
80
- const color = {
81
- field: 'resquest_method',
82
- type: 'nominal',
83
- legend: {
84
- direction: 'horizontal',
85
- orient: 'bottom',
86
- title: null,
87
- symbolType: 'stroke',
88
- labelFontSize: 15,
89
- columnPadding: 50,
90
- symbolStrokeWidth: 5,
91
- },
92
- domain: ['Get', 'Put', 'Delete', 'List'],
93
- scale: {
94
- range: ['#18DFAD', '#968BFF', '#F6B187', '#4BE4E2'],
95
- },
96
- };
97
- const lineConfig = {
98
- strokeWidth: 1,
99
- opacity: 0.5,
100
- };
101
- const id = 'vis';
102
- const id_without_axis = 'vis2';
103
- // forecast chart
104
- const xAxis_forecast_chart = {
105
- field: 'time',
106
- type: 'ordinal',
107
- title: null,
108
- axis: {
109
- labelAngle: 0,
110
- },
111
- // sort the according the given xlabel
112
- sort: ['-3m', 'Now', '+3m'],
113
- };
114
- const yAxis_forecast_chart = [
115
- {
116
- field: 'capacity',
117
- type: 'quantitative',
118
- color: '#968BFF',
119
- axis: {
120
- title: null,
121
- ticks: false,
122
- labels: false,
123
- },
124
- },
125
- ];
126
- const lineConfig_forecast_chart = {
127
- interpolate: 'monotone',
128
- };
129
- const id_forecast_chart = 'vis_forecast_chart';
130
- const xAxis_inout_chart = {
131
- field: 'date',
132
- type: 'temporal',
133
- axis: {
134
- format: '%m/%d',
135
- ticks: true,
136
- tickCount: 4,
137
- labelAngle: -50,
138
- labelColor: '#B5B5B5',
139
- },
140
- title: null,
141
- };
142
- const yAxis_inout_chart = [
143
- {
144
- field: 'value',
145
- type: 'quantitative',
146
- title: null,
147
- },
148
- ];
149
- const color_inout_chart = {
150
- field: 'type',
151
- type: 'nominal',
152
- domain: ['in', 'out'],
153
- scale: {
154
- range: ['#F6B187', '#968BFF'],
155
- },
156
- legend: {
157
- direction: 'horizontal',
158
- orient: 'bottom',
159
- title: null,
160
- values: ['in', 'out'],
161
- symbolSize: 300,
162
- labelFontSize: 15,
163
- },
164
- };
165
- const strokeDashConfig_inout = {
166
- field: 'symbol',
167
- type: 'nominal',
168
- legend: {
169
- direction: 'horizontal',
170
- orient: 'bottom',
171
- title: null,
172
- values: ['Cluster avg'],
173
- symbolSize: 300,
174
- labelFontSize: 15,
175
- },
176
- };
177
- const opacityConfig_inout = {
178
- condition: {
179
- test: 'datum.symbol == "Cluster avg"',
180
- value: 0.5,
181
- },
182
- value: 1,
183
- };
184
- const lineConfigInOut = {
185
- strokeWidth: 1.5,
186
- };
187
- // Overriding the tooltip config to format data properly through the tooltipConfig prop
188
- const tooltipConfigInOut = {
189
- transform: [
190
- {
191
- pivot: 'type',
192
- value: 'value',
193
- groupby: ['date'],
194
- },
195
- ],
196
- mark: 'rule',
197
- encoding: {
198
- opacity: {
199
- condition: {
200
- value: 1,
201
- selection: 'hover',
202
- },
203
- value: 0,
204
- },
205
- tooltip: [
206
- {
207
- field: 'date',
208
- type: 'temporal',
209
- axis: {
210
- format: '%d/%m %H:%M',
211
- ticks: true,
212
- tickCount: 4,
213
- labelAngle: -50,
214
- labelColor: '#B5B5B5',
215
- },
216
- title: 'Date',
217
- },
218
- {
219
- field: 'in',
220
- type: 'quantitative',
221
- title: 'In',
222
- },
223
- {
224
- field: 'out',
225
- type: 'quantitative',
226
- title: 'Out',
227
- },
228
- {
229
- field: 'avgIn',
230
- type: 'quantitative',
231
- title: 'Avg In',
232
- },
233
- {
234
- field: 'avgOut',
235
- type: 'quantitative',
236
- title: 'Avg Out',
237
- },
238
- ],
239
- color: {
240
- legend: null,
241
- },
242
- },
243
- selection: {
244
- hover: {
245
- type: 'single',
246
- fields: ['date'],
247
- nearest: true,
248
- on: 'mouseover',
249
- empty: 'none',
250
- clear: 'mouseout',
251
- },
252
- },
253
- };
254
- export default {
255
- title: 'Components/Data Display/Charts/LineChart',
256
- component: LineChart,
257
- args: {
258
- width: 800,
259
- tooltip: true,
260
- },
261
- argTypes: {
262
- data: {
263
- control: false,
264
- },
265
- },
266
- };
267
- export const VegaLiteChart = {
268
- name: 'Vega-Lite line chart demo',
269
- args: {
270
- id,
271
- data,
272
- xAxis,
273
- yAxis,
274
- },
275
- };
276
-
277
- export const VegaChartWithoutAxis = {
278
- name: 'Vega-Lite line chart without axis',
279
- args: {
280
- id: id_without_axis,
281
- data: data_graph_with_axis,
282
- xAxis: xAxis_without_axis,
283
- yAxis: yAxis_without_axis,
284
- tooltip: false,
285
- color,
286
- lineConfig,
287
- },
288
- };
289
-
290
- export const ForecastChart = {
291
- args: {
292
- id: id_forecast_chart,
293
- data: forecast_data,
294
- xAxis: xAxis_forecast_chart,
295
- yAxis: yAxis_forecast_chart,
296
- tooltip: false,
297
- lineConfig: lineConfig_forecast_chart,
298
- width: 300,
299
- heigth: 150,
300
- displayTrendLine: true,
301
- },
302
- };
303
-
304
- export const AnotherExample = {
305
- name: 'Vega-Lite with strokeDash config, opacity config and custom Tooltip',
306
- args: {
307
- id: 'id_strokedash',
308
- data: in_out_data,
309
- xAxis: xAxis_inout_chart,
310
- yAxis: yAxis_inout_chart,
311
- color: color_inout_chart,
312
- height: 250,
313
- lineConfig: lineConfigInOut,
314
- strokeDashEncodingConfig: strokeDashConfig_inout,
315
- opacityEncodingConfig: opacityConfig_inout,
316
- tooltipConfig: tooltipConfigInOut,
317
- tooltipTheme: 'dark',
318
- },
319
- };
@@ -1,126 +0,0 @@
1
- import React from 'react';
2
- import { MultiSelect } from '../src/lib/components/multiselect/MultiSelect.component';
3
- import { action } from '@storybook/addon-actions';
4
- import { Wrapper, Title } from './common';
5
- const items = [
6
- {
7
- selected: true,
8
- isFavorite: true,
9
- label: 'AWS',
10
- description: 'Amazon',
11
- onSelect: action('onSelect clicked'),
12
- onFavoriteClick: action('onFavoriteClick clicked'),
13
- },
14
- {
15
- selected: false,
16
- isFavorite: false,
17
- label: 'WM',
18
- description: 'Walmart',
19
- onSelect: action('onSelect clicked'),
20
- onFavoriteClick: action('onFavoriteClick clicked'),
21
- },
22
- ];
23
- const itemsWithoutFavourite = [
24
- {
25
- selected: true,
26
- label: 'AWS',
27
- description: 'Amazon',
28
- onSelect: action('onSelect clicked'),
29
- },
30
- {
31
- selected: false,
32
- label: 'WM',
33
- description: 'Walmart',
34
- onSelect: action('onSelect clicked'),
35
- },
36
- ];
37
- const itemsWithoutCheckboxFavourite = [
38
- {
39
- label: 'AWS',
40
- description: 'Amazon',
41
- },
42
- {
43
- label: 'WM',
44
- description: 'Walmart',
45
- },
46
- ];
47
- const options = [
48
- {
49
- label: 'Azure',
50
- value: 'Azure',
51
- },
52
- {
53
- label: 'S3',
54
- value: 'S3',
55
- },
56
- ];
57
- const search = {
58
- placeholder: 'Select location to add',
59
- options: options,
60
- onSelect: action('onSelect clicked'),
61
- onAdd: action('onAdd clicked'),
62
- selectedOption: null,
63
- };
64
- export default {
65
- title: 'Components/Deprecated/Selector/MultiSelect',
66
- component: MultiSelect,
67
- };
68
- export const Default = {
69
- render: ({}) => {
70
- return (
71
- <Wrapper>
72
- <Title>MultiSelect List</Title>
73
- <div className="storybook-mutiselect-container">
74
- <MultiSelect
75
- title="Destination Locations"
76
- items={items}
77
- search={search}
78
- onItemRemove={action('onItemRemove clicked')}
79
- />
80
- </div>
81
- <Title>MultiSelect List without search</Title>
82
- <div className="storybook-mutiselect-container">
83
- <MultiSelect
84
- title="Destination Locations"
85
- items={items}
86
- onItemRemove={action('onItemRemove clicked')}
87
- />
88
- </div>
89
- <Title>MultiSelect List without Favourite</Title>
90
- <div className="storybook-mutiselect-container">
91
- <MultiSelect
92
- title="Destination Locations"
93
- items={itemsWithoutFavourite}
94
- search={search}
95
- onItemRemove={action('onItemRemove clicked')}
96
- />
97
- </div>
98
- <Title>MultiSelect List without Favourite and Selectbox</Title>
99
- <div className="storybook-mutiselect-container">
100
- <MultiSelect
101
- title="Destination Locations"
102
- items={itemsWithoutCheckboxFavourite}
103
- search={search}
104
- onItemRemove={action('onItemRemove clicked')}
105
- />
106
- </div>
107
- <Title>
108
- MultiSelect List without Remove Button, Favourite and Selectbox
109
- </Title>
110
- <div className="storybook-mutiselect-container">
111
- <MultiSelect
112
- title="Destination Locations"
113
- items={itemsWithoutCheckboxFavourite}
114
- search={search}
115
- />
116
- </div>
117
- <Title>
118
- MultiSelect List without Title, Remove Button, Favourite and Selectbox
119
- </Title>
120
- <div className="storybook-mutiselect-container">
121
- <MultiSelect items={itemsWithoutCheckboxFavourite} search={search} />
122
- </div>
123
- </Wrapper>
124
- );
125
- },
126
- };