@scality/core-ui 0.166.0 → 0.168.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 (119) 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/barchartv2/Barchart.component.d.ts +5 -1
  7. package/dist/components/barchartv2/Barchart.component.d.ts.map +1 -1
  8. package/dist/components/barchartv2/Barchart.component.js +6 -2
  9. package/dist/components/barchartv2/utils.js +2 -2
  10. package/dist/components/button/Button.component.d.ts +2 -1
  11. package/dist/components/button/Button.component.d.ts.map +1 -1
  12. package/dist/components/button/Button.component.js +2 -1
  13. package/dist/components/chartlegend/ChartLegend.d.ts.map +1 -1
  14. package/dist/components/chartlegend/ChartLegend.js +7 -13
  15. package/dist/components/chartlegend/ChartLegendWrapper.d.ts +1 -2
  16. package/dist/components/chartlegend/ChartLegendWrapper.d.ts.map +1 -1
  17. package/dist/components/chartlegend/ChartLegendWrapper.js +4 -9
  18. package/dist/components/date/FormattedDateTime.d.ts +6 -1
  19. package/dist/components/date/FormattedDateTime.d.ts.map +1 -1
  20. package/dist/components/date/FormattedDateTime.js +11 -0
  21. package/dist/components/icon/Icon.component.d.ts +9 -11
  22. package/dist/components/icon/Icon.component.d.ts.map +1 -1
  23. package/dist/components/icon/Icon.component.js +2 -0
  24. package/dist/components/linetemporalchart/ChartUtil.d.ts +3 -2
  25. package/dist/components/linetemporalchart/ChartUtil.d.ts.map +1 -1
  26. package/dist/components/linetemporalchart/ChartUtil.js +30 -20
  27. package/dist/components/linetemporalchart/LineTemporalChart.component.d.ts +4 -0
  28. package/dist/components/linetemporalchart/LineTemporalChart.component.d.ts.map +1 -1
  29. package/dist/components/linetemporalchart/LineTemporalChart.component.js +4 -0
  30. package/dist/components/linetimeseriechart/linetimeseriechart.component.d.ts +8 -2
  31. package/dist/components/linetimeseriechart/linetimeseriechart.component.d.ts.map +1 -1
  32. package/dist/components/linetimeseriechart/linetimeseriechart.component.js +17 -11
  33. package/dist/index.d.ts +1 -11
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +0 -11
  36. package/dist/next.d.ts +1 -0
  37. package/dist/next.d.ts.map +1 -1
  38. package/jest.config.js +1 -0
  39. package/package.json +16 -37
  40. package/src/lib/components/barchart/BarChart.component.tsx +5 -0
  41. package/src/lib/components/barchartv2/Barchart.component.test.tsx +11 -7
  42. package/src/lib/components/barchartv2/Barchart.component.tsx +15 -3
  43. package/src/lib/components/barchartv2/utils.test.ts +2 -2
  44. package/src/lib/components/barchartv2/utils.ts +2 -2
  45. package/src/lib/components/button/Button.component.tsx +2 -1
  46. package/src/lib/components/chartlegend/ChartLegend.test.tsx +17 -0
  47. package/src/lib/components/chartlegend/ChartLegend.tsx +6 -12
  48. package/src/lib/components/chartlegend/ChartLegendWrapper.tsx +5 -13
  49. package/src/lib/components/date/FormattedDateTime.tsx +14 -1
  50. package/src/lib/components/icon/Icon.component.tsx +12 -1
  51. package/src/lib/components/linetemporalchart/ChartUtil.test.ts +23 -35
  52. package/src/lib/components/linetemporalchart/ChartUtil.ts +38 -26
  53. package/src/lib/components/linetemporalchart/LineTemporalChart.component.tsx +19 -15
  54. package/src/lib/components/linetimeseriechart/linetimeseriechart.component.tsx +36 -13
  55. package/src/lib/components/linetimeseriechart/linetimeseriechart.test.tsx +68 -0
  56. package/src/lib/components/selectv2/selectv2.test.tsx +1 -1
  57. package/src/lib/components/toast/useMutationsHandler.test.tsx +22 -32
  58. package/src/lib/index.ts +6 -11
  59. package/src/lib/next.ts +1 -0
  60. package/stories/BarChart/barchart.stories.tsx +108 -13
  61. package/stories/barchart.stories.tsx +1 -1
  62. package/stories/card.stories.tsx +7 -5
  63. package/stories/controls.ts +19 -20
  64. package/stories/linecharttemporal.stories.tsx +1 -1
  65. package/stories/linetimeseriechart.stories.tsx +146 -0
  66. package/stories/navbar.stories.tsx +103 -0
  67. package/stories/tabsv2.stories.tsx +51 -56
  68. package/dist/components/areachart/AreaChart.component.d.ts +0 -13
  69. package/dist/components/areachart/AreaChart.component.d.ts.map +0 -1
  70. package/dist/components/areachart/AreaChart.component.js +0 -27
  71. package/dist/components/chips/Chips.component.d.ts +0 -21
  72. package/dist/components/chips/Chips.component.d.ts.map +0 -1
  73. package/dist/components/chips/Chips.component.js +0 -105
  74. package/dist/components/cloudprogressbar/CloudProgressBar.component.d.ts +0 -10
  75. package/dist/components/cloudprogressbar/CloudProgressBar.component.d.ts.map +0 -1
  76. package/dist/components/cloudprogressbar/CloudProgressBar.component.js +0 -38
  77. package/dist/components/collapsiblepanel/CollapsiblePanel.component.d.ts +0 -9
  78. package/dist/components/collapsiblepanel/CollapsiblePanel.component.d.ts.map +0 -1
  79. package/dist/components/collapsiblepanel/CollapsiblePanel.component.js +0 -44
  80. package/dist/components/linechart/LineChart.component.d.ts +0 -21
  81. package/dist/components/linechart/LineChart.component.d.ts.map +0 -1
  82. package/dist/components/linechart/LineChart.component.js +0 -109
  83. package/dist/components/multiselect/MultiSelect.component.d.ts +0 -28
  84. package/dist/components/multiselect/MultiSelect.component.d.ts.map +0 -1
  85. package/dist/components/multiselect/MultiSelect.component.js +0 -73
  86. package/dist/components/select/Select.component.d.ts +0 -14
  87. package/dist/components/select/Select.component.d.ts.map +0 -1
  88. package/dist/components/select/Select.component.js +0 -71
  89. package/dist/components/spacedbox/SpacedBox.d.ts +0 -34
  90. package/dist/components/spacedbox/SpacedBox.d.ts.map +0 -1
  91. package/dist/components/spacedbox/SpacedBox.js +0 -64
  92. package/dist/components/sparkline/SparkLine.component.d.ts +0 -18
  93. package/dist/components/sparkline/SparkLine.component.d.ts.map +0 -1
  94. package/dist/components/sparkline/SparkLine.component.js +0 -148
  95. package/dist/components/vegachart/VegaChart.component.d.ts +0 -13
  96. package/dist/components/vegachart/VegaChart.component.d.ts.map +0 -1
  97. package/dist/components/vegachart/VegaChart.component.js +0 -120
  98. package/plopfile.js +0 -38
  99. package/src/lib/components/areachart/AreaChart.component.tsx +0 -49
  100. package/src/lib/components/chips/Chips.component.tsx +0 -169
  101. package/src/lib/components/cloudprogressbar/CloudProgressBar.component.tsx +0 -105
  102. package/src/lib/components/collapsiblepanel/CollapsiblePanel.component.tsx +0 -77
  103. package/src/lib/components/linechart/LineChart.component.tsx +0 -152
  104. package/src/lib/components/multiselect/MultiSelect.component.tsx +0 -158
  105. package/src/lib/components/select/Select.component.tsx +0 -98
  106. package/src/lib/components/spacedbox/SpacedBox.ts +0 -116
  107. package/src/lib/components/sparkline/SparkLine.component.tsx +0 -176
  108. package/src/lib/components/vegachart/VegaChart.component.tsx +0 -146
  109. package/stories/areachart.stories.tsx +0 -120
  110. package/stories/chips.stories.tsx +0 -107
  111. package/stories/cloudprogressbar.stories.tsx +0 -93
  112. package/stories/collapsiblepanel.stories.tsx +0 -57
  113. package/stories/data/areachart.ts +0 -122
  114. package/stories/data/sparklinechart.ts +0 -164
  115. package/stories/linechart.stories.tsx +0 -319
  116. package/stories/multiselect.stories.tsx +0 -126
  117. package/stories/select.stories.tsx +0 -52
  118. package/stories/sparkline.stories.tsx +0 -85
  119. package/stories/vegachart.stories.tsx +0 -98
@@ -1,109 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { VegaChart } from '../vegachart/VegaChart.component';
3
- function LineChart({ id, data, xAxis, yAxis, color, tooltip = false, lineConfig, height = 300, width = 1000, displayTrendLine = false, strokeDashEncodingConfig, opacityEncodingConfig, tooltipConfig, tooltipTheme, ...rest }) {
4
- // hardcode the trendline configuration for tooltip
5
- const trendline = {
6
- mark: 'rule',
7
- selection: {
8
- index: {
9
- type: 'single',
10
- on: 'mousemove',
11
- encodings: ['x'],
12
- nearest: true,
13
- },
14
- },
15
- encoding: {
16
- color: {
17
- condition: {
18
- selection: {
19
- not: 'index',
20
- },
21
- value: 'transparent',
22
- },
23
- },
24
- },
25
- };
26
- /*
27
- ** strokeDash encoding allows to define a field in data items that defines the line stroke dash property
28
- ** this would allow to get same color lines but having some dashed and some plains
29
- ** https://vega.github.io/vega-lite/docs/line.html#multi-series-line-chart-with-varying-dashes
30
- */
31
- /*
32
- ** opacity Encoding allows to define rules for each line's opacity
33
- */
34
- const lines = yAxis.map((y) => ({
35
- mark: {
36
- type: 'line',
37
- ...lineConfig,
38
- },
39
- encoding: {
40
- y,
41
- strokeDash: strokeDashEncodingConfig,
42
- opacity: opacityEncodingConfig,
43
- },
44
- }));
45
- const currentTimeTrendline = {
46
- mark: {
47
- type: 'rule',
48
- style: 'ruleCurrentTime',
49
- color: 'white',
50
- opacity: 0.2,
51
- },
52
- encoding: {
53
- x: {
54
- value: width / 2,
55
- },
56
- y: {
57
- value: height,
58
- },
59
- y2: {
60
- value: 0,
61
- },
62
- },
63
- };
64
- const topTrendline = {
65
- mark: {
66
- type: 'rule',
67
- style: 'ruleTop',
68
- color: 'orange',
69
- opacity: 0.2,
70
- },
71
- encoding: {
72
- y: {
73
- aggregate: 'max',
74
- field: 'capacity',
75
- type: 'quantitative',
76
- },
77
- x: {
78
- value: 0,
79
- },
80
- x2: {
81
- value: width,
82
- },
83
- },
84
- };
85
- const spec = {
86
- data: {
87
- values: data,
88
- },
89
- encoding: {
90
- x: xAxis,
91
- color,
92
- // To disable tooltips for a particular single view specification, you can set the "tooltip" property of a mark definition block to null.
93
- tooltip: tooltip ? [xAxis, ...yAxis] : null,
94
- },
95
- height,
96
- width,
97
- layer: [...lines],
98
- ...rest,
99
- };
100
- if (tooltip) {
101
- spec.layer.push(tooltipConfig || trendline);
102
- }
103
- if (displayTrendLine) {
104
- spec.layer.push(currentTimeTrendline);
105
- spec.layer.push(topTrendline);
106
- }
107
- return (_jsx(VegaChart, { id: id, spec: spec, theme: tooltipTheme || 'light' }));
108
- }
109
- export { LineChart };
@@ -1,28 +0,0 @@
1
- export type ItemProps = {
2
- selected?: boolean;
3
- label: string;
4
- description?: string;
5
- onSelect?: (arg0: any, arg1: any) => void;
6
- onItemRemove?: (arg0: any, arg1: any) => void;
7
- };
8
- export type OptionProps = {
9
- label: string;
10
- value: string | number;
11
- };
12
- export type SearchProps = {
13
- placeholder?: string;
14
- options: Array<OptionProps>;
15
- onSelect: (arg0: any) => void;
16
- onAdd?: (arg0: any) => void;
17
- selectedOption: any;
18
- };
19
- type MultiSelectProps = {
20
- title?: string;
21
- items: Array<ItemProps>;
22
- search?: SearchProps;
23
- onItemRemove?: (arg0: any, arg1: any) => void;
24
- };
25
- declare function MultiSelectList({ title, items, search, onItemRemove, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
26
- export declare const MultiSelect: typeof MultiSelectList;
27
- export {};
28
- //# sourceMappingURL=MultiSelect.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MultiSelect.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/multiselect/MultiSelect.component.tsx"],"names":[],"mappings":"AASA,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAE1C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/C,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAE5B,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAE9B,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,cAAc,EAAE,GAAG,CAAC;CACrB,CAAC;AACF,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/C,CAAC;AAqGF,iBAAS,eAAe,CAAC,EACvB,KAAU,EACV,KAAU,EACV,MAAM,EACN,YAAY,GACb,EAAE,gBAAgB,2CAclB;AAED,eAAO,MAAM,WAAW,wBAAkB,CAAC"}
@@ -1,73 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled from 'styled-components';
3
- import { spacing } from '../../spacing';
4
- import { fontSize, fontWeight } from '../../style/theme';
5
- import { getThemePropSelector } from '../../utils';
6
- import { Icon } from '../icon/Icon.component';
7
- import { Button } from './../button/Button.component';
8
- import { Checkbox } from './../checkbox/Checkbox.component';
9
- import { Select } from './../select/Select.component';
10
- const MultiSelectContainer = styled.div `
11
- color: ${getThemePropSelector('textPrimary')};
12
- `;
13
- const MultiSelectTitle = styled.h3 `
14
- padding: ${spacing.r16} 0;
15
- margin: 0;
16
- font-weight: ${fontWeight.bold};
17
- font-size: ${fontSize.large};
18
- `;
19
- const MultiSelectItemContainer = styled.div `
20
- margin: ${spacing.r4} 0;
21
- padding: ${spacing.r8} 0;
22
- display: flex;
23
- align-items: center;
24
- border-bottom: 1px solid gray;
25
- &:last-child {
26
- border: none;
27
- }
28
- `;
29
- const MultiSelectSearchContainer = styled.div `
30
- display: flex;
31
- align-items: center;
32
- .sc-select-container {
33
- width: 100%;
34
- }
35
- .sc-button {
36
- margin: 0 ${spacing.r8};
37
- }
38
- `;
39
- const MultiSelectItemLeft = styled.div `
40
- .sc-checkbox,
41
- .sc-button {
42
- margin: 0 ${spacing.r8};
43
- }
44
- `;
45
- const MultiSelectItemCenter = styled.div `
46
- display: flex;
47
- flex-grow: 1;
48
- align-items: center;
49
- justify-content: space-between;
50
- `;
51
- const MultiSelectItemRight = styled.div `
52
- padding: 0 ${spacing.r16};
53
- `;
54
- const MultiSelectItemLabel = styled.span `
55
- font-size: ${fontSize.large};
56
- `;
57
- const MultiSelectItemDescription = styled.span ``;
58
- function MultiSelectItem(props) {
59
- const { selected, label, description, onItemRemove, onSelect } = props;
60
- return (_jsxs(MultiSelectItemContainer, { className: "sc-multi-select-item", children: [_jsx(MultiSelectItemLeft, { className: "sc-multi-select-item-left", children: typeof selected === 'boolean' && onSelect && (_jsx(Checkbox, { checked: selected, onChange: (event) => onSelect(label, event) })) }), _jsxs(MultiSelectItemCenter, { className: "sc-multi-select-item-center", children: [_jsx(MultiSelectItemLabel, { className: "sc-multi-select-item-label", children: label }), description && (_jsx(MultiSelectItemDescription, { className: "sc-multi-select-item-description", children: description }))] }), _jsx(MultiSelectItemRight, { className: "sc-multi-select-item-right", children: onItemRemove && (_jsx(Button, { inverted: true, variant: "buttonDelete", onClick: (event) => onItemRemove(label, event), icon: _jsx(Icon, { name: "Delete" }) })) })] }));
61
- }
62
- function MultiSelectSearch(props) {
63
- const { selectedOption, onSelect, onAdd, ...rest } = props;
64
- return (_jsxs(MultiSelectSearchContainer, { className: "sc-multi-select-list-search", children: [_jsx(Select
65
- // @ts-ignore
66
- , {
67
- // @ts-ignore
68
- onChange: onSelect, value: selectedOption, ...rest }), onAdd && _jsx(Button, { onClick: onAdd, icon: _jsx(Icon, { name: "Create-add" }) })] }));
69
- }
70
- function MultiSelectList({ title = '', items = [], search, onItemRemove, }) {
71
- return (_jsxs(MultiSelectContainer, { className: "sc-multi-select-list", children: [title && _jsx(MultiSelectTitle, { children: title }), search && _jsx(MultiSelectSearch, { ...search }), items.map((item, index) => (_jsx(MultiSelectItem, { onItemRemove: onItemRemove, ...item }, `sc-multi-select-item-${index}`)))] }));
72
- }
73
- export const MultiSelect = MultiSelectList;
@@ -1,14 +0,0 @@
1
- export type Item = {
2
- label: string;
3
- value: string | number;
4
- };
5
- type Items = Array<Item>;
6
- type Props = {
7
- id?: any;
8
- options: Items;
9
- formatOptionLabel?: (arg0: any) => JSX.Element;
10
- };
11
- declare function SelectBox({ options, formatOptionLabel, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
12
- export declare const Select: typeof SelectBox;
13
- export {};
14
- //# sourceMappingURL=Select.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Select.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/select/Select.component.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AACF,KAAK,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AACzB,KAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;IACf,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC,OAAO,CAAC;CAChD,CAAC;AAqEF,iBAAS,SAAS,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAYhE;AAED,eAAO,MAAM,MAAM,kBAAY,CAAC"}
@@ -1,71 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import ReactSelect from 'react-select';
3
- import styled from 'styled-components';
4
- import { fontSize, fontWeight, gray, zIndex } from '../../style/theme';
5
- import { getThemePropSelector } from '../../utils';
6
- const SelectContainer = styled.div `
7
- font-size: ${fontSize.base};
8
- .sc-select__control {
9
- background-color: ${getThemePropSelector('backgroundLevel1')};
10
- border-radius: 4px;
11
- border: 1px solid ${getThemePropSelector('border')};
12
- height: auto;
13
-
14
- .sc-select__placeholder,
15
- .sc-select__single-value {
16
- color: ${getThemePropSelector('textSecondary')};
17
- }
18
- &.sc-select__control--is-focused {
19
- border-color: ${getThemePropSelector('selectedActive')};
20
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
21
- 0 0 0 1px rgba(0, 126, 255, 0.1);
22
- outline: none;
23
- }
24
- .sc-select__indicator {
25
- color: ${getThemePropSelector('textSecondary')};
26
- &.sc-select__dropdown-indicator:hover {
27
- color: ${getThemePropSelector('selectedActive')};
28
- }
29
- &.sc-select__clear-indicator:hover {
30
- color: ${gray};
31
- }
32
- }
33
- .sc-select__multi-value__remove {
34
- border-radius: 0;
35
- color: ${getThemePropSelector('textSecondary')};
36
- background-color: ${getThemePropSelector('backgroundLevel4')};
37
- &:hover {
38
- color: ${gray};
39
- }
40
- }
41
- .sc-select__multi-value__label {
42
- border-radius: 0;
43
- color: ${getThemePropSelector('selectedActive')};
44
- background-color: ${getThemePropSelector('backgroundLevel4')};
45
- vertical-align: initial;
46
- }
47
- }
48
- .sc-select__menu {
49
- background-color: ${getThemePropSelector('backgroundLevel1')};
50
- color: ${getThemePropSelector('textSecondary')};
51
- border: 1px solid ${getThemePropSelector('selectedActive')};
52
- box-sizing: border-box;
53
- overflow: hidden;
54
- z-index: ${zIndex.dropdown};
55
- .sc-select__option {
56
- &.sc-select__option--is-focused {
57
- background-color: ${getThemePropSelector('backgroundLevel1')};
58
- }
59
- &.sc-select__option--is-selected {
60
- background-color: ${getThemePropSelector('backgroundLevel1')};
61
- color: ${getThemePropSelector('selectedActive')};
62
- font-weight: ${fontWeight.bold};
63
- }
64
- }
65
- }
66
- `;
67
- const defaultFormatOptionLabel = ({ label, ...rest }) => (_jsx("div", { className: "sc-select-option-label", ...rest, children: label }));
68
- function SelectBox({ options, formatOptionLabel, ...rest }) {
69
- return (_jsx(SelectContainer, { className: "sc-select-container", children: _jsx(ReactSelect, { className: "sc-select", classNamePrefix: "sc-select", options: options, formatOptionLabel: formatOptionLabel || defaultFormatOptionLabel, ...rest }) }));
70
- }
71
- export const Select = SelectBox;
@@ -1,34 +0,0 @@
1
- type SpacingValue = 0 | 1 | 2 | 4 | 8 | 12 | 14 | 16 | 20 | 24 | 28 | 32;
2
- export type Props = {
3
- m?: SpacingValue;
4
- mt?: SpacingValue;
5
- mr?: SpacingValue;
6
- mb?: SpacingValue;
7
- ml?: SpacingValue;
8
- mx?: SpacingValue;
9
- my?: SpacingValue;
10
- p?: SpacingValue;
11
- pt?: SpacingValue;
12
- pr?: SpacingValue;
13
- pb?: SpacingValue;
14
- pl?: SpacingValue;
15
- px?: SpacingValue;
16
- py?: SpacingValue;
17
- };
18
- /**
19
- * @deprecated
20
- * Please use Box with import { Box } from '@scality/core-ui/dist/next';
21
- *
22
- * Most common use cases:
23
- *
24
- * `<SpacedBox m={14}><Component /></SpacedBox>`
25
- *
26
- * `<SpacedBox as={SpanComponent}><Component /></SpacedBox>`
27
- *
28
- * Props : m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py
29
- *
30
- * Values: 0, 1, 2, 4, 8, 12, 14, 16, 20, 24, 28, 32
31
- */
32
- declare const SpacedBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Props, never>;
33
- export { SpacedBox };
34
- //# sourceMappingURL=SpacedBox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpacedBox.d.ts","sourceRoot":"","sources":["../../../src/lib/components/spacedbox/SpacedBox.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACzE,MAAM,MAAM,KAAK,GAAG;IAClB,CAAC,CAAC,EAAE,YAAY,CAAC;IACjB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,CAAC,CAAC,EAAE,YAAY,CAAC;IACjB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;CACnB,CAAC;AAmEF;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,SAAS,4GAed,CAAC;AACF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,64 +0,0 @@
1
- import styled from 'styled-components';
2
- import { spacing } from '../../style/theme';
3
- const validValue = [0, 1, 2, 4, 8, 12, 14, 16, 20, 24, 28, 32];
4
- const createSpacingFn = (propsName, spacingFields) => (props) => {
5
- if (!props[propsName] && props[propsName] !== 0) {
6
- return null;
7
- }
8
- //@ts-ignore -- this is ensured below
9
- let value = props[propsName];
10
- if (!validValue.includes(value)) {
11
- console.warn(`'${propsName}' props should be a number in this list: ` +
12
- '0, 1, 2, 4, 8, 12, 14, 16, 20, 24, 28, 32');
13
- return null;
14
- }
15
- const result = spacingFields
16
- .map((param) => `${param}: ${spacing[`sp${value}`]}`)
17
- .join(';');
18
- return result;
19
- };
20
- const m = createSpacingFn('m', ['margin']);
21
- const mt = createSpacingFn('mt', ['margin-top']);
22
- const mr = createSpacingFn('mr', ['margin-right']);
23
- const mb = createSpacingFn('mb', ['margin-bottom']);
24
- const ml = createSpacingFn('ml', ['margin-left']);
25
- const mx = createSpacingFn('mx', ['margin-left', 'margin-right']);
26
- const my = createSpacingFn('my', ['margin-top', 'margin-bottom']);
27
- const p = createSpacingFn('p', ['padding']);
28
- const pt = createSpacingFn('pt', ['padding-top']);
29
- const pr = createSpacingFn('pr', ['padding-right']);
30
- const pb = createSpacingFn('pb', ['padding-bottom']);
31
- const pl = createSpacingFn('pl', ['padding-left']);
32
- const px = createSpacingFn('px', ['padding-left', 'padding-right']);
33
- const py = createSpacingFn('py', ['padding-top', 'padding-bottom']);
34
- /**
35
- * @deprecated
36
- * Please use Box with import { Box } from '@scality/core-ui/dist/next';
37
- *
38
- * Most common use cases:
39
- *
40
- * `<SpacedBox m={14}><Component /></SpacedBox>`
41
- *
42
- * `<SpacedBox as={SpanComponent}><Component /></SpacedBox>`
43
- *
44
- * Props : m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py
45
- *
46
- * Values: 0, 1, 2, 4, 8, 12, 14, 16, 20, 24, 28, 32
47
- */
48
- const SpacedBox = styled.div `
49
- ${m};
50
- ${mt};
51
- ${mr};
52
- ${mb};
53
- ${ml};
54
- ${mx};
55
- ${my};
56
- ${p};
57
- ${pt};
58
- ${pr};
59
- ${pb};
60
- ${pl};
61
- ${px};
62
- ${py};
63
- `;
64
- export { SpacedBox };
@@ -1,18 +0,0 @@
1
- type Props = {
2
- id: string;
3
- title?: string;
4
- width?: number;
5
- height?: number;
6
- data: Array<Record<string, any>>;
7
- xAxis: Record<string, any>;
8
- yAxis: Record<string, any>;
9
- row: Record<string, any>;
10
- lineConfig?: Record<string, any>;
11
- sparkLineColor?: string;
12
- upTrendColor?: string;
13
- bottomTrendColor?: string;
14
- };
15
- declare function SparkLine({ id, title, width, height, data, xAxis, yAxis, row, lineConfig, sparkLineColor, upTrendColor, bottomTrendColor, }: Props): import("react/jsx-runtime").JSX.Element;
16
- export declare const Sparkline: typeof SparkLine;
17
- export {};
18
- //# sourceMappingURL=SparkLine.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SparkLine.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/sparkline/SparkLine.component.tsx"],"names":[],"mappings":"AAEA,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,iBAAS,SAAS,CAAC,EACjB,EAAE,EACF,KAAK,EACL,KAAW,EACX,MAAW,EACX,IAAI,EACJ,KAAK,EACL,KAAK,EACL,GAAG,EACH,UAAU,EACV,cAAc,EACd,YAA2B,EAC3B,gBAAwB,GACzB,EAAE,KAAK,2CA+IP;AAED,eAAO,MAAM,SAAS,kBAAY,CAAC"}
@@ -1,148 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { VegaChart } from '../vegachart/VegaChart.component';
3
- import { yellowOrange, green } from '../../style/theme';
4
- function SparkLine({ id, title, width = 300, height = 80, data, xAxis, yAxis, row, lineConfig, sparkLineColor, upTrendColor = yellowOrange, bottomTrendColor = green, }) {
5
- const spec = {
6
- title: {
7
- text: title,
8
- },
9
- data: {
10
- values: data,
11
- },
12
- facet: {
13
- row,
14
- },
15
- spec: {
16
- width,
17
- height,
18
- layer: [
19
- // display the sparkline chart
20
- {
21
- mark: {
22
- type: 'line',
23
- ...lineConfig,
24
- },
25
- encoding: {
26
- x: xAxis,
27
- y: yAxis,
28
- color: {
29
- value: sparkLineColor,
30
- },
31
- },
32
- }, // display the label to specify the max/min data
33
- {
34
- mark: {
35
- type: 'text',
36
- style: 'labelMin',
37
- align: 'bottom',
38
- dy: height / 2,
39
- dx: width / 2 + 10,
40
- },
41
- encoding: {
42
- text: {
43
- aggregate: 'min',
44
- field: 'y',
45
- type: 'quantitative',
46
- },
47
- },
48
- },
49
- {
50
- mark: {
51
- type: 'text',
52
- style: 'labelMax',
53
- align: 'top',
54
- dy: -(height / 2),
55
- dx: width / 2 + 10,
56
- },
57
- encoding: {
58
- text: {
59
- aggregate: 'max',
60
- field: 'y',
61
- type: 'quantitative',
62
- },
63
- },
64
- }, // display the up and bottom trend line
65
- {
66
- mark: {
67
- type: 'rule',
68
- style: 'ruleMaxEnd',
69
- color: upTrendColor,
70
- },
71
- encoding: {
72
- y: {
73
- aggregate: 'max',
74
- field: 'y',
75
- type: 'quantitative',
76
- },
77
- x: {
78
- value: width - 15,
79
- },
80
- x2: {
81
- value: width,
82
- },
83
- },
84
- },
85
- {
86
- mark: {
87
- type: 'rule',
88
- style: 'ruleMaxStart',
89
- color: upTrendColor,
90
- opacity: 0.1,
91
- },
92
- encoding: {
93
- y: {
94
- aggregate: 'max',
95
- field: 'y',
96
- type: 'quantitative',
97
- },
98
- x: {
99
- value: 0,
100
- },
101
- x2: {
102
- value: width - 15,
103
- },
104
- },
105
- },
106
- {
107
- mark: {
108
- type: 'rule',
109
- style: 'ruleMinEnd',
110
- color: bottomTrendColor,
111
- },
112
- encoding: {
113
- y: {
114
- value: height,
115
- },
116
- x: {
117
- value: width - 15,
118
- },
119
- x2: {
120
- value: width,
121
- },
122
- },
123
- },
124
- {
125
- mark: {
126
- type: 'rule',
127
- style: 'ruleMinStart',
128
- color: bottomTrendColor,
129
- opacity: 0.1,
130
- },
131
- encoding: {
132
- y: {
133
- value: height,
134
- },
135
- x: {
136
- value: 0,
137
- },
138
- x2: {
139
- value: width - 15,
140
- },
141
- },
142
- },
143
- ],
144
- },
145
- };
146
- return _jsx(VegaChart, { className: "sc-sparkline", id: id, spec: spec });
147
- }
148
- export const Sparkline = SparkLine;
@@ -1,13 +0,0 @@
1
- export declare const TOP = "top";
2
- export declare const BOTTOM = "bottom";
3
- type Position = typeof TOP | typeof BOTTOM;
4
- type Props = {
5
- id: string;
6
- spec: Record<string, any>;
7
- tooltipPosition?: Position;
8
- theme?: 'light' | 'dark' | 'custom';
9
- className?: string;
10
- };
11
- declare function VegaChart({ id, spec, tooltipPosition, theme, }: Props): import("react/jsx-runtime").JSX.Element;
12
- export { VegaChart };
13
- //# sourceMappingURL=VegaChart.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VegaChart.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/vegachart/VegaChart.component.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,KAAK,QAAQ,GAAG,OAAO,GAAG,GAAG,OAAO,MAAM,CAAC;AAC3C,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA0BF,iBAAS,SAAS,CAAC,EACjB,EAAE,EACF,IAAI,EACJ,eAAwB,EACxB,KAAgB,GACjB,EAAE,KAAK,2CAkGP;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}