@spaced-out/ui-design-system 0.1.94-beta.0 → 0.1.94-beta.2

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 (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/components/Charts/{ChartTooltip.module.css → ChartTooltip/ChartTooltip.module.css} +5 -5
  3. package/lib/components/Charts/{ChartTooltip.js → ChartTooltip/index.js} +1 -1
  4. package/lib/components/Charts/{ChartTooltip.js.flow → ChartTooltip/index.js.flow} +2 -2
  5. package/lib/components/{ChartWrapper → Charts/ChartWrapper}/ChartWrapper.js +12 -6
  6. package/lib/components/{ChartWrapper → Charts/ChartWrapper}/ChartWrapper.js.flow +42 -20
  7. package/lib/components/Charts/ChartWrapper/ChartWrapper.module.css +26 -0
  8. package/lib/components/{ColumnChart → Charts/ColumnChart}/ColumnChart.js +4 -2
  9. package/lib/components/{ColumnChart → Charts/ColumnChart}/ColumnChart.js.flow +22 -11
  10. package/lib/components/{ColumnChart → Charts/ColumnChart}/ColumnChart.module.css +2 -2
  11. package/lib/components/{DonutChart → Charts/DonutChart}/DonutChart.js +8 -6
  12. package/lib/components/{DonutChart → Charts/DonutChart}/DonutChart.js.flow +18 -13
  13. package/lib/components/{DonutChart → Charts/DonutChart}/DonutChart.module.css +4 -4
  14. package/lib/components/{LineChart → Charts/LineChart}/LineChart.js +4 -2
  15. package/lib/components/{LineChart → Charts/LineChart}/LineChart.js.flow +21 -10
  16. package/lib/components/{LineChart → Charts/LineChart}/LineChart.module.css +2 -2
  17. package/lib/components/{SpiderChart → Charts/SpiderChart}/SpiderChart.js +4 -2
  18. package/lib/components/{SpiderChart → Charts/SpiderChart}/SpiderChart.js.flow +15 -20
  19. package/lib/components/{SpiderChart → Charts/SpiderChart}/SpiderChart.module.css +2 -2
  20. package/lib/components/Charts/index.js +16 -16
  21. package/lib/components/Charts/index.js.flow +5 -5
  22. package/lib/components/StickyBar/StickyBar.module.css +2 -2
  23. package/lib/types/charts.js.flow +47 -2
  24. package/lib/types/index.js +11 -0
  25. package/lib/types/index.js.flow +1 -0
  26. package/lib/utils/charts/charts.js +8 -3
  27. package/lib/utils/charts/charts.js.flow +8 -3
  28. package/lib/utils/charts/donutChart.js +2 -7
  29. package/lib/utils/charts/donutChart.js.flow +2 -21
  30. package/lib/utils/index.js +11 -0
  31. package/lib/utils/index.js.flow +1 -0
  32. package/package.json +1 -1
  33. package/lib/components/ChartWrapper/ChartWrapper.module.css +0 -19
  34. /package/lib/components/{ChartWrapper → Charts/ChartWrapper}/index.js +0 -0
  35. /package/lib/components/{ChartWrapper → Charts/ChartWrapper}/index.js.flow +0 -0
  36. /package/lib/components/{ColumnChart → Charts/ColumnChart}/index.js +0 -0
  37. /package/lib/components/{ColumnChart → Charts/ColumnChart}/index.js.flow +0 -0
  38. /package/lib/components/{DonutChart → Charts/DonutChart}/index.js +0 -0
  39. /package/lib/components/{DonutChart → Charts/DonutChart}/index.js.flow +0 -0
  40. /package/lib/components/{LineChart → Charts/LineChart}/index.js +0 -0
  41. /package/lib/components/{LineChart → Charts/LineChart}/index.js.flow +0 -0
  42. /package/lib/components/{SpiderChart → Charts/SpiderChart}/index.js +0 -0
  43. /package/lib/components/{SpiderChart → Charts/SpiderChart}/index.js.flow +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.94-beta.2](https://github.com/spaced-out/ui-design-system/compare/v0.1.94-beta.1...v0.1.94-beta.2) (2024-05-14)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * updated the correct folder structure ([#202](https://github.com/spaced-out/ui-design-system/issues/202)) ([ebfc464](https://github.com/spaced-out/ui-design-system/commit/ebfc464e93c7d9c637ef2987e393cf6e8f94c501))
11
+
12
+ ### [0.1.94-beta.1](https://github.com/spaced-out/ui-design-system/compare/v0.1.94-beta.0...v0.1.94-beta.1) (2024-05-13)
13
+
14
+
15
+ ### Features
16
+
17
+ * **charts:** added loading prop to handle loading state for charts ([#201](https://github.com/spaced-out/ui-design-system/issues/201)) ([3d41fc1](https://github.com/spaced-out/ui-design-system/commit/3d41fc1b4ab64b97e80c09ba29f6b664e1b15465))
18
+
5
19
  ### [0.1.94-beta.0](https://github.com/spaced-out/ui-design-system/compare/v0.1.93...v0.1.94-beta.0) (2024-05-13)
6
20
 
7
21
 
@@ -2,11 +2,11 @@
2
2
  fontSize14,
3
3
  fontWeightBook,
4
4
  fontLineHeight150,
5
- fontLetterSpacing0) from '../../styles/variables/_font.css';
6
- @value (colorTextInversePrimary, colorTextInverseSecondary) from '../../styles/variables/_color.css';
7
- @value (spaceNone, spaceXXSmall) from '../../styles/variables/_space.css';
8
- @value (size8) from '../../styles/variables/_size.css';
9
- @value (borderRadiusCircle) from '../../styles/variables/_border.css';
5
+ fontLetterSpacing0) from '../../../styles/variables/_font.css';
6
+ @value (colorTextInversePrimary, colorTextInverseSecondary) from '../../../styles/variables/_color.css';
7
+ @value (spaceNone, spaceXXSmall) from '../../../styles/variables/_space.css';
8
+ @value (size8) from '../../../styles/variables/_size.css';
9
+ @value (borderRadiusCircle) from '../../../styles/variables/_border.css';
10
10
 
11
11
  .tooltipHeader {
12
12
  margin: spaceNone;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.tooltipTheme = void 0;
7
- var _typographyModule = _interopRequireDefault(require("../../styles/typography.module.css"));
7
+ var _typographyModule = _interopRequireDefault(require("../../../styles/typography.module.css"));
8
8
  var _ChartTooltipModule = _interopRequireDefault(require("./ChartTooltip.module.css"));
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
10
 
@@ -1,8 +1,8 @@
1
1
  // @flow strict
2
2
 
3
- import type {Tooltip} from '../../types/charts';
3
+ import type {Tooltip} from '../../../types/charts';
4
4
 
5
- import typographyCss from '../../styles/typography.module.css';
5
+ import typographyCss from '../../../styles/typography.module.css';
6
6
  import css from './ChartTooltip.module.css';
7
7
 
8
8
 
@@ -9,10 +9,11 @@ var _highcharts = _interopRequireDefault(require("highcharts"));
9
9
  var _accessibility = _interopRequireDefault(require("highcharts/modules/accessibility"));
10
10
  var _drilldown = _interopRequireDefault(require("highcharts/modules/drilldown"));
11
11
  var _exporting = _interopRequireDefault(require("highcharts/modules/exporting"));
12
- var _size = require("../../styles/variables/_size");
13
- var _classify = _interopRequireDefault(require("../../utils/classify"));
14
- var _ButtonDropdown = require("../ButtonDropdown");
15
- var _Card = require("../Card");
12
+ var _size = require("../../../styles/variables/_size");
13
+ var _classify = _interopRequireDefault(require("../../../utils/classify"));
14
+ var _ButtonDropdown = require("../../ButtonDropdown");
15
+ var _Card = require("../../Card");
16
+ var _CircularLoader = require("../../CircularLoader");
16
17
  var _ChartWrapperModule = _interopRequireDefault(require("./ChartWrapper.module.css"));
17
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -82,6 +83,7 @@ const CustomExportButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
82
83
  }
83
84
  };
84
85
  return /*#__PURE__*/React.createElement(_ButtonDropdown.ButtonDropdown, {
86
+ ariaLabel: "Export Chart Menu",
85
87
  menu: {
86
88
  isFluid: true,
87
89
  menuDisabled: false,
@@ -98,6 +100,7 @@ const CustomExportButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
98
100
  });
99
101
  const ChartWrapper = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
100
102
  let {
103
+ isLoading,
101
104
  title,
102
105
  children,
103
106
  classNames,
@@ -108,7 +111,10 @@ const ChartWrapper = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
108
111
  classNames: {
109
112
  wrapper: (0, _classify.default)(_ChartWrapperModule.default.wrapper, classNames?.wrapper)
110
113
  }
111
- }, /*#__PURE__*/React.createElement(_Card.CardHeader, {
114
+ }, isLoading ? /*#__PURE__*/React.createElement(_CircularLoader.CircularLoader, {
115
+ size: "large",
116
+ className: (0, _classify.default)(_ChartWrapperModule.default.loader, classNames?.loader)
117
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Card.CardHeader, {
112
118
  className: classNames?.header
113
119
  }, /*#__PURE__*/React.createElement(_Card.CardTitle, {
114
120
  className: classNames?.title
@@ -119,6 +125,6 @@ const ChartWrapper = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
119
125
  customExportOptions: customExportOptions
120
126
  }), headerActions ? headerActions : null)), /*#__PURE__*/React.createElement(_Card.CardContent, {
121
127
  className: (0, _classify.default)(_ChartWrapperModule.default.chartContent, classNames?.content)
122
- }, children));
128
+ }, children)));
123
129
  });
124
130
  exports.ChartWrapper = ChartWrapper;
@@ -10,11 +10,18 @@ import drilldown from 'highcharts/modules/drilldown';
10
10
  //$FlowFixMe[untyped-import]
11
11
  import exporting from 'highcharts/modules/exporting';
12
12
 
13
- import {size180} from '../../styles/variables/_size';
14
- import classify from '../../utils/classify';
15
- import {ANCHOR_POSITION_TYPE, ButtonDropdown} from '../ButtonDropdown';
16
- import {Card, CardActions, CardContent, CardHeader, CardTitle} from '../Card';
17
- import type {MenuOption} from '../Menu';
13
+ import {size180} from '../../../styles/variables/_size';
14
+ import classify from '../../../utils/classify';
15
+ import {ANCHOR_POSITION_TYPE, ButtonDropdown} from '../../ButtonDropdown';
16
+ import {
17
+ Card,
18
+ CardActions,
19
+ CardContent,
20
+ CardHeader,
21
+ CardTitle,
22
+ } from '../../Card';
23
+ import {CircularLoader} from '../../CircularLoader';
24
+ import type {MenuOption} from '../../Menu';
18
25
 
19
26
  import css from './ChartWrapper.module.css';
20
27
 
@@ -89,6 +96,7 @@ const CustomExportButton = React.forwardRef<
89
96
 
90
97
  return (
91
98
  <ButtonDropdown
99
+ ariaLabel="Export Chart Menu"
92
100
  menu={{
93
101
  isFluid: true,
94
102
  menuDisabled: false,
@@ -111,9 +119,11 @@ export type ChartWrapperClassNames = $ReadOnly<{
111
119
  title?: string,
112
120
  actions?: string,
113
121
  content?: string,
122
+ loader?: string,
114
123
  }>;
115
124
 
116
125
  type ChartWrapperProps = {
126
+ isLoading?: boolean,
117
127
  title: React.Node,
118
128
  children?: React.Node,
119
129
  classNames?: ChartWrapperClassNames,
@@ -127,6 +137,7 @@ export const ChartWrapper: React$AbstractComponent<
127
137
  > = React.forwardRef<ChartWrapperProps, HTMLDivElement>(
128
138
  (
129
139
  {
140
+ isLoading,
130
141
  title,
131
142
  children,
132
143
  classNames,
@@ -136,21 +147,32 @@ export const ChartWrapper: React$AbstractComponent<
136
147
  ref,
137
148
  ): React.Node => (
138
149
  <Card classNames={{wrapper: classify(css.wrapper, classNames?.wrapper)}}>
139
- <CardHeader className={classNames?.header}>
140
- <CardTitle className={classNames?.title}>{title}</CardTitle>
141
- <CardActions
142
- className={classify(css.chartCardActions, classNames?.actions)}
143
- >
144
- <CustomExportButton
145
- ref={ref}
146
- customExportOptions={customExportOptions}
147
- />
148
- {headerActions ? headerActions : null}
149
- </CardActions>
150
- </CardHeader>
151
- <CardContent className={classify(css.chartContent, classNames?.content)}>
152
- {children}
153
- </CardContent>
150
+ {isLoading ? (
151
+ <CircularLoader
152
+ size="large"
153
+ className={classify(css.loader, classNames?.loader)}
154
+ />
155
+ ) : (
156
+ <>
157
+ <CardHeader className={classNames?.header}>
158
+ <CardTitle className={classNames?.title}>{title}</CardTitle>
159
+ <CardActions
160
+ className={classify(css.chartCardActions, classNames?.actions)}
161
+ >
162
+ <CustomExportButton
163
+ ref={ref}
164
+ customExportOptions={customExportOptions}
165
+ />
166
+ {headerActions ? headerActions : null}
167
+ </CardActions>
168
+ </CardHeader>
169
+ <CardContent
170
+ className={classify(css.chartContent, classNames?.content)}
171
+ >
172
+ {children}
173
+ </CardContent>
174
+ </>
175
+ )}
154
176
  </Card>
155
177
  ),
156
178
  );
@@ -0,0 +1,26 @@
1
+ @value (spaceXSmall) from '../../../styles/variables/_space.css';
2
+ @value (size4,size5,size50,size400,size960) from '../../../styles/variables/_size.css';
3
+
4
+ .wrapper {
5
+ display: flex;
6
+ max-width: size960;
7
+ }
8
+
9
+ .chartCardActions {
10
+ display: flex;
11
+ justify-content: space-between;
12
+ align-items: center;
13
+ gap: spaceXSmall;
14
+ }
15
+
16
+ .chartContent {
17
+ overflow-x: auto;
18
+ display: flex;
19
+ }
20
+
21
+ .loader {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: center;
25
+ height: calc(size4 + size5 + size50 + size400);
26
+ }
@@ -7,8 +7,8 @@ exports.ColumnChart = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _highcharts = _interopRequireDefault(require("highcharts"));
9
9
  var _highchartsReactOfficial = _interopRequireDefault(require("highcharts-react-official"));
10
- var _charts = require("../../utils/charts");
11
- var _classify = _interopRequireDefault(require("../../utils/classify"));
10
+ var _charts = require("../../../utils/charts");
11
+ var _classify = _interopRequireDefault(require("../../../utils/classify"));
12
12
  var _ChartWrapper = require("../ChartWrapper");
13
13
  var _ColumnChartModule = _interopRequireDefault(require("./ColumnChart.module.css"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -21,6 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
21
 
22
22
  const ColumnChart = _ref => {
23
23
  let {
24
+ isLoading,
24
25
  classNames,
25
26
  cardTitle,
26
27
  customExportOptions,
@@ -65,6 +66,7 @@ const ColumnChart = _ref => {
65
66
  ...wrapperClassNames
66
67
  } = classNames || {};
67
68
  return /*#__PURE__*/React.createElement(_ChartWrapper.ChartWrapper, {
69
+ isLoading: isLoading,
68
70
  title: cardTitle,
69
71
  ref: chartRef,
70
72
  classNames: wrapperClassNames,
@@ -6,41 +6,51 @@ import Highcharts from 'highcharts';
6
6
  //$FlowFixMe[untyped-import]
7
7
  import HighchartsReact from 'highcharts-react-official';
8
8
 
9
- import type {Drilldown} from '../../types/charts';
9
+ import type {
10
+ ChartOptions,
11
+ DataOptionsType,
12
+ Drilldown,
13
+ } from '../../../types/charts';
10
14
  import {
11
15
  columnPlotWidth,
12
16
  getColumnChartOptions,
13
17
  getDataVizColor,
14
18
  mergeChartUserOptions,
15
- } from '../../utils/charts';
16
- import classify from '../../utils/classify';
17
- import type {ChartWrapperClassNames, ExportOptionType} from '../ChartWrapper';
18
- import {ChartWrapper} from '../ChartWrapper';
19
+ } from '../../../utils/charts';
20
+ import classify from '../../../utils/classify';
21
+ import {
22
+ type ChartWrapperClassNames,
23
+ type ExportOptionType,
24
+ ChartWrapper,
25
+ } from '../ChartWrapper';
19
26
 
20
27
  import css from './ColumnChart.module.css';
21
28
 
22
29
 
23
- type ClassNames = $ReadOnly<{
30
+ export type ClassNames = $ReadOnly<{
24
31
  ...ChartWrapperClassNames,
25
32
  highChart?: string,
26
33
  }>;
27
34
 
28
- type ColumnSeriesItem = {
35
+ export type ColumnSeries = {
29
36
  name: string,
30
- data: [],
37
+ data: DataOptionsType[],
31
38
  };
32
39
 
33
40
  export type ColumnChartProps = {
41
+ ...ChartOptions,
42
+ isLoading?: boolean,
34
43
  classNames?: ClassNames,
35
- cardTitle?: string,
44
+ cardTitle?: React.Node,
36
45
  customExportOptions?: Array<ExportOptionType> | null,
37
- series: Array<ColumnSeriesItem>,
38
- drilldown: Drilldown,
46
+ series: Array<ColumnSeries>,
47
+ drilldown?: Drilldown,
39
48
  headerActions?: React.Node,
40
49
  ...
41
50
  };
42
51
 
43
52
  export const ColumnChart = ({
53
+ isLoading,
44
54
  classNames,
45
55
  cardTitle,
46
56
  customExportOptions,
@@ -90,6 +100,7 @@ export const ColumnChart = ({
90
100
 
91
101
  return (
92
102
  <ChartWrapper
103
+ isLoading={isLoading}
93
104
  title={cardTitle}
94
105
  ref={chartRef}
95
106
  classNames={wrapperClassNames}
@@ -1,5 +1,5 @@
1
- @value (colorFillPrimary) from '../../styles/variables/_color.css';
2
- @value (size400, size660, sizeFluid) from '../../styles/variables/_size.css';
1
+ @value (colorFillPrimary) from '../../../styles/variables/_color.css';
2
+ @value (size400, size660, sizeFluid) from '../../../styles/variables/_size.css';
3
3
 
4
4
  .columnChartContainer {
5
5
  width: sizeFluid;
@@ -7,10 +7,10 @@ exports.DonutChart = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _highcharts = _interopRequireDefault(require("highcharts"));
9
9
  var _highchartsReactOfficial = _interopRequireDefault(require("highcharts-react-official"));
10
- var _charts = require("../../utils/charts");
11
- var _classify = _interopRequireDefault(require("../../utils/classify"));
10
+ var _charts = require("../../../utils/charts");
11
+ var _classify = _interopRequireDefault(require("../../../utils/classify"));
12
12
  var _ChartWrapper = require("../ChartWrapper");
13
- var _typographyModule = _interopRequireDefault(require("../../styles/typography.module.css"));
13
+ var _typographyModule = _interopRequireDefault(require("../../../styles/typography.module.css"));
14
14
  var _DonutChartModule = _interopRequireDefault(require("./DonutChart.module.css"));
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -22,6 +22,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
22
22
 
23
23
  const DonutChart = _ref => {
24
24
  let {
25
+ isLoading,
25
26
  classNames,
26
27
  cardTitle,
27
28
  customExportOptions,
@@ -72,15 +73,16 @@ const DonutChart = _ref => {
72
73
  legend,
73
74
  defaultCenterHTML
74
75
  });
76
+
77
+ //$FlowFixMe[cannot-spread-inexact]
75
78
  const chartOptions = (0, _charts.mergeChartUserOptions)(defaultLineChartOptions, {
76
79
  series: donutChartSeries,
77
80
  drilldown: donutDrilldown,
78
81
  ...userOptions
79
82
  });
80
83
  return /*#__PURE__*/React.createElement(_ChartWrapper.ChartWrapper, {
81
- title: cardTitle
82
- //$FlowFixMe[incompatible-type]
83
- ,
84
+ isLoading: isLoading,
85
+ title: cardTitle,
84
86
  ref: chartRef,
85
87
  customExportOptions: customExportOptions,
86
88
  headerActions: headerActions,
@@ -7,32 +7,32 @@ import Highcharts from 'highcharts';
7
7
  import HighchartsReact from 'highcharts-react-official';
8
8
 
9
9
  import type {
10
+ ChartOptions,
10
11
  Drilldown,
11
12
  LegendOptionsType,
12
13
  SeriesOptionsType,
13
- } from '../../types/charts';
14
+ } from '../../../types/charts';
14
15
  import {
15
16
  getDataVizColor,
16
17
  getDonutChartOptions,
17
18
  mergeChartUserOptions,
18
- } from '../../utils/charts';
19
- import classify from '../../utils/classify';
20
- import type {ChartWrapperClassNames, ExportOptionType} from '../ChartWrapper';
21
- import {ChartWrapper} from '../ChartWrapper';
19
+ } from '../../../utils/charts';
20
+ import classify from '../../../utils/classify';
21
+ import {
22
+ type ChartWrapperClassNames,
23
+ type ExportOptionType,
24
+ ChartWrapper,
25
+ } from '../ChartWrapper';
22
26
 
23
- import typographyCss from '../../styles/typography.module.css';
27
+ import typographyCss from '../../../styles/typography.module.css';
24
28
  import css from './DonutChart.module.css';
25
29
 
26
30
 
27
- type ClassNames = $ReadOnly<{
31
+ export type ClassNames = $ReadOnly<{
28
32
  ...ChartWrapperClassNames,
29
33
  highChart?: string,
30
34
  subtitleClassNames?: SubtitleClassNames,
31
35
  }>;
32
- type DonutChartData = {
33
- name: string,
34
- value: number,
35
- };
36
36
 
37
37
  export type SubtitleClassNames = {
38
38
  wrapper?: string,
@@ -41,6 +41,8 @@ export type SubtitleClassNames = {
41
41
  };
42
42
 
43
43
  export type DonutChartProps = {
44
+ ...ChartOptions,
45
+ isLoading?: boolean,
44
46
  classNames?: ClassNames,
45
47
  cardTitle?: React.Node,
46
48
  customExportOptions?: Array<ExportOptionType> | null,
@@ -48,11 +50,13 @@ export type DonutChartProps = {
48
50
  centerText?: string,
49
51
  centerSubtext?: string,
50
52
  series: Array<SeriesOptionsType>,
51
- drilldown: Drilldown,
53
+ drilldown?: Drilldown,
52
54
  legend?: LegendOptionsType,
55
+ ...
53
56
  };
54
57
 
55
58
  export const DonutChart = ({
59
+ isLoading,
56
60
  classNames,
57
61
  cardTitle,
58
62
  customExportOptions,
@@ -119,6 +123,7 @@ export const DonutChart = ({
119
123
  defaultCenterHTML,
120
124
  });
121
125
 
126
+ //$FlowFixMe[cannot-spread-inexact]
122
127
  const chartOptions = mergeChartUserOptions(defaultLineChartOptions, {
123
128
  series: donutChartSeries,
124
129
  drilldown: donutDrilldown,
@@ -127,8 +132,8 @@ export const DonutChart = ({
127
132
 
128
133
  return (
129
134
  <ChartWrapper
135
+ isLoading={isLoading}
130
136
  title={cardTitle}
131
- //$FlowFixMe[incompatible-type]
132
137
  ref={chartRef}
133
138
  customExportOptions={customExportOptions}
134
139
  headerActions={headerActions}
@@ -7,12 +7,12 @@
7
7
  fontLineHeight130,
8
8
  fontLetterSpacingMinus3,
9
9
  fontLetterSpacing4
10
- ) from '../../styles/variables/_font.css';
10
+ ) from '../../../styles/variables/_font.css';
11
11
 
12
- @value (colorTextPrimary, colorTextSecondary) from '../../styles/variables/_color.css';
13
- @value (size240, size300, size400, size500, sizeFluid) from '../../styles/variables/_size.css';
12
+ @value (colorTextPrimary, colorTextSecondary) from '../../../styles/variables/_color.css';
13
+ @value (size240, size300, size400, size500, sizeFluid) from '../../../styles/variables/_size.css';
14
14
 
15
- @value (spaceNone, spaceXSmall) from '../../styles/variables/_space.css';
15
+ @value (spaceNone, spaceXSmall) from '../../../styles/variables/_space.css';
16
16
 
17
17
  .wrapper {
18
18
  display: flex;
@@ -7,8 +7,8 @@ exports.LineChart = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  var _highcharts = _interopRequireDefault(require("highcharts"));
9
9
  var _highchartsReactOfficial = _interopRequireDefault(require("highcharts-react-official"));
10
- var _charts = require("../../utils/charts");
11
- var _classify = _interopRequireDefault(require("../../utils/classify"));
10
+ var _charts = require("../../../utils/charts");
11
+ var _classify = _interopRequireDefault(require("../../../utils/classify"));
12
12
  var _ChartWrapper = require("../ChartWrapper");
13
13
  var _LineChartModule = _interopRequireDefault(require("./LineChart.module.css"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -21,6 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
21
 
22
22
  const LineChart = _ref => {
23
23
  let {
24
+ isLoading,
24
25
  classNames,
25
26
  cardTitle,
26
27
  customExportOptions,
@@ -55,6 +56,7 @@ const LineChart = _ref => {
55
56
  ...wrapperClassNames
56
57
  } = classNames || {};
57
58
  return /*#__PURE__*/React.createElement(_ChartWrapper.ChartWrapper, {
59
+ isLoading: isLoading,
58
60
  title: cardTitle,
59
61
  ref: chartRef,
60
62
  classNames: wrapperClassNames,
@@ -6,40 +6,50 @@ import Highcharts from 'highcharts';
6
6
  //$FlowFixMe[untyped-import]
7
7
  import HighchartsReact from 'highcharts-react-official';
8
8
 
9
- import type {Drilldown} from '../../types/charts';
9
+ import type {
10
+ ChartOptions,
11
+ DataOptionsType,
12
+ Drilldown,
13
+ } from '../../../types/charts';
10
14
  import {
11
15
  getDataVizColor,
12
16
  getLineChartOptions,
13
17
  mergeChartUserOptions,
14
- } from '../../utils/charts';
15
- import classify from '../../utils/classify';
16
- import type {ChartWrapperClassNames, ExportOptionType} from '../ChartWrapper';
17
- import {ChartWrapper} from '../ChartWrapper';
18
+ } from '../../../utils/charts';
19
+ import classify from '../../../utils/classify';
20
+ import {
21
+ type ChartWrapperClassNames,
22
+ type ExportOptionType,
23
+ ChartWrapper,
24
+ } from '../ChartWrapper';
18
25
 
19
26
  import css from './LineChart.module.css';
20
27
 
21
28
 
22
- type ClassNames = $ReadOnly<{
29
+ export type ClassNames = $ReadOnly<{
23
30
  ...ChartWrapperClassNames,
24
31
  highChart?: string,
25
32
  }>;
26
33
 
27
- type LineSeriesItem = {
34
+ export type LineSeriesItem = {
28
35
  name: string,
29
- data: [],
36
+ data: DataOptionsType[],
30
37
  };
31
38
 
32
39
  export type LineChartProps = {
40
+ ...ChartOptions,
41
+ isLoading?: boolean,
33
42
  classNames?: ClassNames,
34
- cardTitle?: string,
43
+ cardTitle?: React.Node,
35
44
  customExportOptions?: Array<ExportOptionType> | null,
36
45
  series: Array<LineSeriesItem>,
37
46
  headerActions?: React.Node,
38
- drilldown: Drilldown,
47
+ drilldown?: Drilldown,
39
48
  ...
40
49
  };
41
50
 
42
51
  export const LineChart = ({
52
+ isLoading,
43
53
  classNames,
44
54
  cardTitle,
45
55
  customExportOptions,
@@ -77,6 +87,7 @@ export const LineChart = ({
77
87
 
78
88
  return (
79
89
  <ChartWrapper
90
+ isLoading={isLoading}
80
91
  title={cardTitle}
81
92
  ref={chartRef}
82
93
  classNames={wrapperClassNames}
@@ -1,5 +1,5 @@
1
- @value (colorFillPrimary) from '../../styles/variables/_color.css';
2
- @value (size400, size660, sizeFluid) from '../../styles/variables/_size.css';
1
+ @value (colorFillPrimary) from '../../../styles/variables/_color.css';
2
+ @value (size400, size660, sizeFluid) from '../../../styles/variables/_size.css';
3
3
 
4
4
  .wrapper {
5
5
  display: flex;
@@ -8,8 +8,8 @@ var React = _interopRequireWildcard(require("react"));
8
8
  var _highcharts = _interopRequireDefault(require("highcharts"));
9
9
  var _highchartsMore = _interopRequireDefault(require("highcharts/highcharts-more"));
10
10
  var _highchartsReactOfficial = _interopRequireDefault(require("highcharts-react-official"));
11
- var _charts = require("../../utils/charts");
12
- var _classify = _interopRequireDefault(require("../../utils/classify"));
11
+ var _charts = require("../../../utils/charts");
12
+ var _classify = _interopRequireDefault(require("../../../utils/classify"));
13
13
  var _ChartWrapper = require("../ChartWrapper");
14
14
  var _SpiderChartModule = _interopRequireDefault(require("./SpiderChart.module.css"));
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -27,6 +27,7 @@ if (!!_highchartsMore.default && !!_highcharts.default && typeof _highchartsMore
27
27
  }
28
28
  const SpiderChart = _ref => {
29
29
  let {
30
+ isLoading,
30
31
  classNames,
31
32
  cardTitle,
32
33
  customExportOptions,
@@ -54,6 +55,7 @@ const SpiderChart = _ref => {
54
55
  ...wrapperClassNames
55
56
  } = classNames || {};
56
57
  return /*#__PURE__*/React.createElement(_ChartWrapper.ChartWrapper, {
58
+ isLoading: isLoading,
57
59
  title: cardTitle,
58
60
  ref: chartRef,
59
61
  customExportOptions: customExportOptions,
@@ -8,14 +8,18 @@ import highChartsMore from 'highcharts/highcharts-more';
8
8
  //$FlowFixMe[untyped-import]
9
9
  import HighchartsReact from 'highcharts-react-official';
10
10
 
11
+ import type {ChartOptions, DataOptionsType} from '../../../types/charts';
11
12
  import {
12
13
  getDataVizColor,
13
14
  getSpiderChartOptions,
14
15
  mergeChartUserOptions,
15
- } from '../../utils/charts';
16
- import classify from '../../utils/classify';
17
- import type {ChartWrapperClassNames, ExportOptionType} from '../ChartWrapper';
18
- import {ChartWrapper} from '../ChartWrapper';
16
+ } from '../../../utils/charts';
17
+ import classify from '../../../utils/classify';
18
+ import {
19
+ type ChartWrapperClassNames,
20
+ type ExportOptionType,
21
+ ChartWrapper,
22
+ } from '../ChartWrapper';
19
23
 
20
24
  import css from './SpiderChart.module.css';
21
25
 
@@ -29,39 +33,29 @@ if (
29
33
  highChartsMore(Highcharts);
30
34
  }
31
35
 
32
- type ClassNames = $ReadOnly<{
36
+ export type ClassNames = $ReadOnly<{
33
37
  ...ChartWrapperClassNames,
34
38
  highChart?: string,
35
39
  }>;
36
40
 
37
- type SpiderSeriesItem = {
41
+ export type SpiderSeriesItem = {
38
42
  name: string,
39
- data: [],
43
+ data: DataOptionsType[],
40
44
  };
41
45
 
42
46
  export type SpiderChartProps = {
47
+ ...ChartOptions,
48
+ isLoading?: boolean,
43
49
  classNames?: ClassNames,
44
50
  cardTitle?: React.Node,
45
51
  customExportOptions?: Array<ExportOptionType> | null,
46
52
  headerActions?: React.Node,
47
53
  series: Array<SpiderSeriesItem>,
48
- legend: {...},
49
- xAxis: {
50
- categories: Array<string>,
51
- tickmarkPlacement: string,
52
- lineWidth: number,
53
- ...
54
- },
55
- yAxis: {
56
- gridLineInterpolation: 'circle' | 'polygon',
57
- lineWidth: 0,
58
- min: 0,
59
- ...
60
- },
61
54
  ...
62
55
  };
63
56
 
64
57
  export const SpiderChart = ({
58
+ isLoading,
65
59
  classNames,
66
60
  cardTitle,
67
61
  customExportOptions,
@@ -91,6 +85,7 @@ export const SpiderChart = ({
91
85
 
92
86
  return (
93
87
  <ChartWrapper
88
+ isLoading={isLoading}
94
89
  title={cardTitle}
95
90
  ref={chartRef}
96
91
  customExportOptions={customExportOptions}
@@ -1,5 +1,5 @@
1
- @value (colorFillPrimary) from '../../styles/variables/_color.css';
2
- @value (size400, size540, size660, size880, sizeFluid) from '../../styles/variables/_size.css';
1
+ @value (colorFillPrimary) from '../../../styles/variables/_color.css';
2
+ @value (size400, size540, size660, size880, sizeFluid) from '../../../styles/variables/_size.css';
3
3
 
4
4
  .wrapper {
5
5
  display: flex;
@@ -3,7 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _ChartWrapper = require("../ChartWrapper");
6
+ var _ChartTooltip = require("./ChartTooltip");
7
+ Object.keys(_ChartTooltip).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ChartTooltip[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ChartTooltip[key];
14
+ }
15
+ });
16
+ });
17
+ var _ChartWrapper = require("./ChartWrapper");
7
18
  Object.keys(_ChartWrapper).forEach(function (key) {
8
19
  if (key === "default" || key === "__esModule") return;
9
20
  if (key in exports && exports[key] === _ChartWrapper[key]) return;
@@ -14,7 +25,7 @@ Object.keys(_ChartWrapper).forEach(function (key) {
14
25
  }
15
26
  });
16
27
  });
17
- var _ColumnChart = require("../ColumnChart");
28
+ var _ColumnChart = require("./ColumnChart");
18
29
  Object.keys(_ColumnChart).forEach(function (key) {
19
30
  if (key === "default" || key === "__esModule") return;
20
31
  if (key in exports && exports[key] === _ColumnChart[key]) return;
@@ -25,7 +36,7 @@ Object.keys(_ColumnChart).forEach(function (key) {
25
36
  }
26
37
  });
27
38
  });
28
- var _DonutChart = require("../DonutChart");
39
+ var _DonutChart = require("./DonutChart");
29
40
  Object.keys(_DonutChart).forEach(function (key) {
30
41
  if (key === "default" || key === "__esModule") return;
31
42
  if (key in exports && exports[key] === _DonutChart[key]) return;
@@ -36,7 +47,7 @@ Object.keys(_DonutChart).forEach(function (key) {
36
47
  }
37
48
  });
38
49
  });
39
- var _LineChart = require("../LineChart");
50
+ var _LineChart = require("./LineChart");
40
51
  Object.keys(_LineChart).forEach(function (key) {
41
52
  if (key === "default" || key === "__esModule") return;
42
53
  if (key in exports && exports[key] === _LineChart[key]) return;
@@ -47,7 +58,7 @@ Object.keys(_LineChart).forEach(function (key) {
47
58
  }
48
59
  });
49
60
  });
50
- var _SpiderChart = require("../SpiderChart");
61
+ var _SpiderChart = require("./SpiderChart");
51
62
  Object.keys(_SpiderChart).forEach(function (key) {
52
63
  if (key === "default" || key === "__esModule") return;
53
64
  if (key in exports && exports[key] === _SpiderChart[key]) return;
@@ -57,15 +68,4 @@ Object.keys(_SpiderChart).forEach(function (key) {
57
68
  return _SpiderChart[key];
58
69
  }
59
70
  });
60
- });
61
- var _ChartTooltip = require("./ChartTooltip");
62
- Object.keys(_ChartTooltip).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _ChartTooltip[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _ChartTooltip[key];
69
- }
70
- });
71
71
  });
@@ -1,8 +1,8 @@
1
1
  // @flow strict
2
2
 
3
- export * from '../ChartWrapper';
4
- export * from '../ColumnChart';
5
- export * from '../DonutChart';
6
- export * from '../LineChart';
7
- export * from '../SpiderChart';
8
3
  export * from './ChartTooltip';
4
+ export * from './ChartWrapper';
5
+ export * from './ColumnChart';
6
+ export * from './DonutChart';
7
+ export * from './LineChart';
8
+ export * from './SpiderChart';
@@ -1,13 +1,13 @@
1
1
  @value (colorFillPrimary, colorBackgroundTertiary) from '../../styles/variables/_color.css';
2
2
  @value (sizeFluid) from '../../styles/variables/_size.css';
3
- @value (spaceLarge, spaceMedium, spaceXSmall, spaceSmall) from '../../styles/variables/_space.css';
3
+ @value (spaceMedium, spaceXSmall, spaceSmall) from '../../styles/variables/_space.css';
4
4
 
5
5
  .wrapper {
6
6
  display: flex;
7
7
  width: sizeFluid;
8
8
  align-items: center;
9
9
  justify-content: space-between;
10
- padding: spaceMedium spaceLarge;
10
+ padding: spaceMedium spaceMedium;
11
11
  gap: spaceXSmall;
12
12
  background: colorBackgroundTertiary;
13
13
  }
@@ -25,12 +25,13 @@ export type ChartOptions = {
25
25
  tooltip?: Tooltip,
26
26
  xAxis?: AxisOptions,
27
27
  yAxis?: AxisOptions,
28
+ zAxis?: AxisOptions,
28
29
  drilldown?: Drilldown,
29
30
  legend?: LegendOptionsType,
30
31
  plotOptions?: PlotOptionsType,
31
32
  series?: Array<SeriesOptionsType>,
32
33
  subtitle?: {
33
- useHTML: true,
34
+ useHTML: boolean,
34
35
  text?: string,
35
36
  verticalAlign: 'middle',
36
37
  align: string,
@@ -41,6 +42,8 @@ export type ChartOptions = {
41
42
  center: [string, string],
42
43
  size: string,
43
44
  },
45
+ credits?: Credits,
46
+ legend?: Legend,
44
47
  ...
45
48
  };
46
49
 
@@ -103,7 +106,13 @@ export type CSSObject = {
103
106
  ...
104
107
  };
105
108
 
106
- export type DataOptionsType = {y: number, name: string, color: string, ...};
109
+ export type DataOptionsType = {
110
+ y: number,
111
+ name: string,
112
+ color: string,
113
+ drilldown?: string,
114
+ ...
115
+ };
107
116
 
108
117
  export type SeriesOptionsType = {
109
118
  id?: string,
@@ -150,3 +159,39 @@ export type Tooltip = {
150
159
  shared?: boolean,
151
160
  ...
152
161
  };
162
+
163
+ export type Legend = {
164
+ align?: 'left' | 'center' | 'right',
165
+ alignColumns?: boolean,
166
+ backgroundColor?: string,
167
+ borderColor?: string,
168
+ borderRadius?: number,
169
+ borderWidth?: number,
170
+ className?: string,
171
+ enabled?: boolean,
172
+ floating?: boolean,
173
+ itemDistance?: number,
174
+ itemMarginBottom?: number,
175
+ itemMarginBottom?: number,
176
+ itemMarginBottom?: number,
177
+ labelFormat?: string,
178
+ layout?: 'horizontal' | 'vertical' | 'proximate',
179
+ margin?: number,
180
+ maxHeight?: number,
181
+ padding?: number,
182
+ reversed?: boolean,
183
+ x?: number,
184
+ y?: number,
185
+ ...
186
+ };
187
+
188
+ export type Credits = {
189
+ enabled?: boolean,
190
+ href?: string,
191
+ position?: {
192
+ align?: 'right' | 'left',
193
+ verticalAlign?: 'bottom' | 'top',
194
+ x?: number,
195
+ y?: number,
196
+ },
197
+ };
@@ -3,6 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _charts = require("./charts");
7
+ Object.keys(_charts).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _charts[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _charts[key];
14
+ }
15
+ });
16
+ });
6
17
  var _common = require("./common");
7
18
  Object.keys(_common).forEach(function (key) {
8
19
  if (key === "default" || key === "__esModule") return;
@@ -1,5 +1,6 @@
1
1
  // @flow strict
2
2
 
3
+ export * from './charts';
3
4
  export * from './common';
4
5
  export * from './toast';
5
6
  export * from './typography';
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.mergeChartUserOptions = exports.getDataVizColor = exports.commonChartOptions = exports.breadcrumbStyle = exports.DATA_VIZ_COLORS = void 0;
7
- var _Charts = require("../../components/Charts");
8
7
  var _color = require("../../styles/variables/_color");
9
8
  var _helpers = require("./helpers");
10
9
  var _typography = require("./typography");
10
+ var _ChartTooltipModule = _interopRequireDefault(require("../../components/Charts/ChartTooltip/ChartTooltip.module.css"));
11
+ var _typographyModule = _interopRequireDefault(require("../../styles/typography.module.css"));
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
13
 
12
14
  const DATA_VIZ_COLORS = [_color.colorDataViz1, _color.colorDataViz2, _color.colorDataViz3, _color.colorDataViz4, _color.colorDataViz5, _color.colorDataViz6, _color.colorDataViz7, _color.colorDataViz8];
13
15
  exports.DATA_VIZ_COLORS = DATA_VIZ_COLORS;
@@ -45,7 +47,11 @@ const commonChartOptions = {
45
47
  backgroundColor: _color.colorTooltipFill,
46
48
  useHTML: true,
47
49
  outside: true,
48
- ..._Charts.tooltipTheme
50
+ headerFormat: `<span class="${_typographyModule.default.bodySmall} ${_ChartTooltipModule.default.tooltipHeader}">{point.key}</span>`,
51
+ pointFormat: `<span class=${_ChartTooltipModule.default.tooltipPoint}>
52
+ <span style="background-color:{point.color};" class=${_ChartTooltipModule.default.indicatorCircle}></span>
53
+ <span class="${_ChartTooltipModule.default.tooltipContent} ${_typographyModule.default.bodyMedium}"> {series.name}: {point.y}</span>
54
+ </span>`
49
55
  },
50
56
  drilldown: {
51
57
  breadcrumbs: {
@@ -57,7 +63,6 @@ const commonChartOptions = {
57
63
  }
58
64
  },
59
65
  legend: {
60
- useHTML: true,
61
66
  itemStyle: {
62
67
  ..._typography.formLabelSmall,
63
68
  paddingTop: '1px'
@@ -1,6 +1,5 @@
1
1
  // @flow strict
2
2
 
3
- import {tooltipTheme} from '../../components/Charts';
4
3
  import {
5
4
  colorDataViz1,
6
5
  colorDataViz2,
@@ -18,6 +17,9 @@ import type {ChartOptions} from '../../types/charts';
18
17
  import {deepMerge} from './helpers';
19
18
  import {formLabelSmall, subTitleExtraSmall} from './typography';
20
19
 
20
+ import css from '../../components/Charts/ChartTooltip/ChartTooltip.module.css';
21
+ import typographyCss from '../../styles/typography.module.css';
22
+
21
23
 
22
24
  export const DATA_VIZ_COLORS = [
23
25
  colorDataViz1,
@@ -64,7 +66,11 @@ export const commonChartOptions: $Shape<ChartOptions> = {
64
66
  backgroundColor: colorTooltipFill,
65
67
  useHTML: true,
66
68
  outside: true,
67
- ...tooltipTheme,
69
+ headerFormat: `<span class="${typographyCss.bodySmall} ${css.tooltipHeader}">{point.key}</span>`,
70
+ pointFormat: `<span class=${css.tooltipPoint}>
71
+ <span style="background-color:{point.color};" class=${css.indicatorCircle}></span>
72
+ <span class="${css.tooltipContent} ${typographyCss.bodyMedium}"> {series.name}: {point.y}</span>
73
+ </span>`,
68
74
  },
69
75
  drilldown: {
70
76
  breadcrumbs: {
@@ -76,7 +82,6 @@ export const commonChartOptions: $Shape<ChartOptions> = {
76
82
  },
77
83
  },
78
84
  legend: {
79
- useHTML: true,
80
85
  itemStyle: {...formLabelSmall, paddingTop: '1px'},
81
86
  symbolHeight: 8,
82
87
  enabled: true,
@@ -26,21 +26,16 @@ const rightLegendColumn = {
26
26
  // take it as 10% of width as left margin
27
27
  width: `${LEGEND_WIDTH * 90}%`
28
28
  };
29
- exports.rightLegendColumn = rightLegendColumn;
30
- const commonLegendOption = _charts.commonChartOptions.legend;
31
29
 
32
30
  /**
33
31
  * This function modifies the the common chart behavior to donut chart default behavior.
34
32
  * It will not take userPassed option into account.
35
33
  */
36
-
34
+ exports.rightLegendColumn = rightLegendColumn;
37
35
  const getDonutChartOptions = _ref => {
38
36
  let {
39
37
  legend,
40
- defaultCenterHTML,
41
- subtitleSize,
42
- centerTextX,
43
- tooltip
38
+ defaultCenterHTML
44
39
  } = _ref;
45
40
  const legendOption = (0, _helpers.deepMerge)(_charts.commonChartOptions.legend, legend);
46
41
  const isLegendEnabled = legendOption.enabled;
@@ -1,27 +1,14 @@
1
1
  // @flow strict
2
2
 
3
- import type {
4
- ChartOptions,
5
- LegendOptionsType,
6
- Tooltip,
7
- } from '../../types/charts';
3
+ import type {ChartOptions, LegendOptionsType} from '../../types/charts';
8
4
 
9
5
  import {commonChartOptions} from './charts';
10
6
  import {deepMerge} from './helpers';
11
7
 
12
8
 
13
- type DonutChartDataType = {
14
- name?: string,
15
- color?: string,
16
- y?: number,
17
- };
18
-
19
9
  type DonutChartPropsType = {
20
10
  legend?: LegendOptionsType,
21
11
  defaultCenterHTML?: string,
22
- subtitleSize?: string,
23
- centerTextX?: number,
24
- tooltip?: Tooltip,
25
12
  };
26
13
 
27
14
  /**
@@ -44,8 +31,6 @@ export const rightLegendColumn = {
44
31
  width: `${LEGEND_WIDTH * 90}%`,
45
32
  };
46
33
 
47
- const commonLegendOption = commonChartOptions.legend;
48
-
49
34
  /**
50
35
  * This function modifies the the common chart behavior to donut chart default behavior.
51
36
  * It will not take userPassed option into account.
@@ -54,11 +39,7 @@ const commonLegendOption = commonChartOptions.legend;
54
39
  export const getDonutChartOptions = ({
55
40
  legend,
56
41
  defaultCenterHTML,
57
- subtitleSize,
58
- centerTextX,
59
- tooltip,
60
- }: //$FlowFixMe[prop-missing]
61
- DonutChartPropsType): ChartOptions => {
42
+ }: DonutChartPropsType): ChartOptions => {
62
43
  const legendOption = deepMerge(commonChartOptions.legend, legend);
63
44
  const isLegendEnabled = legendOption.enabled;
64
45
  return {
@@ -14,6 +14,17 @@ Object.keys(_array).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
+ var _charts = require("./charts");
18
+ Object.keys(_charts).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _charts[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _charts[key];
25
+ }
26
+ });
27
+ });
17
28
  var _classify = require("./classify");
18
29
  Object.keys(_classify).forEach(function (key) {
19
30
  if (key === "default" || key === "__esModule") return;
@@ -1,6 +1,7 @@
1
1
  // @flow strict
2
2
 
3
3
  export * from './array';
4
+ export * from './charts';
4
5
  export * from './classify';
5
6
  export * from './click-away';
6
7
  export * from './dom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.1.94-beta.0",
3
+ "version": "0.1.94-beta.2",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {
@@ -1,19 +0,0 @@
1
- @value (spaceXSmall) from '../../styles/variables/_space.css';
2
- @value (size960) from '../../styles/variables/_size.css';
3
-
4
- .wrapper {
5
- display: flex;
6
- max-width: size960;
7
- }
8
-
9
- .chartCardActions {
10
- display: flex;
11
- justify-content: space-between;
12
- align-items: center;
13
- gap: spaceXSmall;
14
- }
15
-
16
- .chartContent {
17
- overflow-x: auto;
18
- display: flex;
19
- }