@react-magma/charts 12.0.0-next.4 → 12.0.0-next.6

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.
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ChartOptions } from '@carbon/charts-react';
3
3
  import { ThemeInterface } from 'react-magma-dom';
4
- import './styles.min.css';
5
4
  export declare enum CarbonChartType {
6
5
  area = "area",
7
6
  areaStacked = "areaStacked",
@@ -0,0 +1 @@
1
+ export declare const carbonChartStyles: import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@react-magma/charts",
3
- "version": "12.0.0-next.4",
3
+ "version": "12.0.0-next.6",
4
4
  "license": "MIT",
5
5
  "exports": {
6
- ".": "./src",
7
- "./src/components/CarbonChart/": "./styles.min.css"
6
+ ".": {
7
+ "import": "./dist/charts.modern.module.js",
8
+ "require": "./dist/charts.js",
9
+ "types": "./dist/index.d.ts"
10
+ }
8
11
  },
9
12
  "main": "dist/charts.js",
10
13
  "umd:main": "dist/charts.umd.js",
@@ -13,12 +16,11 @@
13
16
  "types": "dist/index.d.ts",
14
17
  "files": [
15
18
  "dist",
16
- "src",
17
- "src/components/CarbonChart/styles.min.css"
19
+ "src"
18
20
  ],
19
21
  "scripts": {
20
- "build": "microbundle build --jsx jsx --jsxImportSource react --globals react/jsx-runtime=jsx",
21
- "build-watch": "microbundle watch --jsx jsx --jsxImportSource react --globals react/jsx-runtime=jsx",
22
+ "build": "microbundle build --jsx jsx --jsxImportSource react --globals react/jsx-runtime=jsx,@emotion/react=EmotionReact,@emotion/styled=EmotionStyled,@carbon/charts-react=CarbonChartsReact",
23
+ "build-watch": "microbundle watch --jsx jsx --jsxImportSource react --globals react/jsx-runtime=jsx,@emotion/react=EmotionReact,@emotion/styled=EmotionStyled,@carbon/charts-react=CarbonChartsReact",
22
24
  "lint": "eslint ./src",
23
25
  "test": "jest",
24
26
  "test-watch": "jest --watch"
@@ -37,7 +39,7 @@
37
39
  "identity-obj-proxy": "^3.0.0",
38
40
  "react": "^17.0.2",
39
41
  "react-dom": "^17.0.2",
40
- "react-magma-dom": "^4.10.0-next.3",
42
+ "react-magma-dom": "^4.10.0-next.29",
41
43
  "react-magma-icons": "^3.2.0"
42
44
  },
43
45
  "peerDependencies": {
@@ -21,10 +21,12 @@ import {
21
21
  ComboChart,
22
22
  ChartOptions,
23
23
  } from '@carbon/charts-react';
24
+ import { Global } from '@emotion/react';
24
25
  import styled from '@emotion/styled';
25
26
  import { transparentize } from 'polished';
26
27
  import { ThemeInterface, ThemeContext, useIsInverse } from 'react-magma-dom';
27
- import './styles.min.css';
28
+
29
+ import { carbonChartStyles } from './embeddedStyles';
28
30
 
29
31
  export enum CarbonChartType {
30
32
  area = 'area',
@@ -207,6 +209,7 @@ const CarbonChartWrapper = styled.div<{
207
209
  .cds--cc--grid rect.chart-grid-backdrop {
208
210
  fill: transparent;
209
211
  }
212
+ .cds--cc--scatter circle.dot,
210
213
  .cds--cc--scatter circle.dot.hovered {
211
214
  padding: 10px;
212
215
  }
@@ -216,6 +219,36 @@ const CarbonChartWrapper = styled.div<{
216
219
  stroke-width: 6px;
217
220
  transition: 0.1s all linear;
218
221
  }
222
+ .cds--cc--scatter circle.dot {
223
+ filter: drop-shadow(
224
+ 1px 0px 0px
225
+ ${props =>
226
+ props.isInverse
227
+ ? props.theme.colors.primary600
228
+ : props.theme.colors.neutral100}
229
+ )
230
+ drop-shadow(
231
+ -1px 0px 0px
232
+ ${props =>
233
+ props.isInverse
234
+ ? props.theme.colors.primary600
235
+ : props.theme.colors.neutral100}
236
+ )
237
+ drop-shadow(
238
+ 0px 1px 0px
239
+ ${props =>
240
+ props.isInverse
241
+ ? props.theme.colors.primary600
242
+ : props.theme.colors.neutral100}
243
+ )
244
+ drop-shadow(
245
+ 0px -1px 0px
246
+ ${props =>
247
+ props.isInverse
248
+ ? props.theme.colors.primary600
249
+ : props.theme.colors.neutral100}
250
+ );
251
+ }
219
252
  .cds--cc--scatter circle.dot.hovered {
220
253
  stroke-width: 0.5em;
221
254
  transition: 0.1s all linear;
@@ -248,14 +281,17 @@ const CarbonChartWrapper = styled.div<{
248
281
  : props.theme.colors.neutral100}
249
282
  );
250
283
  }
284
+ .cds--cc--lollipop circle.dot,
251
285
  .cds--cc--lollipop circle.dot.filled,
252
286
  .cds--cc--lollipop circle.dot.hovered {
253
287
  stroke-width: 15px;
254
288
  }
289
+ .cds--cc--scatter-stacked circle.dot,
255
290
  .cds--cc--scatter-stacked circle.dot.hovered,
256
291
  .cds--cc--scatter-stacked circle.dot.unfilled,
257
292
  .cds--cc--scatter circle.dot.unfilled,
258
293
  .cds--cc--lollipop circle.dot.filled,
294
+ .cds--cc--lollipop circle.dot,
259
295
  .cds--cc--lollipop circle.dot.hovered {
260
296
  transition: 0.1s all linear;
261
297
  filter: drop-shadow(
@@ -579,17 +615,20 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
579
615
  const groupsLength = Object.keys(buildColors()).length;
580
616
 
581
617
  return (
582
- <CarbonChartWrapper
583
- data-testid={testId}
584
- ref={ref}
585
- isInverse={isInverse}
586
- theme={theme}
587
- className="carbon-chart-wrapper"
588
- groupsLength={groupsLength < 6 ? groupsLength : 14}
589
- {...rest}
590
- >
591
- <ChartType data={dataSet} options={newOptions} />
592
- </CarbonChartWrapper>
618
+ <>
619
+ <Global styles={carbonChartStyles} />
620
+ <CarbonChartWrapper
621
+ data-testid={testId}
622
+ ref={ref}
623
+ isInverse={isInverse}
624
+ theme={theme}
625
+ className="carbon-chart-wrapper"
626
+ groupsLength={groupsLength < 6 ? groupsLength : 14}
627
+ {...rest}
628
+ >
629
+ <ChartType data={dataSet} options={newOptions} />
630
+ </CarbonChartWrapper>
631
+ </>
593
632
  );
594
633
  }
595
634
  );