@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,27 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { VegaChart } from '../vegachart/VegaChart.component';
3
- function AreaChart({ id, data, xAxis, yAxis, color, height = 300, width = 1000, areas = [], ...rest }) {
4
- const lines = yAxis.map((y) => ({
5
- mark: {
6
- type: 'line',
7
- },
8
- encoding: {
9
- y,
10
- },
11
- }));
12
- const spec = {
13
- data: {
14
- values: data,
15
- },
16
- encoding: {
17
- x: xAxis,
18
- color,
19
- },
20
- layer: [...lines, ...areas],
21
- height,
22
- width,
23
- ...rest,
24
- };
25
- return _jsx(VegaChart, { className: "sc-areachart", id: id, spec: spec });
26
- }
27
- export { AreaChart };
@@ -1,21 +0,0 @@
1
- import { Size } from '../constants';
2
- type Props = {
3
- text: string;
4
- variant?: 'statusHealthy' | 'statusWarning' | 'statusCritical' | 'infoPrimary' | 'infoSecondary';
5
- icon?: JSX.Element;
6
- onClick?: (arg0: any) => void;
7
- onRemove?: (arg0: any) => void;
8
- size?: Size;
9
- };
10
- export declare const ChipsIcon: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
11
- variant: any;
12
- text: string;
13
- size: Size;
14
- }, never>;
15
- export declare const ChipsText: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
16
- icon: any;
17
- isRemovable: boolean;
18
- }, never>;
19
- declare const Chips: ({ text, variant, icon, onClick, onRemove, size, }: Props) => import("react/jsx-runtime").JSX.Element;
20
- export { Chips };
21
- //# sourceMappingURL=Chips.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chips.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/chips/Chips.component.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EACJ,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,aAAa,GACb,eAAe,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AA0FF,eAAO,MAAM,SAAS;aACX,GAAG;UACN,MAAM;UACN,IAAI;SAOX,CAAC;AACF,eAAO,MAAM,SAAS;UAAuB,GAAG;iBAAe,OAAO;SAKrE,CAAC;AAEF,QAAA,MAAM,KAAK,sDAOR,KAAK,4CAgCP,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,105 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { lighten } from 'polished';
3
- import styled, { css } from 'styled-components';
4
- import { fontSize, grayLight, white } from '../../style/theme';
5
- import { Button } from '../button/Button.component';
6
- import { Icon } from '../icon/Icon.component';
7
- const ChipsContainer = styled.div `
8
- display: inline-flex;
9
- .sc-chips-remove {
10
- padding-right: 10px;
11
- color: ${white};
12
- &:hover {
13
- color: ${grayLight};
14
- }
15
- }
16
- ${(props) => {
17
- switch (props.size) {
18
- case 'smaller':
19
- return css `
20
- border-radius: 10px;
21
- .sc-chips-icon {
22
- border-radius: 10px;
23
- padding: 5px;
24
- }
25
- `;
26
- case 'small':
27
- return css `
28
- border-radius: 12px;
29
- .sc-chips-icon {
30
- border-radius: 12px;
31
- padding: 6px;
32
- }
33
- `;
34
- case 'large':
35
- return css `
36
- border-radius: 14px;
37
- .sc-chips-icon {
38
- border-radius: 14px;
39
- padding: 6px;
40
- }
41
- `;
42
- case 'larger':
43
- return css `
44
- border-radius: 17px;
45
- .sc-chips-icon {
46
- border-radius: 17px;
47
- padding: 7px;
48
- }
49
- `;
50
- default:
51
- return css `
52
- border-radius: 12px;
53
- .sc-chips-icon {
54
- border-radius: 12px;
55
- padding: 6px;
56
- }
57
- `;
58
- }
59
- }}
60
- ${(props) => {
61
- const brand = props.theme;
62
- return css `
63
- color: ${brand.textReverse};
64
- `;
65
- }}
66
-
67
- ${(props) => {
68
- const brand = props.theme;
69
- const brandLight = lighten(0.1, brand[props.variant]).toString();
70
- return props.onClick
71
- ? css `
72
- background-color: ${brand[props.variant]};
73
- font-size: ${fontSize[props.size || 'base']};
74
- &:hover {
75
- cursor: pointer;
76
- background-color: ${brandLight};
77
- }
78
- &:active {
79
- background-color: ${brand[props.variant]};
80
- }
81
- `
82
- : css `
83
- background-color: ${brand[props.variant]};
84
- font-size: ${fontSize[props.size || 'base']};
85
- `;
86
- }}
87
- `;
88
- export const ChipsIcon = styled.span `
89
- display: inline-flex;
90
- justify-content: center;
91
- align-items: center;
92
- background-color: ${(props) => lighten(0.15, props.theme[props.variant]).toString()};
93
- `;
94
- export const ChipsText = styled.span `
95
- display: inline-flex;
96
- justify-content: center;
97
- align-items: center;
98
- padding: ${(props) => (props.icon || props.isRemovable ? '5px' : '5px 10px')};
99
- `;
100
- const Chips = ({ text = '', variant = 'infoPrimary', icon = undefined, onClick, onRemove, size = 'base', }) => (_jsxs(ChipsContainer, { className: "sc-chips", onClick: onClick, variant: variant, icon: icon, size: size, children: [icon && (_jsx(ChipsIcon, { className: "sc-chips-icon", text: text, variant: variant, size: size, children: icon })), _jsx(ChipsText, { className: "sc-chips-text", icon: icon, isRemovable: !!onRemove, children: text }), onRemove && (_jsx(Button
101
- // @ts-ignore
102
- , {
103
- // @ts-ignore
104
- className: "sc-chips-remove", size: size, inverted: true, icon: _jsx(Icon, { name: "Close" }), onClick: onRemove }))] }));
105
- export { Chips };
@@ -1,10 +0,0 @@
1
- export type CloudProgressBarProps = {
2
- percentage: number;
3
- borderSize: string;
4
- cloudColor?: string;
5
- progressCloudColor?: string;
6
- children: JSX.Element;
7
- };
8
- declare const CloudProgressBar: ({ percentage, borderSize, cloudColor, progressCloudColor, children, }: CloudProgressBarProps) => import("react/jsx-runtime").JSX.Element;
9
- export { CloudProgressBar };
10
- //# sourceMappingURL=CloudProgressBar.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CloudProgressBar.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/cloudprogressbar/CloudProgressBar.component.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB,CAAC;AA6EF,QAAA,MAAM,gBAAgB,0EAMnB,qBAAqB,4CAWvB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,38 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled, { css, keyframes } from 'styled-components';
3
- import { coreUIAvailableThemes } from '../../style/theme';
4
- const keyFrameCloud = (props) => {
5
- return keyframes `
6
- from {
7
- height:100%
8
- }
9
- to {
10
- height:${100 - props.percentage}%
11
- }`;
12
- };
13
- const Container = styled.div `
14
- ${(props) => {
15
- return css `
16
- text-align: center;
17
- position: relative;
18
- `;
19
- }}
20
- `;
21
- const ContainerProgress = styled.div `
22
- ${(props) => {
23
- return css `
24
- animation-duration: 1s;
25
- animation-fill-mode: both;
26
- animation-name: ${keyFrameCloud};
27
- position: absolute;
28
- top: 0;
29
- left: 0;
30
- width: 100%;
31
- overflow: hidden;
32
- `;
33
- }}
34
- `;
35
- const Cloud = ({ strokeColor, borderSize }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 15 72 42", enableBackground: "new 0 0 72 72", children: _jsx("g", { children: _jsx("path", { fill: "none", stroke: strokeColor, strokeWidth: borderSize, strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: "10", d: "M15.9,30.3c0,0.4-0.4,0.8-0.8,0.8C10,31.6,6,36.7,6,42.9c0,6.6,4.5,11.9,10.2,11.9h38.7C61,54.8,66,49.1,66,42.2c0-6.6-4.6-12.1-10.4-12.5c-0.4,0-0.8-0.3-0.9-0.8c-1.3-6.7-7.3-11.7-14.3-11.7c-4.6,0-8.7,2.1-11.3,5.4C28.8,23,28.3,23.1,28,23c-1-0.4-2.1-0.6-3.3-0.6C20.1,22.3,16.3,25.8,15.9,30.3z" }) }) }));
36
- const CloudProgress = ({ strokeColor, percentage, borderSize }) => (_jsx(ContainerProgress, { percentage: percentage, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 15 72 42", enableBackground: "new 0 0 72 72", children: _jsx("g", { children: _jsx("path", { fill: "none", stroke: strokeColor, strokeWidth: borderSize, strokeLinecap: "round", strokeLinejoin: "round", strokeMiterlimit: "10", d: "M15.9,30.3c0,0.4-0.4,0.8-0.8,0.8C10,31.6,6,36.7,6,42.9c0,6.6,4.5,11.9,10.2,11.9h38.7C61,54.8,66,49.1,66,42.2c0-6.6-4.6-12.1-10.4-12.5c-0.4,0-0.8-0.3-0.9-0.8c-1.3-6.7-7.3-11.7-14.3-11.7c-4.6,0-8.7,2.1-11.3,5.4C28.8,23,28.3,23.1,28,23c-1-0.4-2.1-0.6-3.3-0.6C20.1,22.3,16.3,25.8,15.9,30.3z" }) }) }) }));
37
- const CloudProgressBar = ({ percentage = 0, borderSize = '2px', cloudColor = coreUIAvailableThemes.darkRebrand.statusHealthy, progressCloudColor = coreUIAvailableThemes.darkRebrand.backgroundLevel1, children, }) => (_jsxs(Container, { className: "sc-cloudprogressbar", children: [_jsx(Cloud, { strokeColor: progressCloudColor, borderSize: borderSize }), _jsx(CloudProgress, { strokeColor: cloudColor, percentage: percentage, borderSize: borderSize }), children] }));
38
- export { CloudProgressBar };
@@ -1,9 +0,0 @@
1
- type Props = {
2
- expanded: boolean;
3
- onHeaderClick: (arg0: any) => void;
4
- children: React.ReactNode;
5
- headerItems: Array<JSX.Element>;
6
- };
7
- declare function CollapsiblePanel({ expanded, onHeaderClick, children, headerItems, }: Props): import("react/jsx-runtime").JSX.Element;
8
- export { CollapsiblePanel };
9
- //# sourceMappingURL=CollapsiblePanel.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollapsiblePanel.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/collapsiblepanel/CollapsiblePanel.component.tsx"],"names":[],"mappings":"AAIA,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAqCF,iBAAS,gBAAgB,CAAC,EACxB,QAAgB,EAChB,aAAa,EACb,QAAQ,EACR,WAAgB,GACjB,EAAE,KAAK,2CAuBP;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,44 +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 } from '../../style/theme';
5
- import { Icon } from '../icon/Icon.component';
6
- const ARROW = {
7
- colapsed: 'fas fa-angle-down',
8
- expanded: 'fas fa-angle-up',
9
- };
10
- const HeaderText = styled.div `
11
- display: flex;
12
- align-items: center;
13
- flex-grow: 1;
14
- `;
15
- const HeaderItem = styled.div `
16
- margin-right: ${spacing.r16};
17
- display: flex;
18
- flex-grow: 1;
19
- `;
20
- const HeaderIcon = styled.div `
21
- font-size: ${fontSize.larger};
22
- margin: 0 ${spacing.r16};
23
- `;
24
- const CollapsiblePanelContainer = styled.div `
25
- display: flex;
26
- flex-direction: column;
27
- border-radius: 4px;
28
- background-color: ${(props) => props.theme.backgroundLevel1};
29
- color: ${(props) => props.theme.textPrimary};
30
- `;
31
- const HeaderContainer = styled.div `
32
- display: flex;
33
- cursor: pointer;
34
- padding: ${spacing.r16};
35
- `;
36
- const ExpandedContainer = styled.div `
37
- padding: ${spacing.r16};
38
- color: ${(props) => props.theme.textPrimary};
39
- background-color: ${(props) => props.theme.backgroundLevel1};
40
- `;
41
- function CollapsiblePanel({ expanded = false, onHeaderClick, children, headerItems = [], }) {
42
- return (_jsxs(CollapsiblePanelContainer, { className: "sc-collapsiblepanel", children: [_jsxs(HeaderContainer, { onClick: onHeaderClick, className: "sc-collapsiblepanel-header", children: [_jsx(HeaderText, { children: headerItems.map((item, index) => (_jsx(HeaderItem, { children: item }, index))) }), _jsx(HeaderIcon, { children: _jsx(Icon, { name: expanded ? 'Dropdown-up' : 'Dropdown-down' }) })] }), expanded && (_jsx(ExpandedContainer, { className: "sc-collapsiblepanel-content", children: children }))] }));
43
- }
44
- export { CollapsiblePanel };
@@ -1,21 +0,0 @@
1
- import { $PropertyType } from 'utility-types';
2
- import type { Encoding, Field } from 'vega-lite';
3
- type Props = {
4
- id: string;
5
- data: Array<Record<string, any>>;
6
- xAxis: Record<string, any>;
7
- yAxis: Array<Record<string, any>>;
8
- color?: Record<string, any>;
9
- tooltip?: boolean;
10
- lineConfig?: Record<string, any>;
11
- width?: number;
12
- height?: number;
13
- displayTrendLine?: boolean;
14
- strokeDashEncodingConfig?: $PropertyType<Encoding<Field>, 'strokeDash'>;
15
- opacityEncodingConfig?: $PropertyType<Encoding<Field>, 'opacity'>;
16
- tooltipConfig?: $PropertyType<Encoding<Field>, 'tooltip'>;
17
- tooltipTheme?: 'light' | 'dark' | 'custom';
18
- };
19
- declare function LineChart({ id, data, xAxis, yAxis, color, tooltip, lineConfig, height, width, displayTrendLine, strokeDashEncodingConfig, opacityEncodingConfig, tooltipConfig, tooltipTheme, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
20
- export { LineChart };
21
- //# sourceMappingURL=LineChart.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LineChart.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/linechart/LineChart.component.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACjD,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,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,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,wBAAwB,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;IACxE,qBAAqB,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IAClE,aAAa,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IAC1D,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;CAC5C,CAAC;AAEF,iBAAS,SAAS,CAAC,EACjB,EAAE,EACF,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,OAAe,EACf,UAAU,EACV,MAAY,EACZ,KAAY,EACZ,gBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,KAAK,2CAgHP;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -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"}