@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,52 +0,0 @@
1
- import React from 'react';
2
- import { Select } from '../src/lib/components/select/Select.component';
3
- import { Wrapper } from './common';
4
- const options = Array.from(new Array(100), (_, index) => ({
5
- label: `Item ${index}`,
6
- value: index,
7
- title: `Item ${index}`,
8
- 'data-cy': `Item_${index}`,
9
- }));
10
-
11
- const customFormatOptionLabel = ({ value, label, ...rest }) => (
12
- <div className="sc-select-option-custom-label" {...rest}>
13
- {label} {value % 2 === 0 ? <i className="fas fa-flag-usa"></i> : null}
14
- </div>
15
- );
16
-
17
- export default {
18
- title: 'Components/Deprecated/Selector/Select',
19
- component: Select,
20
- argTypes: {
21
- options: {
22
- description: 'Array of objects with label, title and value properties',
23
- control: false,
24
- },
25
- isMulti: {
26
- control: {
27
- type: 'boolean',
28
- },
29
- },
30
- },
31
- };
32
-
33
- export const Playground = {
34
- args: {
35
- options,
36
- },
37
- };
38
-
39
- export const WithCustomLabel = {
40
- args: {
41
- options,
42
- formatOptionLabel: customFormatOptionLabel,
43
- },
44
- };
45
-
46
- export const MultiSelect = {
47
- args: {
48
- options,
49
- isMulti: true,
50
- value: [options[0], options[1]],
51
- },
52
- };
@@ -1,85 +0,0 @@
1
- import React from 'react';
2
- import { Sparkline as SparkLine } from '../src/lib/components/sparkline/SparkLine.component';
3
- import { data, multiLineData } from './data/sparklinechart';
4
- import { Wrapper, Title } from './common';
5
- const xAxis = {
6
- field: 'date',
7
- type: 'temporal',
8
- axis: null,
9
- };
10
- const yAxis = {
11
- field: 'y',
12
- type: 'quantitative',
13
- axis: {
14
- title: null,
15
- ticks: false,
16
- labels: false,
17
- },
18
- };
19
- const row = {
20
- field: 'symbol',
21
- type: 'nominal',
22
- title: null,
23
- // the header of the subplot
24
- header: {
25
- labelAngle: 0,
26
- labelAlign: 'left',
27
- },
28
- };
29
- const id = 'vis';
30
- const id_multi = 'multiVis';
31
- const lineConfig = {
32
- interpolate: 'monotone',
33
- };
34
- export default {
35
- title: 'Components/Data Display/Charts/SparkLine',
36
- component: SparkLine,
37
- args: {
38
- xAxis,
39
- yAxis,
40
- row,
41
- },
42
- };
43
-
44
- export const ChartDemo = {
45
- args: {
46
- id,
47
- data,
48
- title: 'OPERATIONS BY SECONDS',
49
- lineConfig,
50
- },
51
- };
52
-
53
- export const MultiChartDmeo = {
54
- args: {
55
- id: id_multi,
56
- data: multiLineData,
57
- },
58
- };
59
-
60
- export const Default = {
61
- render: ({}) => {
62
- return (
63
- <Wrapper>
64
- <Title>Vege-Lite sparkline chart demo</Title>
65
- <SparkLine
66
- id={id}
67
- data={data}
68
- xAxis={xAxis}
69
- yAxis={yAxis}
70
- title={'OPERATIONS PER SECONDS'}
71
- row={row}
72
- lineConfig={lineConfig}
73
- />
74
- <Title>Vege-Lite sparkline multi chart demo</Title>
75
- <SparkLine
76
- id={id_multi}
77
- data={multiLineData}
78
- xAxis={xAxis}
79
- yAxis={yAxis}
80
- row={row}
81
- />
82
- </Wrapper>
83
- );
84
- },
85
- };
@@ -1,98 +0,0 @@
1
- import React from 'react';
2
- import { VegaChart } from '../src/lib/components/vegachart/VegaChart.component';
3
- import { data } from './data/linechart';
4
- import { Wrapper, Title } from './common';
5
- const spec = {
6
- data: {
7
- values: data,
8
- },
9
- encoding: {
10
- x: {
11
- field: 'time',
12
- type: 'temporal',
13
- timeUnit: 'yearmonthdatehoursminutes',
14
- title: 'time',
15
- },
16
- tooltip: [
17
- {
18
- field: 'time',
19
- type: 'temporal',
20
- timeUnit: 'yearmonthdatehoursminutes',
21
- },
22
- {
23
- field: 'total_space',
24
- type: 'quantitative',
25
- title: 'TOTAL SPACE',
26
- },
27
- {
28
- field: 'used_space',
29
- type: 'quantitative',
30
- title: 'USED SPACE',
31
- },
32
- ],
33
- },
34
- layer: [
35
- {
36
- mark: {
37
- type: 'line',
38
- color: 'green',
39
- },
40
- encoding: {
41
- y: {
42
- field: 'total_space',
43
- type: 'quantitative',
44
- title: 'TOTAL SPACE (GB)',
45
- },
46
- },
47
- },
48
- {
49
- mark: {
50
- type: 'line',
51
- color: 'orange',
52
- },
53
- encoding: {
54
- y: {
55
- field: 'used_space',
56
- type: 'quantitative',
57
- title: 'USED SPACE (GB)',
58
- },
59
- },
60
- },
61
- {
62
- mark: 'rule',
63
- selection: {
64
- index: {
65
- type: 'single',
66
- on: 'mousemove',
67
- encodings: ['x'],
68
- nearest: true,
69
- },
70
- },
71
- encoding: {
72
- color: {
73
- condition: {
74
- selection: {
75
- not: 'index',
76
- },
77
- value: 'transparent',
78
- },
79
- },
80
- },
81
- },
82
- ],
83
- };
84
- const id = 'vis';
85
- export default {
86
- title: 'Components/Data Display/Charts/VegaChart',
87
- component: VegaChart,
88
- };
89
- export const Default = {
90
- render: (args) => {
91
- return (
92
- <Wrapper>
93
- <Title>Vega-Lite wrapper - need to specify the entire spec</Title>
94
- <VegaChart id={id} spec={spec} {...args} />
95
- </Wrapper>
96
- );
97
- },
98
- };