@react-magma/charts 12.0.1 → 13.0.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 (82) hide show
  1. package/dist/charts.js +1 -2450
  2. package/dist/charts.js.map +1 -1
  3. package/dist/charts.modern.module.js +1 -2428
  4. package/dist/charts.modern.module.js.map +1 -1
  5. package/dist/charts.umd.js +1 -48555
  6. package/dist/charts.umd.js.map +1 -1
  7. package/dist/components/CarbonChart/CarbonChart.d.ts +1 -2
  8. package/dist/components/CarbonChart/CarbonChart.test.d.ts +1 -0
  9. package/dist/components/CarbonChart/embeddedStyles.d.ts +1 -0
  10. package/dist/index.d.ts +0 -1
  11. package/package.json +25 -27
  12. package/src/components/CarbonChart/CarbonChart.tsx +18 -13
  13. package/src/components/CarbonChart/CarbonChartArea.stories.tsx +1 -1
  14. package/src/components/CarbonChart/CarbonChartAreaStacked.stories.tsx +1 -1
  15. package/src/components/CarbonChart/CarbonChartBar.stories.tsx +1 -1
  16. package/src/components/CarbonChart/CarbonChartBarFloating.stories.tsx +1 -1
  17. package/src/components/CarbonChart/CarbonChartBarGrouped.stories.tsx +1 -1
  18. package/src/components/CarbonChart/CarbonChartBarStacked.stories.tsx +1 -1
  19. package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +1 -1
  20. package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +1 -1
  21. package/src/components/CarbonChart/CarbonChartBullet.stories.tsx +1 -1
  22. package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +1 -1
  23. package/src/components/CarbonChart/CarbonChartDonut.stories.tsx +1 -1
  24. package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +1 -1
  25. package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +1 -1
  26. package/src/components/CarbonChart/CarbonChartLine.stories.tsx +1 -1
  27. package/src/components/CarbonChart/CarbonChartLollipop.stories.tsx +1 -1
  28. package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +1 -1
  29. package/src/components/CarbonChart/CarbonChartPie.stories.tsx +1 -1
  30. package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +1 -1
  31. package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +1 -1
  32. package/src/components/CarbonChart/CarbonChartSparkline.stories.tsx +1 -1
  33. package/src/components/CarbonChart/CarbonChartStep.stories.tsx +1 -1
  34. package/src/components/CarbonChart/embeddedStyles.ts +24880 -0
  35. package/src/index.ts +0 -1
  36. package/dist/components/CarbonChart/CarbonChartArea.stories.d.ts +0 -310
  37. package/dist/components/CarbonChart/CarbonChartAreaStacked.stories.d.ts +0 -136
  38. package/dist/components/CarbonChart/CarbonChartBar.stories.d.ts +0 -214
  39. package/dist/components/CarbonChart/CarbonChartBarFloating.stories.d.ts +0 -82
  40. package/dist/components/CarbonChart/CarbonChartBarGrouped.stories.d.ts +0 -234
  41. package/dist/components/CarbonChart/CarbonChartBarStacked.stories.d.ts +0 -266
  42. package/dist/components/CarbonChart/CarbonChartBoxplot.stories.d.ts +0 -53
  43. package/dist/components/CarbonChart/CarbonChartBubble.stories.d.ts +0 -196
  44. package/dist/components/CarbonChart/CarbonChartBullet.stories.d.ts +0 -35
  45. package/dist/components/CarbonChart/CarbonChartCombo.stories.d.ts +0 -580
  46. package/dist/components/CarbonChart/CarbonChartDonut.stories.d.ts +0 -120
  47. package/dist/components/CarbonChart/CarbonChartGauge.stories.d.ts +0 -43
  48. package/dist/components/CarbonChart/CarbonChartHistogram.stories.d.ts +0 -89
  49. package/dist/components/CarbonChart/CarbonChartLine.stories.d.ts +0 -577
  50. package/dist/components/CarbonChart/CarbonChartLollipop.stories.d.ts +0 -55
  51. package/dist/components/CarbonChart/CarbonChartMeter.stories.d.ts +0 -127
  52. package/dist/components/CarbonChart/CarbonChartPie.stories.d.ts +0 -101
  53. package/dist/components/CarbonChart/CarbonChartRadar.stories.d.ts +0 -98
  54. package/dist/components/CarbonChart/CarbonChartScatter.stories.d.ts +0 -173
  55. package/dist/components/CarbonChart/CarbonChartSparkline.stories.d.ts +0 -51
  56. package/dist/components/CarbonChart/CarbonChartStep.stories.d.ts +0 -38
  57. package/dist/components/LineChart/Chart.d.ts +0 -27
  58. package/dist/components/LineChart/ChartDataTable.d.ts +0 -17
  59. package/dist/components/LineChart/CustomAxisComponent.d.ts +0 -3
  60. package/dist/components/LineChart/CustomPointComponent.d.ts +0 -17
  61. package/dist/components/LineChart/DataTable.d.ts +0 -5
  62. package/dist/components/LineChart/GraphTooltip.d.ts +0 -3
  63. package/dist/components/LineChart/LegendButton.d.ts +0 -6
  64. package/dist/components/LineChart/LineChart.d.ts +0 -67
  65. package/dist/components/LineChart/LineChart.stories.d.ts +0 -113
  66. package/dist/components/LineChart/index.d.ts +0 -1
  67. package/dist/components/LineChart/magma-charts.d.ts +0 -1
  68. package/src/components/CarbonChart/carbon-charts.css +0 -7303
  69. package/src/components/LineChart/Chart.tsx +0 -241
  70. package/src/components/LineChart/ChartDataTable.test.js +0 -165
  71. package/src/components/LineChart/ChartDataTable.tsx +0 -135
  72. package/src/components/LineChart/CustomAxisComponent.tsx +0 -30
  73. package/src/components/LineChart/CustomPointComponent.tsx +0 -93
  74. package/src/components/LineChart/DataTable.tsx +0 -57
  75. package/src/components/LineChart/GraphTooltip.tsx +0 -100
  76. package/src/components/LineChart/LegendButton.tsx +0 -77
  77. package/src/components/LineChart/LineChart.stories.tsx +0 -399
  78. package/src/components/LineChart/LineChart.test.js +0 -501
  79. package/src/components/LineChart/LineChart.tsx +0 -669
  80. package/src/components/LineChart/index.ts +0 -1
  81. package/src/components/LineChart/magma-charts.ts +0 -279
  82. package/src/components/LineChart/test/exampleChartData.js +0 -289
@@ -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 './carbon-charts.css';
5
4
  export declare enum CarbonChartType {
6
5
  area = "area",
7
6
  areaStacked = "areaStacked",
@@ -23,7 +22,7 @@ export declare enum CarbonChartType {
23
22
  combo = "combo"
24
23
  }
25
24
  export interface CarbonChartProps extends React.HTMLAttributes<HTMLDivElement> {
26
- dataSet: Array<Object>;
25
+ dataSet: Array<object>;
27
26
  isInverse?: boolean;
28
27
  /**
29
28
  * For a complete list of options, see Carbon Charts documentation
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const carbonChartStyles: import("@emotion/react").SerializedStyles;
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- export * from './components/LineChart';
2
1
  export * from './components/CarbonChart';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-magma/charts",
3
- "version": "12.0.1",
3
+ "version": "13.0.0",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -19,40 +19,38 @@
19
19
  "src"
20
20
  ],
21
21
  "scripts": {
22
- "build": "rollup -c rollup.config.js --bundleConfigAsCjs",
23
- "build-watch": "rollup -c rollup.config.js --watch --bundleConfigAsCjs",
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",
24
24
  "lint": "eslint ./src",
25
+ "lint:fix": "eslint ./src --fix",
26
+ "lint:check": "eslint ./src --max-warnings=0",
25
27
  "test": "jest",
26
- "test-watch": "jest --watch"
28
+ "test-watch": "jest --watch",
29
+ "compiler-checks": "tsc --noEmit --project ./tsconfig.json"
27
30
  },
28
31
  "dependencies": {
29
- "@carbon/charts-react": "^1.14.8",
30
- "d3": "^7.9.0",
31
- "d3-cloud": "^1.2.7",
32
- "d3-sankey": "^0.12.3",
33
- "victory": "^37.3.6"
32
+ "@carbon/charts-react": "1.23.7",
33
+ "d3": "7.9.0",
34
+ "d3-cloud": "1.2.7",
35
+ "d3-sankey": "0.12.3"
34
36
  },
35
37
  "devDependencies": {
36
- "@emotion/react": "^11.13.0",
37
- "@emotion/styled": "^11.13.0",
38
- "@rollup/plugin-commonjs": "^28.0.8",
39
- "@rollup/plugin-node-resolve": "^16.0.3",
40
- "@rollup/plugin-typescript": "^12.1.4",
41
- "dom-to-image-more": "3.1.4",
42
- "identity-obj-proxy": "^3.0.0",
43
- "react": "^17.0.2",
44
- "react-dom": "^17.0.2",
45
- "react-magma-dom": "^4.10.1",
46
- "react-magma-icons": "^3.2.0",
47
- "rollup": "^4.52.4",
48
- "rollup-plugin-postcss": "^4.0.2"
38
+ "@emotion/react": "11.14.0",
39
+ "@emotion/styled": "11.14.0",
40
+ "dom-to-image-more": "3.6.0",
41
+ "framer-motion": "^12.23.22",
42
+ "identity-obj-proxy": "3.0.0",
43
+ "react": "18.3.1",
44
+ "react-dom": "18.3.1",
45
+ "react-magma-dom": "4.9.0-next.27",
46
+ "react-magma-icons": "^3.1.0"
49
47
  },
50
48
  "peerDependencies": {
51
- "@emotion/react": "^11.13.0",
52
- "@emotion/styled": "^11.13.0",
53
- "react": "^17.0.2",
54
- "react-dom": "^17.0.2",
55
- "react-magma-dom": "^4.10.1-next.0",
49
+ "@emotion/react": "^11.14.0",
50
+ "@emotion/styled": "^11.14.0",
51
+ "react": "^18.3.1",
52
+ "react-dom": "^18.3.1",
53
+ "react-magma-dom": "^4.9.0-next.27",
56
54
  "react-magma-icons": "^3.2.0"
57
55
  },
58
56
  "engines": {
@@ -21,11 +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
28
 
28
- import './carbon-charts.css';
29
+ import { carbonChartStyles } from './embeddedStyles';
29
30
 
30
31
  export enum CarbonChartType {
31
32
  area = 'area',
@@ -49,7 +50,7 @@ export enum CarbonChartType {
49
50
  }
50
51
 
51
52
  export interface CarbonChartProps extends React.HTMLAttributes<HTMLDivElement> {
52
- dataSet: Array<Object>;
53
+ dataSet: Array<object>;
53
54
  isInverse?: boolean;
54
55
  /**
55
56
  * For a complete list of options, see Carbon Charts documentation
@@ -582,6 +583,7 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
582
583
  ? allInverseColors[i]
583
584
  : allColors[i]);
584
585
  }
586
+
585
587
  return {};
586
588
  });
587
589
 
@@ -614,17 +616,20 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
614
616
  const groupsLength = Object.keys(buildColors()).length;
615
617
 
616
618
  return (
617
- <CarbonChartWrapper
618
- data-testid={testId}
619
- ref={ref}
620
- isInverse={isInverse}
621
- theme={theme}
622
- className="carbon-chart-wrapper"
623
- groupsLength={groupsLength < 6 ? groupsLength : 14}
624
- {...rest}
625
- >
626
- <ChartType data={dataSet} options={newOptions} />
627
- </CarbonChartWrapper>
619
+ <React.Fragment>
620
+ <Global styles={carbonChartStyles} />
621
+ <CarbonChartWrapper
622
+ data-testid={testId}
623
+ ref={ref}
624
+ isInverse={isInverse}
625
+ theme={theme}
626
+ className="carbon-chart-wrapper"
627
+ groupsLength={groupsLength < 6 ? groupsLength : 14}
628
+ {...rest}
629
+ >
630
+ <ChartType data={dataSet} options={newOptions} />
631
+ </CarbonChartWrapper>
632
+ </React.Fragment>
628
633
  );
629
634
  }
630
635
  );
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { StoryFn, Meta } from '@storybook/react/types-6-0';
3
+ import { StoryFn, Meta } from '@storybook/react';
4
4
  import { Card } from 'react-magma-dom';
5
5
 
6
6
  import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';