@react-magma/charts 12.0.0-next.4 → 12.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.
@@ -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.5",
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',
@@ -579,17 +581,20 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
579
581
  const groupsLength = Object.keys(buildColors()).length;
580
582
 
581
583
  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>
584
+ <>
585
+ <Global styles={carbonChartStyles} />
586
+ <CarbonChartWrapper
587
+ data-testid={testId}
588
+ ref={ref}
589
+ isInverse={isInverse}
590
+ theme={theme}
591
+ className="carbon-chart-wrapper"
592
+ groupsLength={groupsLength < 6 ? groupsLength : 14}
593
+ {...rest}
594
+ >
595
+ <ChartType data={dataSet} options={newOptions} />
596
+ </CarbonChartWrapper>
597
+ </>
593
598
  );
594
599
  }
595
600
  );