@spaced-out/ui-design-system 0.1.91 → 0.1.93-beta.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 (43) hide show
  1. package/.cspell/custom-words.txt +41 -0
  2. package/CHANGELOG.md +24 -0
  3. package/lib/components/DateRangePicker/Calendar.js +75 -0
  4. package/lib/components/DateRangePicker/Calendar.js.flow +113 -0
  5. package/lib/components/DateRangePicker/Calendar.module.css +49 -0
  6. package/lib/components/DateRangePicker/DateRangePicker.js +120 -0
  7. package/lib/components/DateRangePicker/DateRangePicker.js.flow +173 -0
  8. package/lib/components/DateRangePicker/DateRangePicker.module.css +8 -0
  9. package/lib/components/DateRangePicker/DateRangeWrapper.js +175 -0
  10. package/lib/components/DateRangePicker/DateRangeWrapper.js.flow +282 -0
  11. package/lib/components/DateRangePicker/DateRangeWrapper.module.css +64 -0
  12. package/lib/components/DateRangePicker/Day.js +65 -0
  13. package/lib/components/DateRangePicker/Day.js.flow +80 -0
  14. package/lib/components/DateRangePicker/Day.module.css +91 -0
  15. package/lib/components/DateRangePicker/index.js +16 -0
  16. package/lib/components/DateRangePicker/index.js.flow +3 -0
  17. package/lib/components/DateRangePicker/timezones.js +262 -0
  18. package/lib/components/DateRangePicker/timezones.js.flow +256 -0
  19. package/lib/components/DateRangePicker/utils.js +218 -0
  20. package/lib/components/DateRangePicker/utils.js.flow +231 -0
  21. package/lib/components/Dropdown/Dropdown.js +7 -1
  22. package/lib/components/Dropdown/Dropdown.js.flow +7 -0
  23. package/lib/components/Dropdown/SimpleDropdown.js +3 -1
  24. package/lib/components/Dropdown/SimpleDropdown.js.flow +3 -0
  25. package/lib/components/Grid/Grid.js +4 -3
  26. package/lib/components/Grid/Grid.js.flow +6 -2
  27. package/lib/components/Grid/Grid.module.css +6 -0
  28. package/lib/components/SpiderChart/SpiderChart.js +1 -20
  29. package/lib/components/SpiderChart/SpiderChart.js.flow +0 -20
  30. package/lib/components/index.js +11 -0
  31. package/lib/components/index.js.flow +1 -0
  32. package/lib/types/charts.js.flow +1 -0
  33. package/lib/utils/charts/charts.js +3 -0
  34. package/lib/utils/charts/charts.js.flow +3 -0
  35. package/lib/utils/charts/columnChart.js +1 -0
  36. package/lib/utils/charts/columnChart.js.flow +1 -0
  37. package/lib/utils/charts/lineChart.js +1 -0
  38. package/lib/utils/charts/lineChart.js.flow +1 -0
  39. package/lib/utils/charts/spiderChart.js +3 -1
  40. package/lib/utils/charts/spiderChart.js.flow +4 -17
  41. package/lib/utils/charts/typography.js +2 -3
  42. package/lib/utils/charts/typography.js.flow +1 -3
  43. package/package.json +2 -1
@@ -66,29 +66,10 @@ export const SpiderChart = ({
66
66
  cardTitle,
67
67
  customExportOptions,
68
68
  headerActions,
69
- legend,
70
69
  series,
71
- xAxis: {
72
- categories,
73
- tickmarkPlacement = 'on',
74
- lineWidth: xAxisLineWidth = 0,
75
- ...xAxisProps
76
- } = {},
77
- yAxis: {
78
- gridLineInterpolation = 'polygon',
79
- lineWidth: yAxisLineWidth = 0,
80
- min: yAxisMin = 0,
81
- ...yAxisProps
82
- } = {},
83
-
84
70
  ...userOptions
85
71
  }: SpiderChartProps): React.Node => {
86
72
  const chartRef = React.useRef(null);
87
- const [chartWidth, setChartWidth] = React.useState(0);
88
-
89
- React.useLayoutEffect(() => {
90
- setChartWidth(chartRef.current?.chart.plotWidth);
91
- }, []);
92
73
 
93
74
  const spiderSeries = series.map((seriesItem, index) => ({
94
75
  ...seriesItem,
@@ -111,7 +92,6 @@ export const SpiderChart = ({
111
92
  return (
112
93
  <ChartWrapper
113
94
  title={cardTitle}
114
- //$FlowFixMe[incompatible-type]
115
95
  ref={chartRef}
116
96
  customExportOptions={customExportOptions}
117
97
  classNames={wrapperClassNames}
@@ -168,6 +168,17 @@ Object.keys(_ConditionalWrapper).forEach(function (key) {
168
168
  }
169
169
  });
170
170
  });
171
+ var _DateRangePicker = require("./DateRangePicker");
172
+ Object.keys(_DateRangePicker).forEach(function (key) {
173
+ if (key === "default" || key === "__esModule") return;
174
+ if (key in exports && exports[key] === _DateRangePicker[key]) return;
175
+ Object.defineProperty(exports, key, {
176
+ enumerable: true,
177
+ get: function () {
178
+ return _DateRangePicker[key];
179
+ }
180
+ });
181
+ });
171
182
  var _Dialog = require("./Dialog");
172
183
  Object.keys(_Dialog).forEach(function (key) {
173
184
  if (key === "default" || key === "__esModule") return;
@@ -15,6 +15,7 @@ export * from './Chip';
15
15
  export * from './CircularLoader';
16
16
  export * from './CollapsibleCard';
17
17
  export * from './ConditionalWrapper';
18
+ export * from './DateRangePicker';
18
19
  export * from './Dialog';
19
20
  export * from './Dropdown';
20
21
  export * from './EmptyState';
@@ -58,6 +58,7 @@ export type AxisOptions = {
58
58
  margin?: number,
59
59
  style: ?CSSObject,
60
60
  },
61
+ type?: string,
61
62
  };
62
63
 
63
64
  export type BreadcrumbsOptions = {
@@ -64,6 +64,9 @@ const commonChartOptions = {
64
64
  },
65
65
  symbolHeight: 8,
66
66
  enabled: true
67
+ },
68
+ xAxis: {
69
+ type: 'category'
67
70
  }
68
71
  };
69
72
  exports.commonChartOptions = commonChartOptions;
@@ -81,6 +81,9 @@ export const commonChartOptions: $Shape<ChartOptions> = {
81
81
  symbolHeight: 8,
82
82
  enabled: true,
83
83
  },
84
+ xAxis: {
85
+ type: 'category',
86
+ },
84
87
  };
85
88
 
86
89
  export const mergeChartUserOptions = (
@@ -23,6 +23,7 @@ const getColumnChartOptions = () => ({
23
23
  symbolWidth: 18
24
24
  },
25
25
  xAxis: {
26
+ ..._charts.commonChartOptions.xAxis,
26
27
  labels: {
27
28
  style: _helpers.xAxisLabelStyle
28
29
  },
@@ -28,6 +28,7 @@ export const getColumnChartOptions = (): ChartOptions => ({
28
28
  symbolWidth: 18,
29
29
  },
30
30
  xAxis: {
31
+ ...commonChartOptions.xAxis,
31
32
  labels: {
32
33
  style: xAxisLabelStyle,
33
34
  },
@@ -24,6 +24,7 @@ const getLineChartOptions = () => ({
24
24
  symbolWidth: 18
25
25
  },
26
26
  xAxis: {
27
+ ..._charts.commonChartOptions.xAxis,
27
28
  labels: {
28
29
  style: _typography.formLabelSmall
29
30
  },
@@ -27,6 +27,7 @@ export const getLineChartOptions = (): ChartOptions => ({
27
27
  symbolWidth: 18,
28
28
  },
29
29
  xAxis: {
30
+ ...commonChartOptions.xAxis,
30
31
  labels: {
31
32
  style: formLabelSmall,
32
33
  },
@@ -29,10 +29,12 @@ const getSpiderChartOptions = () => ({
29
29
  margin: [0, 0, 0, 0]
30
30
  },
31
31
  xAxis: {
32
+ ..._charts.commonChartOptions.xAxis,
32
33
  labels: {
33
34
  style: bodySmallSecondary
34
35
  },
35
- lineWidth: 0
36
+ lineWidth: 0,
37
+ tickmarkPlacement: 'on'
36
38
  },
37
39
  yAxis: {
38
40
  labels: {
@@ -1,28 +1,13 @@
1
1
  // @flow strict
2
2
 
3
3
  import {colorTextSecondary} from '../../styles/variables/_color';
4
- import type {
5
- AxisOptions,
6
- ChartOptions,
7
- LegendOptionsType,
8
- SeriesOptionsType,
9
- } from '../../types/charts';
4
+ import type {ChartOptions} from '../../types/charts';
10
5
 
11
6
  import {commonChartOptions} from './charts';
12
- import { rightLineLegendColumn} from './helpers';
7
+ import {rightLineLegendColumn} from './helpers';
13
8
  import {bodySmall} from './typography';
14
9
 
15
10
 
16
- type SpiderChartPropsType = {
17
- ...ChartOptions,
18
- chart: ChartOptions,
19
- xAxis: AxisOptions,
20
- yAxis: AxisOptions,
21
- series?: Array<SeriesOptionsType>,
22
- legend?: LegendOptionsType,
23
- ...
24
- };
25
-
26
11
  export const bodySmallSecondary = {
27
12
  ...bodySmall,
28
13
  color: colorTextSecondary,
@@ -43,10 +28,12 @@ export const getSpiderChartOptions = (): ChartOptions => ({
43
28
  margin: [0, 0, 0, 0],
44
29
  },
45
30
  xAxis: {
31
+ ...commonChartOptions.xAxis,
46
32
  labels: {
47
33
  style: bodySmallSecondary,
48
34
  },
49
35
  lineWidth: 0,
36
+ tickmarkPlacement: 'on',
50
37
  },
51
38
  yAxis: {
52
39
  labels: {
@@ -10,7 +10,6 @@ var _font = require("../../styles/variables/_font");
10
10
  const baseType = {
11
11
  fontFamily: 'Centra No 2',
12
12
  fontStyle: 'normal',
13
- lineHeight: _font.fontLineHeight120,
14
13
  margin: 0,
15
14
  color: _color.colorTextPrimary,
16
15
  letterSpacing: _font.fontLetterSpacing0,
@@ -30,7 +29,6 @@ const bodySmall = {
30
29
  ...baseType,
31
30
  fontSize: _font.fontSize12,
32
31
  fontWeight: _font.fontWeightBook,
33
- lineHeight: _font.fontLineHeight130,
34
32
  letterSpacing: _font.fontLetterSpacing4
35
33
  };
36
34
  exports.bodySmall = bodySmall;
@@ -43,7 +41,8 @@ exports.formLabelSmall = formLabelSmall;
43
41
  const buttonTextExtraSmall = {
44
42
  ...baseType,
45
43
  fontSize: _font.fontSize12,
46
- letterSpacing: _font.fontLetterSpacing1
44
+ letterSpacing: _font.fontLetterSpacing1,
45
+ lineHeight: _font.fontLineHeight120
47
46
  };
48
47
  exports.buttonTextExtraSmall = buttonTextExtraSmall;
49
48
  const underline = {
@@ -7,7 +7,6 @@ import {
7
7
  fontLetterSpacingMinus3,
8
8
  fontLineHeight100,
9
9
  fontLineHeight120,
10
- fontLineHeight130,
11
10
  fontLineHeight140,
12
11
  fontSize12,
13
12
  fontSize36,
@@ -19,7 +18,6 @@ import {
19
18
  export const baseType = {
20
19
  fontFamily: 'Centra No 2',
21
20
  fontStyle: 'normal',
22
- lineHeight: fontLineHeight120,
23
21
  margin: 0,
24
22
  color: colorTextPrimary,
25
23
  letterSpacing: fontLetterSpacing0,
@@ -39,7 +37,6 @@ export const bodySmall = {
39
37
  ...baseType,
40
38
  fontSize: fontSize12,
41
39
  fontWeight: fontWeightBook,
42
- lineHeight: fontLineHeight130,
43
40
  letterSpacing: fontLetterSpacing4,
44
41
  };
45
42
 
@@ -53,6 +50,7 @@ export const buttonTextExtraSmall = {
53
50
  ...baseType,
54
51
  fontSize: fontSize12,
55
52
  letterSpacing: fontLetterSpacing1,
53
+ lineHeight: fontLineHeight120,
56
54
  };
57
55
 
58
56
  export const underline = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.1.91",
3
+ "version": "0.1.93-beta.0",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {
@@ -49,6 +49,7 @@
49
49
  "highcharts": "^11.4.1",
50
50
  "highcharts-react-official": "^3.2.1",
51
51
  "lodash": "^4.17.21",
52
+ "moment-timezone": "^0.5.45",
52
53
  "react-dropzone": "^14.2.3"
53
54
  },
54
55
  "devDependencies": {