@pie-lib/charting 5.32.8-next.12 → 5.33.0-mui-update.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 (77) hide show
  1. package/CHANGELOG.md +7 -32
  2. package/lib/actions-button.js +49 -88
  3. package/lib/actions-button.js.map +1 -1
  4. package/lib/axes.js +175 -233
  5. package/lib/axes.js.map +1 -1
  6. package/lib/bars/bar.js +13 -41
  7. package/lib/bars/bar.js.map +1 -1
  8. package/lib/bars/common/bars.js +55 -126
  9. package/lib/bars/common/bars.js.map +1 -1
  10. package/lib/bars/common/correct-check-icon.js +1 -6
  11. package/lib/bars/common/correct-check-icon.js.map +1 -1
  12. package/lib/bars/histogram.js +13 -41
  13. package/lib/bars/histogram.js.map +1 -1
  14. package/lib/chart-setup.js +110 -184
  15. package/lib/chart-setup.js.map +1 -1
  16. package/lib/chart-type.js +29 -38
  17. package/lib/chart-type.js.map +1 -1
  18. package/lib/chart-types.js +1 -10
  19. package/lib/chart-types.js.map +1 -1
  20. package/lib/chart.js +74 -146
  21. package/lib/chart.js.map +1 -1
  22. package/lib/common/correctness-indicators.js +74 -52
  23. package/lib/common/correctness-indicators.js.map +1 -1
  24. package/lib/common/drag-handle.js +67 -105
  25. package/lib/common/drag-handle.js.map +1 -1
  26. package/lib/common/drag-icon.js +6 -12
  27. package/lib/common/drag-icon.js.map +1 -1
  28. package/lib/common/styles.js +6 -24
  29. package/lib/common/styles.js.map +1 -1
  30. package/lib/grid.js +44 -81
  31. package/lib/grid.js.map +1 -1
  32. package/lib/index.js +0 -6
  33. package/lib/index.js.map +1 -1
  34. package/lib/key-legend.js +63 -87
  35. package/lib/key-legend.js.map +1 -1
  36. package/lib/line/common/drag-handle.js +69 -100
  37. package/lib/line/common/drag-handle.js.map +1 -1
  38. package/lib/line/common/line.js +44 -92
  39. package/lib/line/common/line.js.map +1 -1
  40. package/lib/line/line-cross.js +77 -87
  41. package/lib/line/line-cross.js.map +1 -1
  42. package/lib/line/line-dot.js +66 -78
  43. package/lib/line/line-dot.js.map +1 -1
  44. package/lib/mark-label.js +75 -117
  45. package/lib/mark-label.js.map +1 -1
  46. package/lib/plot/common/plot.js +76 -144
  47. package/lib/plot/common/plot.js.map +1 -1
  48. package/lib/plot/dot.js +31 -57
  49. package/lib/plot/dot.js.map +1 -1
  50. package/lib/plot/line.js +37 -62
  51. package/lib/plot/line.js.map +1 -1
  52. package/lib/tool-menu.js +48 -80
  53. package/lib/tool-menu.js.map +1 -1
  54. package/lib/utils.js +20 -77
  55. package/lib/utils.js.map +1 -1
  56. package/package.json +12 -9
  57. package/src/actions-button.jsx +36 -37
  58. package/src/axes.jsx +80 -75
  59. package/src/bars/common/bars.jsx +8 -23
  60. package/src/chart-setup.jsx +68 -78
  61. package/src/chart-type.js +26 -21
  62. package/src/chart.jsx +8 -20
  63. package/src/common/correctness-indicators.jsx +51 -13
  64. package/src/common/drag-handle.jsx +44 -59
  65. package/src/common/drag-icon.jsx +2 -2
  66. package/src/common/styles.js +1 -1
  67. package/src/grid.jsx +9 -13
  68. package/src/key-legend.jsx +62 -60
  69. package/src/line/common/drag-handle.jsx +57 -55
  70. package/src/line/common/line.jsx +17 -8
  71. package/src/line/line-cross.js +37 -12
  72. package/src/line/line-dot.js +30 -11
  73. package/src/mark-label.jsx +43 -44
  74. package/src/plot/common/plot.jsx +17 -22
  75. package/src/plot/dot.js +10 -3
  76. package/src/plot/line.js +14 -6
  77. package/src/tool-menu.jsx +20 -23
@@ -1,19 +1,62 @@
1
1
  import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
- import { withStyles } from '@material-ui/core/styles/index';
4
+ import { styled } from '@mui/material/styles';
5
5
 
6
6
  import { gridDraggable, utils, types } from '@pie-lib/plot';
7
7
  import { color } from '@pie-lib/render-ui';
8
8
  import { disabled } from '../../common/styles';
9
9
 
10
+ const StyledDragHandle = styled('g')(({ theme }) => ({
11
+ color: 'black',
12
+ '& .handle': {
13
+ transition: 'fill 200ms linear, height 200ms linear',
14
+ '&.non-interactive': disabled('fill'),
15
+ },
16
+ '& .transparentHandle': {
17
+ height: '20px',
18
+ fill: 'transparent',
19
+ stroke: 'transparent',
20
+ },
21
+ '& .line': {
22
+ stroke: color.defaults.TEXT,
23
+ transition: 'fill 200ms linear, height 200ms linear',
24
+ '&.non-interactive': disabled('stroke'),
25
+ },
26
+ '& .disabledPoint': {
27
+ fill: color.defaults.BLACK + ' !important',
28
+ stroke: color.defaults.BLACK + ' !important',
29
+ },
30
+ '& .correctIcon': {
31
+ backgroundColor: color.correct(),
32
+ },
33
+ '& .incorrectIcon': {
34
+ backgroundColor: color.incorrectWithIcon(),
35
+ },
36
+ '& .correctnessIcon': {
37
+ borderRadius: theme.spacing(2),
38
+ color: color.defaults.WHITE,
39
+ fontSize: '16px',
40
+ width: '16px',
41
+ height: '16px',
42
+ padding: '2px',
43
+ border: `1px solid ${color.defaults.WHITE}`,
44
+ stroke: 'initial',
45
+ boxSizing: 'unset', // to override the default border-box in IBX
46
+ },
47
+ '& .smallIcon': {
48
+ fontSize: '10px',
49
+ width: '10px',
50
+ height: '10px',
51
+ },
52
+ }));
53
+
10
54
  class RawDragHandle extends React.Component {
11
55
  static propTypes = {
12
56
  x: PropTypes.number.isRequired,
13
57
  y: PropTypes.number.isRequired,
14
58
  width: PropTypes.number,
15
59
  graphProps: types.GraphPropsType.isRequired,
16
- classes: PropTypes.object.isRequired,
17
60
  className: PropTypes.string,
18
61
  interactive: PropTypes.bool,
19
62
  CustomDraggableComponent: PropTypes.func,
@@ -28,7 +71,6 @@ class RawDragHandle extends React.Component {
28
71
  x,
29
72
  y,
30
73
  graphProps,
31
- classes,
32
74
  className,
33
75
  interactive,
34
76
  CustomDraggableComponent,
@@ -38,62 +80,22 @@ class RawDragHandle extends React.Component {
38
80
  const { scale } = graphProps;
39
81
 
40
82
  return (
41
- <CustomDraggableComponent
42
- scale={scale}
43
- x={x}
44
- y={y}
45
- classes={classes}
46
- className={classNames(className, !interactive && 'non-interactive')}
47
- correctness={correctness}
48
- interactive={interactive}
49
- {...rest}
50
- />
83
+ <StyledDragHandle>
84
+ <CustomDraggableComponent
85
+ scale={scale}
86
+ x={x}
87
+ y={y}
88
+ className={classNames(className, !interactive && 'non-interactive')}
89
+ correctness={correctness}
90
+ interactive={interactive}
91
+ {...rest}
92
+ />
93
+ </StyledDragHandle>
51
94
  );
52
95
  }
53
96
  }
54
97
 
55
- export const DragHandle = withStyles((theme) => ({
56
- handle: {
57
- transition: 'fill 200ms linear, height 200ms linear',
58
- '&.non-interactive': disabled('fill'),
59
- },
60
- transparentHandle: {
61
- height: '20px',
62
- fill: 'transparent',
63
- stroke: 'transparent',
64
- },
65
- line: {
66
- stroke: color.defaults.TEXT,
67
- transition: 'fill 200ms linear, height 200ms linear',
68
- '&.non-interactive': disabled('stroke'),
69
- },
70
- disabledPoint: {
71
- fill: color.defaults.BLACK + ' !important',
72
- stroke: color.defaults.BLACK + ' !important',
73
- },
74
- correctIcon: {
75
- backgroundColor: color.correct(),
76
- },
77
- incorrectIcon: {
78
- backgroundColor: color.incorrectWithIcon(),
79
- },
80
- correctnessIcon: {
81
- borderRadius: theme.spacing.unit * 2,
82
- color: color.defaults.WHITE,
83
- fontSize: '16px',
84
- width: '16px',
85
- height: '16px',
86
- padding: '2px',
87
- border: `1px solid ${color.defaults.WHITE}`,
88
- stroke: 'initial',
89
- boxSizing: 'unset', // to override the default border-box in IBX
90
- },
91
- smallIcon: {
92
- fontSize: '10px',
93
- width: '10px',
94
- height: '10px',
95
- },
96
- }))(RawDragHandle);
98
+ export const DragHandle = RawDragHandle;
97
99
 
98
100
  const DraggableHandle = gridDraggable({
99
101
  axis: 'y',
@@ -4,7 +4,7 @@ import { LinePath } from '@vx/shape';
4
4
  import PropTypes from 'prop-types';
5
5
  import { types } from '@pie-lib/plot';
6
6
  import DraggableHandle, { DragHandle } from './drag-handle';
7
- import { withStyles } from '@material-ui/core/styles/index';
7
+ import { styled } from '@mui/material/styles';
8
8
  import isEqual from 'lodash/isEqual';
9
9
  import { color } from '@pie-lib/render-ui';
10
10
 
@@ -23,11 +23,17 @@ const getData = (data, domain) => {
23
23
  }));
24
24
  };
25
25
 
26
+ const StyledLinePath = styled(LinePath)(() => ({
27
+ fill: 'transparent',
28
+ stroke: color.defaults.TERTIARY,
29
+ strokeWidth: 3,
30
+ transition: 'stroke 200ms ease-in, stroke-width 200ms ease-in',
31
+ }));
32
+
26
33
  export class RawLine extends React.Component {
27
34
  static propTypes = {
28
35
  onChange: PropTypes.func,
29
36
  value: PropTypes.number,
30
- classes: PropTypes.object,
31
37
  label: PropTypes.string,
32
38
  xBand: PropTypes.func,
33
39
  index: PropTypes.number.isRequired,
@@ -78,18 +84,19 @@ export class RawLine extends React.Component {
78
84
  };
79
85
 
80
86
  render() {
81
- const { graphProps, data, classes, CustomDraggableComponent, defineChart, correctData } = this.props;
87
+ const { graphProps, data, CustomDraggableComponent, defineChart, correctData } = this.props;
82
88
  const { line: lineState, dragging } = this.state;
83
89
  const { scale } = graphProps;
84
90
  const lineToUse = dragging ? lineState : getData(data, graphProps.domain);
85
91
 
92
+ console.log('defineChart', lineToUse);
86
93
  return (
87
94
  <React.Fragment>
88
- <LinePath
95
+ <StyledLinePath
89
96
  data={lineToUse}
90
97
  x={(d) => scale.x(d.x)}
91
98
  y={(d) => scale.y(d.dragValue !== undefined ? d.dragValue : d.y)}
92
- className={classes.line}
99
+ className="line"
93
100
  />
94
101
  {lineToUse &&
95
102
  lineToUse.map((point, i) => {
@@ -97,6 +104,8 @@ export class RawLine extends React.Component {
97
104
  const enableDraggable = defineChart || point.interactive;
98
105
  const Component = enableDraggable ? DraggableHandle : DragHandle;
99
106
 
107
+ console.log('point', point);
108
+
100
109
  return (
101
110
  <Component
102
111
  key={`point-${point.x}-${i}`}
@@ -120,14 +129,14 @@ export class RawLine extends React.Component {
120
129
  }
121
130
  }
122
131
 
123
- const StyledLine = withStyles(() => ({
124
- line: {
132
+ const StyledLine = styled(RawLine)(() => ({
133
+ '& .line': {
125
134
  fill: 'transparent',
126
135
  stroke: color.defaults.TERTIARY,
127
136
  strokeWidth: 3,
128
137
  transition: 'stroke 200ms ease-in, stroke-width 200ms ease-in',
129
138
  },
130
- }))(RawLine);
139
+ }));
131
140
 
132
141
  export class Line extends React.Component {
133
142
  static propTypes = {
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { LinePath } from '@vx/shape';
4
4
  import { Group } from '@vx/group';
5
- import classNames from 'classnames';
5
+ import { styled } from '@mui/material/styles';
6
6
 
7
7
  import { color } from '@pie-lib/render-ui';
8
8
  import { dataToXBand } from '../utils';
@@ -10,18 +10,44 @@ import { types } from '@pie-lib/plot';
10
10
  import RawLine from './common/line';
11
11
  import { CorrectnessIndicator, SmallCorrectPointIndicator } from '../common/correctness-indicators';
12
12
 
13
+ const StyledLinePath = styled(LinePath)(() => ({
14
+ stroke: color.defaults.TEXT,
15
+ transition: 'fill 200ms linear, height 200ms linear',
16
+ '&.non-interactive': {
17
+ stroke: color.disabled?.() || '#ccc',
18
+ },
19
+ }));
20
+
21
+ const StyledGroup = styled(Group)(({ correctness, interactive }) => ({
22
+ stroke: color.defaults.TEXT,
23
+ transition: 'fill 200ms linear, height 200ms linear',
24
+ ...(correctness && !interactive && {
25
+ fill: `${color.defaults.BLACK} !important`,
26
+ stroke: `${color.defaults.BLACK} !important`,
27
+ }),
28
+ '&.non-interactive': {
29
+ stroke: color.disabled?.() || '#ccc',
30
+ },
31
+ }));
32
+
33
+ const StyledTransparentHandle = styled('circle')(() => ({
34
+ height: '20px',
35
+ fill: 'transparent',
36
+ stroke: 'transparent',
37
+ }));
38
+
13
39
  const DraggableComponent = (props) => {
14
- const { classes = {}, className, scale, x, y, r, correctness, interactive, correctData, label, ...rest } = props;
40
+ const { className, scale, x, y, r, correctness, interactive, correctData, label, ...rest } = props;
15
41
  const [hover, setHover] = useState(false);
16
42
 
17
43
  const squareSize = r * 4;
18
44
  const squareHalf = squareSize / 2;
19
45
  const cx = scale.x(x);
20
46
  const cy = scale.y(y);
21
-
47
+
22
48
  return (
23
- <Group className={classNames(className, classes.line, correctness && !interactive && classes.disabledPoint)}>
24
- <LinePath
49
+ <StyledGroup className={className} correctness={correctness} interactive={interactive}>
50
+ <StyledLinePath
25
51
  data={[
26
52
  { x: scale.x(x) - r, y: scale.y(y) + r },
27
53
  { x: scale.x(x) + r, y: scale.y(y) - r },
@@ -32,7 +58,7 @@ const DraggableComponent = (props) => {
32
58
  strokeWidth={5}
33
59
  style={{ pointerEvents: 'none' }}
34
60
  />
35
- <LinePath
61
+ <StyledLinePath
36
62
  data={[
37
63
  { x: scale.x(x) - r, y: scale.y(y) - r },
38
64
  { x: scale.x(x) + r, y: scale.y(y) + r },
@@ -55,11 +81,10 @@ const DraggableComponent = (props) => {
55
81
  pointerEvents="none"
56
82
  />
57
83
  )}
58
- <circle
84
+ <StyledTransparentHandle
59
85
  cx={cx}
60
86
  cy={cy}
61
87
  r={r * 2}
62
- className={classNames(classes.transparentHandle)}
63
88
  onMouseEnter={() => setHover(true)}
64
89
  onMouseLeave={() => setHover(false)}
65
90
  {...rest}
@@ -69,7 +94,6 @@ const DraggableComponent = (props) => {
69
94
  scale={scale}
70
95
  x={x}
71
96
  y={y}
72
- classes={classes}
73
97
  r={r}
74
98
  correctness={correctness}
75
99
  interactive={interactive}
@@ -80,11 +104,10 @@ const DraggableComponent = (props) => {
80
104
  x={x}
81
105
  r={r}
82
106
  correctness={correctness}
83
- classes={classes}
84
107
  correctData={correctData}
85
108
  label={label}
86
109
  />
87
- </Group>
110
+ </StyledGroup>
88
111
  );
89
112
  };
90
113
 
@@ -94,11 +117,13 @@ DraggableComponent.propTypes = {
94
117
  y: PropTypes.number,
95
118
  r: PropTypes.number,
96
119
  className: PropTypes.string,
97
- classes: PropTypes.object,
98
120
  correctness: PropTypes.shape({
99
121
  value: PropTypes.string,
100
122
  label: PropTypes.string,
101
123
  }),
124
+ interactive: PropTypes.bool,
125
+ correctData: PropTypes.array,
126
+ label: PropTypes.string,
102
127
  };
103
128
 
104
129
  export class LineCross extends React.Component {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import classNames from 'classnames';
3
+ import { styled } from '@mui/material/styles';
4
4
 
5
5
  import { types } from '@pie-lib/plot';
6
6
  import { color } from '@pie-lib/render-ui';
@@ -8,12 +8,23 @@ import { dataToXBand } from '../utils';
8
8
  import RawLine from './common/line';
9
9
  import { CorrectnessIndicator, SmallCorrectPointIndicator } from '../common/correctness-indicators';
10
10
 
11
+
12
+ const StyledHandle = styled('circle')(({ correctness, interactive }) => ({
13
+ }));
14
+
15
+
16
+ const StyledTransparentHandle = styled('circle')(() => ({
17
+ height: '20px',
18
+ fill: 'transparent', // keep it invisible
19
+ stroke: 'none',
20
+ pointerEvents: 'auto', // allow drag events
21
+ }));
22
+
11
23
  const DraggableComponent = ({
12
24
  scale,
13
25
  x,
14
26
  y,
15
27
  className,
16
- classes,
17
28
  r,
18
29
  correctness,
19
30
  interactive,
@@ -25,20 +36,28 @@ const DraggableComponent = ({
25
36
  const allowRolloverEvent = !correctness && interactive;
26
37
 
27
38
  return (
28
- <g onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
29
- <circle
39
+ <g
40
+ onMouseEnter={() => setIsHovered(true)}
41
+ onMouseLeave={() => setIsHovered(false)}
42
+ onTouchStart={() => setIsHovered(true)}
43
+ onTouchEnd={() => setIsHovered(false)}
44
+ >
45
+ <StyledTransparentHandle
30
46
  cx={scale.x(x)}
31
47
  cy={scale.y(y)}
32
48
  r={r * 3}
33
- className={classNames(classes.transparentHandle, className)}
34
- pointerEvents={correctness ? 'none' : ''}
49
+ className={className}
50
+ onMouseEnter={() => setIsHovered(true)}
51
+ onMouseLeave={() => setIsHovered(false)}
35
52
  {...rest}
36
53
  />
37
- <circle
54
+ <StyledHandle
38
55
  cx={scale.x(x)}
39
56
  cy={scale.y(y)}
40
57
  r={r}
41
- className={classNames(className, classes.handle, correctness && !interactive && classes.disabledPoint)}
58
+ className={className}
59
+ correctness={correctness}
60
+ interactive={interactive}
42
61
  {...rest}
43
62
  />
44
63
  {/* show correctness indicators */}
@@ -46,7 +65,6 @@ const DraggableComponent = ({
46
65
  scale={scale}
47
66
  x={x}
48
67
  y={y}
49
- classes={classes}
50
68
  r={r}
51
69
  correctness={correctness}
52
70
  interactive={interactive}
@@ -58,7 +76,6 @@ const DraggableComponent = ({
58
76
  x={x}
59
77
  r={r}
60
78
  correctness={correctness}
61
- classes={classes}
62
79
  correctData={correctData}
63
80
  label={label}
64
81
  />
@@ -85,11 +102,13 @@ DraggableComponent.propTypes = {
85
102
  y: PropTypes.number,
86
103
  r: PropTypes.number,
87
104
  className: PropTypes.string,
88
- classes: PropTypes.object,
89
105
  correctness: PropTypes.shape({
90
106
  value: PropTypes.string,
91
107
  label: PropTypes.string,
92
108
  }),
109
+ interactive: PropTypes.bool,
110
+ correctData: PropTypes.array,
111
+ label: PropTypes.string,
93
112
  };
94
113
 
95
114
  export class LineDot extends React.Component {
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useCallback, useEffect, useRef } from 'react';
2
2
  import classNames from 'classnames';
3
- import { withStyles } from '@material-ui/core/styles';
3
+ import { styled } from '@mui/material/styles';
4
4
  import AutosizeInput from 'react-input-autosize';
5
5
  import PropTypes from 'prop-types';
6
6
 
@@ -9,46 +9,46 @@ import { correct, incorrect, disabled } from './common/styles';
9
9
  import { color } from '@pie-lib/render-ui';
10
10
  import { renderMath } from '@pie-lib/math-rendering';
11
11
 
12
- const styles = (theme) => ({
13
- input: {
14
- float: 'right',
15
- fontFamily: theme.typography.fontFamily,
16
- fontSize: theme.typography.fontSize,
17
- border: 'none',
18
- '&.correct': correct('color'),
19
- '&.incorrect': incorrect('color'),
20
- '&.disabled': {
21
- backgroundColor: 'transparent !important',
22
- },
23
- '&.error': { border: `2px solid ${theme.palette.error.main}` },
24
- },
25
- mathInput: {
26
- pointerEvents: 'auto',
27
- textAlign: 'center',
28
- fontSize: theme.typography.fontSize + 2,
29
- fontFamily: theme.typography.fontFamily,
30
- color: color.primaryDark(),
31
- paddingTop: theme.typography.fontSize / 2,
12
+ const StyledContainer = styled('div')({
13
+ display: 'flex',
14
+ flexDirection: 'column',
15
+ alignItems: 'center',
16
+ });
17
+
18
+ const StyledInput = styled('input')(({ theme }) => ({
19
+ float: 'right',
20
+ fontFamily: theme.typography.fontFamily,
21
+ fontSize: theme.typography.fontSize,
22
+ border: 'none',
23
+ '&.correct': correct('color'),
24
+ '&.incorrect': incorrect('color'),
25
+ '&.disabled': {
26
+ backgroundColor: 'transparent !important',
32
27
  },
33
- disabled: {
28
+ '&.error': { border: `2px solid ${theme.palette.error.main}` },
29
+ }));
30
+
31
+ const StyledMathInput = styled('div')(({ theme }) => ({
32
+ pointerEvents: 'auto',
33
+ textAlign: 'center',
34
+ fontSize: theme.typography.fontSize + 2,
35
+ fontFamily: theme.typography.fontFamily,
36
+ color: color.primaryDark(),
37
+ paddingTop: theme.typography.fontSize / 2,
38
+ '&.disabled': {
34
39
  ...disabled('color'),
35
40
  backgroundColor: 'transparent !important',
36
41
  },
37
- error: {
42
+ '&.error': {
38
43
  border: `2px solid ${theme.palette.error.main}`,
39
44
  },
40
- correct: {
45
+ '&.correct': {
41
46
  ...correct('color'),
42
47
  },
43
- incorrect: {
48
+ '&.incorrect': {
44
49
  ...incorrect('color'),
45
50
  },
46
- flexContainer: {
47
- display: 'flex',
48
- flexDirection: 'column',
49
- alignItems: 'center',
50
- },
51
- });
51
+ }));
52
52
 
53
53
  function isFractionFormat(label) {
54
54
  const trimmedLabel = label?.trim() || '';
@@ -85,7 +85,6 @@ export const MarkLabel = (props) => {
85
85
 
86
86
  const {
87
87
  mark,
88
- classes,
89
88
  disabled,
90
89
  inputRef: externalInputRef,
91
90
  barWidth,
@@ -139,20 +138,20 @@ export const MarkLabel = (props) => {
139
138
  }, []);
140
139
 
141
140
  return (
142
- <div className={classes.flexContainer}>
141
+ <StyledContainer>
143
142
  {correctnessIndicator}
144
143
  {isMathRendering() ? (
145
- <div
144
+ <StyledMathInput
146
145
  ref={(r) => {
147
146
  root = r;
148
147
  externalInputRef(r);
149
148
  }}
150
149
  dangerouslySetInnerHTML={{ __html: getLabelMathFormat(label) }}
151
- className={classNames(classes.mathInput, {
152
- [classes.disabled]: disabled,
153
- [classes.error]: error,
154
- [classes.correct]: mark.editable && correctness?.label === 'correct',
155
- [classes.incorrect]: mark.editable && correctness?.label === 'incorrect',
150
+ className={classNames({
151
+ disabled: disabled,
152
+ error: error,
153
+ correct: mark.editable && correctness?.label === 'correct',
154
+ incorrect: mark.editable && correctness?.label === 'incorrect',
156
155
  })}
157
156
  onClick={() => setIsEditing(true)}
158
157
  style={{
@@ -163,17 +162,17 @@ export const MarkLabel = (props) => {
163
162
  visibility: isHiddenLabel ? 'hidden' : 'unset',
164
163
  marginTop: correctnessIndicator ? '24px' : '0',
165
164
  }}
166
- ></div>
165
+ ></StyledMathInput>
167
166
  ) : (
168
167
  <AutosizeInput
169
168
  inputRef={(r) => {
170
169
  _ref(r);
171
170
  externalInputRef(r);
172
171
  }}
172
+ name='mark-label-input'
173
173
  autoFocus={isEditing || autoFocus}
174
174
  disabled={disabled}
175
175
  inputClassName={classNames(
176
- classes.input,
177
176
  correctness && mark.editable ? correctness.label : null,
178
177
  disabled && 'disabled',
179
178
  error && 'error',
@@ -185,6 +184,7 @@ export const MarkLabel = (props) => {
185
184
  boxSizing: 'border-box',
186
185
  paddingLeft: 0,
187
186
  paddingRight: 0,
187
+ border: 'none',
188
188
  ...extraStyle,
189
189
  }}
190
190
  value={label}
@@ -203,7 +203,7 @@ export const MarkLabel = (props) => {
203
203
  onBlur={onChangeProp}
204
204
  />
205
205
  )}
206
- </div>
206
+ </StyledContainer>
207
207
  );
208
208
  };
209
209
 
@@ -213,7 +213,6 @@ MarkLabel.propTypes = {
213
213
  error: PropTypes.any,
214
214
  onChange: PropTypes.func,
215
215
  graphProps: types.GraphPropsType,
216
- classes: PropTypes.object,
217
216
  inputRef: PropTypes.func,
218
217
  mark: PropTypes.object,
219
218
  barWidth: PropTypes.number,
@@ -227,4 +226,4 @@ MarkLabel.propTypes = {
227
226
  correctnessIndicator: PropTypes.node,
228
227
  };
229
228
 
230
- export default withStyles(styles)(MarkLabel);
229
+ export default MarkLabel;