@react-magma/charts 7.0.1-next.3 → 8.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.js +1 -1
- package/dist/charts.js.map +1 -1
- package/dist/charts.modern.js +16 -18
- package/dist/charts.modern.js.map +1 -1
- package/dist/charts.modern.module.js +1 -1
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +1 -1
- package/dist/charts.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/components/CarbonChart/CarbonChart.tsx +5 -9
- package/src/components/LineChart/Chart.tsx +7 -10
- package/src/components/LineChart/GraphTooltip.tsx +3 -4
- package/src/components/LineChart/LineChart.tsx +5 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-magma/charts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-next.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"lint": "eslint ./src"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@emotion/
|
|
30
|
-
"@emotion/styled": "^
|
|
29
|
+
"@emotion/react": "^11.13.0",
|
|
30
|
+
"@emotion/styled": "^11.13.0",
|
|
31
31
|
"react": "^17.0.2",
|
|
32
32
|
"react-dom": "^17.0.2",
|
|
33
|
-
"react-magma-dom": "^4.
|
|
33
|
+
"react-magma-dom": "^4.5.0-next.7",
|
|
34
34
|
"react-magma-icons": "^3.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"victory": "^35.4.12"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@emotion/
|
|
45
|
-
"@emotion/styled": "^
|
|
44
|
+
"@emotion/react": "^11.13.0",
|
|
45
|
+
"@emotion/styled": "^11.13.0",
|
|
46
46
|
"dom-to-image-more": "3.1.4",
|
|
47
47
|
"identity-obj-proxy": "^3.0.0",
|
|
48
48
|
"react": "^17.0.2",
|
|
49
49
|
"react-dom": "^17.0.2",
|
|
50
|
-
"react-magma-dom": "^4.
|
|
50
|
+
"react-magma-dom": "^4.5.0-next.10",
|
|
51
51
|
"react-magma-icons": "^3.0.0"
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ThemeInterface, ThemeContext, useIsInverse } from 'react-magma-dom';
|
|
3
3
|
import { transparentize } from 'polished';
|
|
4
|
-
import styled
|
|
4
|
+
import styled from '@emotion/styled';
|
|
5
5
|
import {
|
|
6
6
|
AreaChart,
|
|
7
7
|
StackedAreaChart,
|
|
@@ -15,8 +15,6 @@ import {
|
|
|
15
15
|
} from '@carbon/charts-react';
|
|
16
16
|
import './styles.min.css';
|
|
17
17
|
|
|
18
|
-
const typedStyled = styled as CreateStyled<ThemeInterface>;
|
|
19
|
-
|
|
20
18
|
export enum CarbonChartType {
|
|
21
19
|
area = 'area',
|
|
22
20
|
areaStacked = 'areaStacked',
|
|
@@ -47,7 +45,7 @@ export interface CarbonChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
47
45
|
type: CarbonChartType;
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
const CarbonChartWrapper =
|
|
48
|
+
const CarbonChartWrapper = styled.div<{
|
|
51
49
|
isInverse?: boolean;
|
|
52
50
|
theme: ThemeInterface;
|
|
53
51
|
}>`
|
|
@@ -217,7 +215,6 @@ const CarbonChartWrapper = typedStyled.div<{
|
|
|
217
215
|
props.isInverse
|
|
218
216
|
? props.theme.colors.primary600
|
|
219
217
|
: props.theme.colors.neutral100});
|
|
220
|
-
}
|
|
221
218
|
}
|
|
222
219
|
.cds--cc--lollipop circle.dot.filled,
|
|
223
220
|
.cds--cc--lollipop circle.dot.hovered {
|
|
@@ -233,15 +230,15 @@ const CarbonChartWrapper = typedStyled.div<{
|
|
|
233
230
|
drop-shadow( 1px 0px 0px ${props =>
|
|
234
231
|
props.isInverse
|
|
235
232
|
? props.theme.colors.primary600
|
|
236
|
-
: props.theme.colors.neutral100})
|
|
233
|
+
: props.theme.colors.neutral100});
|
|
237
234
|
drop-shadow(-1px 0px 0px ${props =>
|
|
238
235
|
props.isInverse
|
|
239
236
|
? props.theme.colors.primary600
|
|
240
|
-
: props.theme.colors.neutral100})
|
|
237
|
+
: props.theme.colors.neutral100});
|
|
241
238
|
drop-shadow( 0px 1px 0px ${props =>
|
|
242
239
|
props.isInverse
|
|
243
240
|
? props.theme.colors.primary600
|
|
244
|
-
: props.theme.colors.neutral100})
|
|
241
|
+
: props.theme.colors.neutral100});
|
|
245
242
|
drop-shadow( 0px -1px 0px ${props =>
|
|
246
243
|
props.isInverse
|
|
247
244
|
? props.theme.colors.primary600
|
|
@@ -295,7 +292,6 @@ const CarbonChartWrapper = typedStyled.div<{
|
|
|
295
292
|
props.isInverse
|
|
296
293
|
? props.theme.colors.focusInverse
|
|
297
294
|
: props.theme.colors.focus} !important;
|
|
298
|
-
}
|
|
299
295
|
outline-offset: 0;
|
|
300
296
|
}
|
|
301
297
|
.cds--overflow-menu-options__btn:focus,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { css } from '@emotion/
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
3
|
import { KeyboardIcon } from 'react-magma-icons';
|
|
4
4
|
|
|
5
5
|
import { LineChart, LineChartProps } from './LineChart';
|
|
@@ -17,15 +17,12 @@ import {
|
|
|
17
17
|
Tabs,
|
|
18
18
|
TabsContainer,
|
|
19
19
|
ThemeContext,
|
|
20
|
-
ThemeInterface,
|
|
21
20
|
Tooltip,
|
|
22
21
|
TypographyVisualStyle,
|
|
23
22
|
useDescendants,
|
|
23
|
+
styled
|
|
24
24
|
} from 'react-magma-dom';
|
|
25
25
|
|
|
26
|
-
import styled, { CreateStyled } from '@emotion/styled';
|
|
27
|
-
const typedStyled = styled as CreateStyled<ThemeInterface>;
|
|
28
|
-
|
|
29
26
|
interface BaseChartProps {
|
|
30
27
|
/**
|
|
31
28
|
* Description of what the line chart data represents placed above the chart
|
|
@@ -49,7 +46,7 @@ export interface ChartProps<T extends any>
|
|
|
49
46
|
Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>,
|
|
50
47
|
LineChartProps<T> {}
|
|
51
48
|
|
|
52
|
-
const StyledTitle =
|
|
49
|
+
const StyledTitle = styled.span`
|
|
53
50
|
color: ${props => props.theme.colors.neutral};
|
|
54
51
|
font-size: ${props => props.theme.typeScale.size04.fontSize};
|
|
55
52
|
font-weight: 600;
|
|
@@ -58,23 +55,23 @@ const StyledTitle = typedStyled.span`
|
|
|
58
55
|
margin: 0 0 12px 0;
|
|
59
56
|
`;
|
|
60
57
|
|
|
61
|
-
const StyledParagraph =
|
|
58
|
+
const StyledParagraph = styled(Paragraph)`
|
|
62
59
|
font-size: ${props => props.theme.typeScale.size02.fontSize};
|
|
63
60
|
margin: 0 0 18px 0;
|
|
64
61
|
`;
|
|
65
62
|
|
|
66
|
-
const StyledTabsContainer =
|
|
63
|
+
const StyledTabsContainer = styled(TabsContainer)`
|
|
67
64
|
width: 800px;
|
|
68
65
|
ul {
|
|
69
66
|
box-shadow: inset 0 -1px 0 ${props => props.theme.colors.neutral300};
|
|
70
67
|
}
|
|
71
68
|
`;
|
|
72
69
|
|
|
73
|
-
const StyledTabPanel =
|
|
70
|
+
const StyledTabPanel = styled(TabPanel)`
|
|
74
71
|
padding: 22px 0;
|
|
75
72
|
`;
|
|
76
73
|
|
|
77
|
-
const KeyboardInstructionsCard =
|
|
74
|
+
const KeyboardInstructionsCard = styled(Card)<{
|
|
78
75
|
isOpen?: boolean;
|
|
79
76
|
maxHeight?: string;
|
|
80
77
|
width?: string;
|
|
@@ -7,11 +7,10 @@ import {
|
|
|
7
7
|
ThemeInterface,
|
|
8
8
|
} from 'react-magma-dom';
|
|
9
9
|
|
|
10
|
-
import styled
|
|
10
|
+
import styled from '@emotion/styled';
|
|
11
11
|
|
|
12
|
-
const typedStyled = styled as CreateStyled<ThemeInterface>;
|
|
13
12
|
|
|
14
|
-
const StyledGraphTooltip =
|
|
13
|
+
const StyledGraphTooltip = styled(StyledTooltip)`
|
|
15
14
|
background: ${(props: any) => props.theme.colors.neutral100};
|
|
16
15
|
border: 1px solid ${(props: any) => props.theme.colors.neutral300};
|
|
17
16
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
|
|
@@ -33,7 +32,7 @@ const StyledGraphTooltip = typedStyled(StyledTooltip)`
|
|
|
33
32
|
}
|
|
34
33
|
`;
|
|
35
34
|
|
|
36
|
-
const TooltipColorSwatch =
|
|
35
|
+
const TooltipColorSwatch = styled.span`
|
|
37
36
|
background: ${(props: any) => props.color};
|
|
38
37
|
border: ${(props: any) => (props.color ? 'none' : '3px solid black')};
|
|
39
38
|
border-radius: 4px;
|
|
@@ -25,8 +25,7 @@ import { CustomScatterDataComponent } from './CustomPointComponent';
|
|
|
25
25
|
import { CustomAxisComponent } from './CustomAxisComponent';
|
|
26
26
|
import { LegendButton } from './LegendButton';
|
|
27
27
|
|
|
28
|
-
import styled
|
|
29
|
-
const typedStyled = styled as CreateStyled<ThemeInterface>;
|
|
28
|
+
import styled from '@emotion/styled';
|
|
30
29
|
|
|
31
30
|
export type LineChartAxisStyle = VictoryAxisProps['style'];
|
|
32
31
|
export type DataGetterPropType = VictoryLineProps['x'];
|
|
@@ -104,7 +103,7 @@ export interface LineChartProps<T extends ChartDataOptions> {
|
|
|
104
103
|
y?: keyof T;
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
const LineChartContainer =
|
|
106
|
+
const LineChartContainer = styled.div`
|
|
108
107
|
max-height: 600px;
|
|
109
108
|
max-width: 800px;
|
|
110
109
|
svg {
|
|
@@ -112,13 +111,13 @@ const LineChartContainer = typedStyled.div`
|
|
|
112
111
|
}
|
|
113
112
|
`;
|
|
114
113
|
|
|
115
|
-
const VictoryChartContainer =
|
|
114
|
+
const VictoryChartContainer = styled.div``;
|
|
116
115
|
|
|
117
|
-
const DataLegendsContainer =
|
|
116
|
+
const DataLegendsContainer = styled.div`
|
|
118
117
|
padding-bottom: 24px;
|
|
119
118
|
`;
|
|
120
119
|
|
|
121
|
-
const DataLegendsDescription =
|
|
120
|
+
const DataLegendsDescription = styled.p`
|
|
122
121
|
color: ${(props: any) => props.theme.colors.neutral};
|
|
123
122
|
font-size: ${(props: any) => props.theme.typeScale.size02.fontSize};
|
|
124
123
|
`;
|