@spaced-out/ui-design-system 0.1.86 → 0.1.87

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 (73) hide show
  1. package/.cspell/custom-words.txt +5 -1
  2. package/.storybook/preview-head.html +4 -0
  3. package/CHANGELOG.md +20 -0
  4. package/design-tokens/color/app-color.json +26 -0
  5. package/design-tokens/font/base-font.json +1 -1
  6. package/design-tokens/size/base-size.json +12 -0
  7. package/lib/components/ChartWrapper/ChartWrapper.js +124 -0
  8. package/lib/components/ChartWrapper/ChartWrapper.js.flow +156 -0
  9. package/lib/components/ChartWrapper/ChartWrapper.module.css +19 -0
  10. package/lib/components/ChartWrapper/index.js +16 -0
  11. package/lib/components/ChartWrapper/index.js.flow +3 -0
  12. package/lib/components/Charts/ChartTooltip.js +18 -0
  13. package/lib/components/Charts/ChartTooltip.js.flow +15 -0
  14. package/lib/components/Charts/ChartTooltip.module.css +36 -0
  15. package/lib/components/Charts/index.js +71 -0
  16. package/lib/components/Charts/index.js.flow +8 -0
  17. package/lib/components/ColumnChart/ColumnChart.js +82 -0
  18. package/lib/components/ColumnChart/ColumnChart.js.flow +109 -0
  19. package/lib/components/ColumnChart/ColumnChart.module.css +12 -0
  20. package/lib/components/ColumnChart/index.js +16 -0
  21. package/lib/components/ColumnChart/index.js.flow +3 -0
  22. package/lib/components/DonutChart/DonutChart.js +97 -0
  23. package/lib/components/DonutChart/DonutChart.js.flow +147 -0
  24. package/lib/components/DonutChart/DonutChart.module.css +65 -0
  25. package/lib/components/DonutChart/index.js +16 -0
  26. package/lib/components/DonutChart/index.js.flow +3 -0
  27. package/lib/components/Grid/Grid.js +3 -2
  28. package/lib/components/Grid/Grid.js.flow +3 -2
  29. package/lib/components/Icon/index.js +31 -25
  30. package/lib/components/Icon/index.js.flow +3 -6
  31. package/lib/components/LineChart/LineChart.js +72 -0
  32. package/lib/components/LineChart/LineChart.js.flow +96 -0
  33. package/lib/components/LineChart/LineChart.module.css +17 -0
  34. package/lib/components/LineChart/index.js +16 -0
  35. package/lib/components/LineChart/index.js.flow +3 -0
  36. package/lib/components/SpiderChart/SpiderChart.js +88 -0
  37. package/lib/components/SpiderChart/SpiderChart.js.flow +123 -0
  38. package/lib/components/SpiderChart/SpiderChart.module.css +17 -0
  39. package/lib/components/SpiderChart/index.js +16 -0
  40. package/lib/components/SpiderChart/index.js.flow +3 -0
  41. package/lib/components/index.js +11 -0
  42. package/lib/components/index.js.flow +1 -0
  43. package/lib/styles/index.css +25 -1
  44. package/lib/styles/index.js +28 -4
  45. package/lib/styles/index.js.flow +25 -1
  46. package/lib/styles/variables/_color.css +16 -0
  47. package/lib/styles/variables/_color.js +17 -1
  48. package/lib/styles/variables/_color.js.flow +16 -0
  49. package/lib/styles/variables/_font.css +1 -1
  50. package/lib/styles/variables/_font.js +1 -1
  51. package/lib/styles/variables/_font.js.flow +1 -1
  52. package/lib/styles/variables/_size.css +8 -0
  53. package/lib/styles/variables/_size.js +9 -1
  54. package/lib/styles/variables/_size.js.flow +8 -0
  55. package/lib/types/charts.js +0 -0
  56. package/lib/types/charts.js.flow +151 -0
  57. package/lib/utils/charts/charts.js +71 -0
  58. package/lib/utils/charts/charts.js.flow +89 -0
  59. package/lib/utils/charts/columnChart.js +55 -0
  60. package/lib/utils/charts/columnChart.js.flow +59 -0
  61. package/lib/utils/charts/donutChart.js +114 -0
  62. package/lib/utils/charts/donutChart.js.flow +138 -0
  63. package/lib/utils/charts/helpers.js +65 -0
  64. package/lib/utils/charts/helpers.js.flow +68 -0
  65. package/lib/utils/charts/index.js +82 -0
  66. package/lib/utils/charts/index.js.flow +9 -0
  67. package/lib/utils/charts/lineChart.js +47 -0
  68. package/lib/utils/charts/lineChart.js.flow +49 -0
  69. package/lib/utils/charts/spiderChart.js +59 -0
  70. package/lib/utils/charts/spiderChart.js.flow +72 -0
  71. package/lib/utils/charts/typography.js +59 -0
  72. package/lib/utils/charts/typography.js.flow +67 -0
  73. package/package.json +4 -1
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ColumnChart = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _highcharts = _interopRequireDefault(require("highcharts"));
9
+ var _highchartsReactOfficial = _interopRequireDefault(require("highcharts-react-official"));
10
+ var _charts = require("../../utils/charts");
11
+ var _classify = _interopRequireDefault(require("../../utils/classify"));
12
+ var _ChartWrapper = require("../ChartWrapper");
13
+ var _ColumnChartModule = _interopRequireDefault(require("./ColumnChart.module.css"));
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ 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); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+
18
+ //$FlowFixMe[untyped-import]
19
+
20
+ //$FlowFixMe[untyped-import]
21
+
22
+ const ColumnChart = _ref => {
23
+ let {
24
+ classNames,
25
+ cardTitle,
26
+ customExportOptions,
27
+ series,
28
+ drilldown,
29
+ headerActions,
30
+ ...userOptions
31
+ } = _ref;
32
+ const chartRef = /*#__PURE__*/React.createRef();
33
+ const columnChartSeries = series.map((seriesItem, index) => ({
34
+ ...seriesItem,
35
+ name: seriesItem.name,
36
+ data: seriesItem.data,
37
+ color: (0, _charts.getDataVizColor)(index),
38
+ pointWidth: _charts.columnPlotWidth
39
+ }));
40
+ const addColorToDrilldownSeries = series => series?.map(seriesItem => ({
41
+ ...seriesItem,
42
+ data: seriesItem.data.map((dataItem, index) => ({
43
+ ...dataItem,
44
+ color: (0, _charts.getDataVizColor)(index),
45
+ pointWidth: _charts.columnPlotWidth
46
+ }))
47
+ }));
48
+ const columnDrilldown = drilldown ? {
49
+ ...drilldown,
50
+ series: addColorToDrilldownSeries(drilldown.series),
51
+ breadcrumbs: {
52
+ floating: false
53
+ }
54
+ } : {};
55
+ const defaultColumnChartOptions = (0, _charts.getColumnChartOptions)();
56
+
57
+ //$FlowFixMe[cannot-spread-inexact]
58
+ const chartOptions = (0, _charts.mergeChartUserOptions)(defaultColumnChartOptions, {
59
+ series: columnChartSeries,
60
+ drilldown: columnDrilldown,
61
+ ...userOptions
62
+ });
63
+ const {
64
+ highChart,
65
+ ...wrapperClassNames
66
+ } = classNames || {};
67
+ return /*#__PURE__*/React.createElement(_ChartWrapper.ChartWrapper, {
68
+ title: cardTitle,
69
+ ref: chartRef,
70
+ classNames: wrapperClassNames,
71
+ customExportOptions: customExportOptions,
72
+ headerActions: headerActions
73
+ }, /*#__PURE__*/React.createElement(_highchartsReactOfficial.default, {
74
+ highcharts: _highcharts.default,
75
+ containerProps: {
76
+ className: (0, _classify.default)(_ColumnChartModule.default.columnChartContainer, highChart)
77
+ },
78
+ ref: chartRef,
79
+ options: chartOptions
80
+ }));
81
+ };
82
+ exports.ColumnChart = ColumnChart;
@@ -0,0 +1,109 @@
1
+ // @flow strict
2
+
3
+ import * as React from 'react';
4
+ //$FlowFixMe[untyped-import]
5
+ import Highcharts from 'highcharts';
6
+ //$FlowFixMe[untyped-import]
7
+ import HighchartsReact from 'highcharts-react-official';
8
+
9
+ import type {Drilldown} from '../../types/charts';
10
+ import {
11
+ columnPlotWidth,
12
+ getColumnChartOptions,
13
+ getDataVizColor,
14
+ mergeChartUserOptions,
15
+ } from '../../utils/charts';
16
+ import classify from '../../utils/classify';
17
+ import type {ChartWrapperClassNames, ExportOptionType} from '../ChartWrapper';
18
+ import {ChartWrapper} from '../ChartWrapper';
19
+
20
+ import css from './ColumnChart.module.css';
21
+
22
+
23
+ type ClassNames = $ReadOnly<{
24
+ ...ChartWrapperClassNames,
25
+ highChart?: string,
26
+ }>;
27
+
28
+ type ColumnSeriesItem = {
29
+ name: string,
30
+ data: [],
31
+ };
32
+
33
+ export type ColumnChartProps = {
34
+ classNames?: ClassNames,
35
+ cardTitle?: string,
36
+ customExportOptions?: Array<ExportOptionType> | null,
37
+ series: Array<ColumnSeriesItem>,
38
+ drilldown: Drilldown,
39
+ headerActions?: React.Node,
40
+ ...
41
+ };
42
+
43
+ export const ColumnChart = ({
44
+ classNames,
45
+ cardTitle,
46
+ customExportOptions,
47
+ series,
48
+ drilldown,
49
+ headerActions,
50
+ ...userOptions
51
+ }: ColumnChartProps): React.Node => {
52
+ const chartRef = React.createRef();
53
+
54
+ const columnChartSeries = series.map((seriesItem, index) => ({
55
+ ...seriesItem,
56
+ name: seriesItem.name,
57
+ data: seriesItem.data,
58
+ color: getDataVizColor(index),
59
+ pointWidth: columnPlotWidth,
60
+ }));
61
+
62
+ const addColorToDrilldownSeries = (series) =>
63
+ series?.map((seriesItem) => ({
64
+ ...seriesItem,
65
+ data: seriesItem.data.map((dataItem, index) => ({
66
+ ...dataItem,
67
+ color: getDataVizColor(index),
68
+ pointWidth: columnPlotWidth,
69
+ })),
70
+ }));
71
+
72
+ const columnDrilldown = drilldown
73
+ ? {
74
+ ...drilldown,
75
+ series: addColorToDrilldownSeries(drilldown.series),
76
+ breadcrumbs: {floating: false},
77
+ }
78
+ : {};
79
+
80
+ const defaultColumnChartOptions = getColumnChartOptions();
81
+
82
+ //$FlowFixMe[cannot-spread-inexact]
83
+ const chartOptions = mergeChartUserOptions(defaultColumnChartOptions, {
84
+ series: columnChartSeries,
85
+ drilldown: columnDrilldown,
86
+ ...userOptions,
87
+ });
88
+
89
+ const {highChart, ...wrapperClassNames} = classNames || {};
90
+
91
+ return (
92
+ <ChartWrapper
93
+ title={cardTitle}
94
+ ref={chartRef}
95
+ classNames={wrapperClassNames}
96
+ customExportOptions={customExportOptions}
97
+ headerActions={headerActions}
98
+ >
99
+ <HighchartsReact
100
+ highcharts={Highcharts}
101
+ containerProps={{
102
+ className: classify(css.columnChartContainer, highChart),
103
+ }}
104
+ ref={chartRef}
105
+ options={chartOptions}
106
+ />
107
+ </ChartWrapper>
108
+ );
109
+ };
@@ -0,0 +1,12 @@
1
+ @value (colorFillPrimary) from '../../styles/variables/_color.css';
2
+ @value (size400, size660, sizeFluid) from '../../styles/variables/_size.css';
3
+
4
+ .columnChartContainer {
5
+ width: sizeFluid;
6
+ min-width: size660;
7
+ min-height: size400;
8
+ max-height: size400;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _ColumnChart = require("./ColumnChart");
7
+ Object.keys(_ColumnChart).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ColumnChart[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ColumnChart[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './ColumnChart';
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DonutChart = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _highcharts = _interopRequireDefault(require("highcharts"));
9
+ var _highchartsReactOfficial = _interopRequireDefault(require("highcharts-react-official"));
10
+ var _charts = require("../../utils/charts");
11
+ var _classify = _interopRequireDefault(require("../../utils/classify"));
12
+ var _ChartWrapper = require("../ChartWrapper");
13
+ var _typographyModule = _interopRequireDefault(require("../../styles/typography.module.css"));
14
+ var _DonutChartModule = _interopRequireDefault(require("./DonutChart.module.css"));
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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); }
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+
19
+ //$FlowFixMe[untyped-import]
20
+
21
+ //$FlowFixMe[untyped-import]
22
+
23
+ const DonutChart = _ref => {
24
+ let {
25
+ classNames,
26
+ cardTitle,
27
+ customExportOptions,
28
+ headerActions,
29
+ series,
30
+ drilldown,
31
+ legend,
32
+ centerText,
33
+ centerSubtext,
34
+ ...userOptions
35
+ } = _ref;
36
+ const chartRef = React.useRef();
37
+ const {
38
+ highChart,
39
+ subtitleClassNames,
40
+ ...wrapperClassNames
41
+ } = classNames || {};
42
+ const defaultCenterHTML = `<span class=${(0, _classify.default)(_DonutChartModule.default.subtitleWrap, subtitleClassNames?.wrapper)}>
43
+ <span class="${(0, _classify.default)(_typographyModule.default.jumboMedium, _DonutChartModule.default.subtitleText, subtitleClassNames?.text)}">
44
+ ${centerText ? centerText : ''}
45
+ </span>
46
+ <span class="${(0, _classify.default)(_typographyModule.default.bodySmall, _DonutChartModule.default.subtitleSubtext, subtitleClassNames?.subtext)}">
47
+ ${centerSubtext ? centerSubtext : ''}
48
+ </span>
49
+ <span>`;
50
+ const donutChartSeries = series.map(seriesItem => ({
51
+ ...seriesItem,
52
+ data: seriesItem.data.map((dataItem, index) => ({
53
+ ...dataItem,
54
+ color: (0, _charts.getDataVizColor)(index)
55
+ }))
56
+ }));
57
+ const addColorToDrilldownSeries = series => series?.map(seriesItem => ({
58
+ ...seriesItem,
59
+ data: seriesItem.data.map((dataItem, index) => ({
60
+ ...dataItem,
61
+ color: (0, _charts.getDataVizColor)(index)
62
+ }))
63
+ }));
64
+ const donutDrilldown = drilldown ? {
65
+ ...drilldown,
66
+ series: addColorToDrilldownSeries(drilldown.series),
67
+ breadcrumbs: {
68
+ floating: false
69
+ }
70
+ } : {};
71
+ const defaultLineChartOptions = (0, _charts.getDonutChartOptions)({
72
+ legend,
73
+ defaultCenterHTML
74
+ });
75
+ const chartOptions = (0, _charts.mergeChartUserOptions)(defaultLineChartOptions, {
76
+ series: donutChartSeries,
77
+ drilldown: donutDrilldown,
78
+ ...userOptions
79
+ });
80
+ return /*#__PURE__*/React.createElement(_ChartWrapper.ChartWrapper, {
81
+ title: cardTitle
82
+ //$FlowFixMe[incompatible-type]
83
+ ,
84
+ ref: chartRef,
85
+ customExportOptions: customExportOptions,
86
+ headerActions: headerActions,
87
+ classNames: wrapperClassNames
88
+ }, /*#__PURE__*/React.createElement(_highchartsReactOfficial.default, {
89
+ highcharts: _highcharts.default,
90
+ containerProps: {
91
+ className: (0, _classify.default)(_DonutChartModule.default.donutChartContainer, highChart)
92
+ },
93
+ ref: chartRef,
94
+ options: chartOptions
95
+ }));
96
+ };
97
+ exports.DonutChart = DonutChart;
@@ -0,0 +1,147 @@
1
+ // @flow strict
2
+
3
+ import * as React from 'react';
4
+ //$FlowFixMe[untyped-import]
5
+ import Highcharts from 'highcharts';
6
+ //$FlowFixMe[untyped-import]
7
+ import HighchartsReact from 'highcharts-react-official';
8
+
9
+ import type {
10
+ Drilldown,
11
+ LegendOptionsType,
12
+ SeriesOptionsType,
13
+ } from '../../types/charts';
14
+ import {
15
+ getDataVizColor,
16
+ getDonutChartOptions,
17
+ mergeChartUserOptions,
18
+ } from '../../utils/charts';
19
+ import classify from '../../utils/classify';
20
+ import type {ChartWrapperClassNames, ExportOptionType} from '../ChartWrapper';
21
+ import {ChartWrapper} from '../ChartWrapper';
22
+
23
+ import typographyCss from '../../styles/typography.module.css';
24
+ import css from './DonutChart.module.css';
25
+
26
+
27
+ type ClassNames = $ReadOnly<{
28
+ ...ChartWrapperClassNames,
29
+ highChart?: string,
30
+ subtitleClassNames?: SubtitleClassNames,
31
+ }>;
32
+ type DonutChartData = {
33
+ name: string,
34
+ value: number,
35
+ };
36
+
37
+ export type SubtitleClassNames = {
38
+ wrapper?: string,
39
+ text?: string,
40
+ subtext?: string,
41
+ };
42
+
43
+ export type DonutChartProps = {
44
+ classNames?: ClassNames,
45
+ cardTitle?: React.Node,
46
+ customExportOptions?: Array<ExportOptionType> | null,
47
+ headerActions?: React.Node,
48
+ centerText?: string,
49
+ centerSubtext?: string,
50
+ series: Array<SeriesOptionsType>,
51
+ drilldown: Drilldown,
52
+ legend?: LegendOptionsType,
53
+ };
54
+
55
+ export const DonutChart = ({
56
+ classNames,
57
+ cardTitle,
58
+ customExportOptions,
59
+ headerActions,
60
+ series,
61
+ drilldown,
62
+ legend,
63
+ centerText,
64
+ centerSubtext,
65
+ ...userOptions
66
+ }: DonutChartProps): React.Node => {
67
+ const chartRef = React.useRef();
68
+
69
+ const {highChart, subtitleClassNames, ...wrapperClassNames} =
70
+ classNames || {};
71
+
72
+ const defaultCenterHTML = `<span class=${classify(
73
+ css.subtitleWrap,
74
+ subtitleClassNames?.wrapper,
75
+ )}>
76
+ <span class="${classify(
77
+ typographyCss.jumboMedium,
78
+ css.subtitleText,
79
+ subtitleClassNames?.text,
80
+ )}">
81
+ ${centerText ? centerText : ''}
82
+ </span>
83
+ <span class="${classify(
84
+ typographyCss.bodySmall,
85
+ css.subtitleSubtext,
86
+ subtitleClassNames?.subtext,
87
+ )}">
88
+ ${centerSubtext ? centerSubtext : ''}
89
+ </span>
90
+ <span>`;
91
+
92
+ const donutChartSeries = series.map((seriesItem) => ({
93
+ ...seriesItem,
94
+ data: seriesItem.data.map((dataItem, index) => ({
95
+ ...dataItem,
96
+ color: getDataVizColor(index),
97
+ })),
98
+ }));
99
+
100
+ const addColorToDrilldownSeries = (series) =>
101
+ series?.map((seriesItem) => ({
102
+ ...seriesItem,
103
+ data: seriesItem.data.map((dataItem, index) => ({
104
+ ...dataItem,
105
+ color: getDataVizColor(index),
106
+ })),
107
+ }));
108
+
109
+ const donutDrilldown = drilldown
110
+ ? {
111
+ ...drilldown,
112
+ series: addColorToDrilldownSeries(drilldown.series),
113
+ breadcrumbs: {floating: false},
114
+ }
115
+ : {};
116
+
117
+ const defaultLineChartOptions = getDonutChartOptions({
118
+ legend,
119
+ defaultCenterHTML,
120
+ });
121
+
122
+ const chartOptions = mergeChartUserOptions(defaultLineChartOptions, {
123
+ series: donutChartSeries,
124
+ drilldown: donutDrilldown,
125
+ ...userOptions,
126
+ });
127
+
128
+ return (
129
+ <ChartWrapper
130
+ title={cardTitle}
131
+ //$FlowFixMe[incompatible-type]
132
+ ref={chartRef}
133
+ customExportOptions={customExportOptions}
134
+ headerActions={headerActions}
135
+ classNames={wrapperClassNames}
136
+ >
137
+ <HighchartsReact
138
+ highcharts={Highcharts}
139
+ containerProps={{
140
+ className: classify(css.donutChartContainer, highChart),
141
+ }}
142
+ ref={chartRef}
143
+ options={chartOptions}
144
+ />
145
+ </ChartWrapper>
146
+ );
147
+ };
@@ -0,0 +1,65 @@
1
+ @value (
2
+ fontSize12,
3
+ fontSize36,
4
+ fontWeightMedium,
5
+ fontWeightBook,
6
+ fontLineHeight100,
7
+ fontLineHeight130,
8
+ fontLetterSpacingMinus3,
9
+ fontLetterSpacing4
10
+ ) from '../../styles/variables/_font.css';
11
+
12
+ @value (colorTextPrimary, colorTextSecondary) from '../../styles/variables/_color.css';
13
+ @value (size240, size300, size400, size500, sizeFluid) from '../../styles/variables/_size.css';
14
+
15
+ @value (spaceNone, spaceXSmall) from '../../styles/variables/_space.css';
16
+
17
+ .wrapper {
18
+ display: flex;
19
+ }
20
+
21
+ .donutChartContainer {
22
+ width: sizeFluid;
23
+ min-width: size500;
24
+ min-height: size300;
25
+ display: block;
26
+ align-items: center;
27
+ justify-content: center;
28
+ }
29
+
30
+ .subtitleWrap {
31
+ display: flex;
32
+ gap: spaceXSmall;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ justify-content: center;
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ width: sizeFluid;
39
+ }
40
+
41
+ .subtitleText {
42
+ margin: spaceNone;
43
+ color: colorTextPrimary;
44
+
45
+ text-align: center;
46
+
47
+ width: sizeFluid;
48
+ overflow: hidden;
49
+ white-space: nowrap;
50
+ text-overflow: ellipsis;
51
+ display: block;
52
+ }
53
+
54
+ .subtitleSubtext {
55
+ margin: spaceNone;
56
+ color: colorTextSecondary;
57
+
58
+ text-align: center;
59
+
60
+ width: sizeFluid;
61
+ overflow: hidden;
62
+ display: block;
63
+ white-space: nowrap;
64
+ text-overflow: ellipsis;
65
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _DonutChart = require("./DonutChart");
7
+ Object.keys(_DonutChart).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _DonutChart[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _DonutChart[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,3 @@
1
+ // @flow strict
2
+
3
+ export * from './DonutChart';
@@ -15,7 +15,8 @@ const GRID_SYSTEM_MAP = {
15
15
  small: 24,
16
16
  medium: 12,
17
17
  large: 6,
18
- autoFill: 'auto-fill'
18
+ autoFill: 'auto-fill',
19
+ autoFit: 'auto-fit'
19
20
  };
20
21
  const Row = _ref => {
21
22
  let {
@@ -46,7 +47,7 @@ const Row = _ref => {
46
47
  columnSpanCount = lastChildColCount + offset + span;
47
48
  let gridColumnStart = 0,
48
49
  gridColumnEnd = 0;
49
- if (gridType === 'autoFill') {
50
+ if (gridType === 'autoFill' || gridType === 'autoFit') {
50
51
  gridColumnStart = 'auto';
51
52
  return /*#__PURE__*/React.cloneElement(child, {
52
53
  gridColumnStart,
@@ -11,7 +11,7 @@ export type RowProps = {
11
11
  children?: React.Node,
12
12
  span?: number,
13
13
  offset?: number,
14
- gridType?: 'small' | 'medium' | 'large' | 'autoFill',
14
+ gridType?: 'small' | 'medium' | 'large' | 'autoFill' | 'autoFit',
15
15
  repeatTracks?: string,
16
16
  };
17
17
 
@@ -20,6 +20,7 @@ const GRID_SYSTEM_MAP = {
20
20
  medium: 12,
21
21
  large: 6,
22
22
  autoFill: 'auto-fill',
23
+ autoFit: 'auto-fit',
23
24
  };
24
25
 
25
26
  export const Row = ({
@@ -47,7 +48,7 @@ export const Row = ({
47
48
  columnSpanCount = lastChildColCount + offset + span;
48
49
  let gridColumnStart = 0,
49
50
  gridColumnEnd = 0;
50
- if (gridType === 'autoFill') {
51
+ if (gridType === 'autoFill' || gridType === 'autoFit') {
51
52
  gridColumnStart = 'auto';
52
53
  return React.cloneElement(child, {
53
54
  gridColumnStart,
@@ -3,30 +3,36 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "ClickableIcon", {
7
- enumerable: true,
8
- get: function () {
9
- return _ClickableIcon.ClickableIcon;
10
- }
11
- });
12
- Object.defineProperty(exports, "CloseIcon", {
13
- enumerable: true,
14
- get: function () {
15
- return _ClickableIcon.CloseIcon;
16
- }
17
- });
18
- Object.defineProperty(exports, "Icon", {
19
- enumerable: true,
20
- get: function () {
21
- return _Icon.Icon;
22
- }
23
- });
24
- Object.defineProperty(exports, "SemanticIcon", {
25
- enumerable: true,
26
- get: function () {
27
- return _SemanticIcon.SemanticIcon;
28
- }
29
- });
30
6
  var _ClickableIcon = require("./ClickableIcon");
7
+ Object.keys(_ClickableIcon).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ClickableIcon[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ClickableIcon[key];
14
+ }
15
+ });
16
+ });
31
17
  var _Icon = require("./Icon");
32
- var _SemanticIcon = require("./SemanticIcon");
18
+ Object.keys(_Icon).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _Icon[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _Icon[key];
25
+ }
26
+ });
27
+ });
28
+ var _SemanticIcon = require("./SemanticIcon");
29
+ Object.keys(_SemanticIcon).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _SemanticIcon[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _SemanticIcon[key];
36
+ }
37
+ });
38
+ });
@@ -1,8 +1,5 @@
1
1
  // @flow strict
2
2
 
3
- export type {CloseIconProps} from './ClickableIcon';
4
- export {ClickableIcon, CloseIcon} from './ClickableIcon';
5
- export type {IconProps, IconSize, IconType} from './Icon';
6
- export {Icon} from './Icon';
7
- export type {SemanticIconProps} from './SemanticIcon';
8
- export {SemanticIcon} from './SemanticIcon';
3
+ export * from './ClickableIcon';
4
+ export * from './Icon';
5
+ export * from './SemanticIcon';