@pie-lib/config-ui 11.30.0-mui-update.0 → 11.30.1-beta-1

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 (105) hide show
  1. package/CHANGELOG.md +12 -9
  2. package/lib/__tests__/choice-utils.test.js +16 -0
  3. package/lib/__tests__/langs.test.js +55 -0
  4. package/lib/__tests__/number-text-field.test.js +128 -0
  5. package/lib/__tests__/settings-panel.test.js +201 -0
  6. package/lib/__tests__/two-choice.test.js +33 -0
  7. package/lib/alert-dialog.js +42 -23
  8. package/lib/alert-dialog.js.map +1 -1
  9. package/lib/checkbox.js +71 -56
  10. package/lib/checkbox.js.map +1 -1
  11. package/lib/choice-configuration/__tests__/feedback-menu.test.js +20 -0
  12. package/lib/choice-configuration/__tests__/index.test.js +119 -0
  13. package/lib/choice-configuration/feedback-menu.js +63 -24
  14. package/lib/choice-configuration/feedback-menu.js.map +1 -1
  15. package/lib/choice-configuration/index.js +257 -201
  16. package/lib/choice-configuration/index.js.map +1 -1
  17. package/lib/choice-utils.js +18 -6
  18. package/lib/choice-utils.js.map +1 -1
  19. package/lib/feedback-config/__tests__/feedback-config.test.js +78 -0
  20. package/lib/feedback-config/__tests__/feedback-selector.test.js +71 -0
  21. package/lib/feedback-config/feedback-selector.js +114 -77
  22. package/lib/feedback-config/feedback-selector.js.map +1 -1
  23. package/lib/feedback-config/group.js +40 -26
  24. package/lib/feedback-config/group.js.map +1 -1
  25. package/lib/feedback-config/index.js +90 -38
  26. package/lib/feedback-config/index.js.map +1 -1
  27. package/lib/form-section.js +33 -24
  28. package/lib/form-section.js.map +1 -1
  29. package/lib/help.js +80 -39
  30. package/lib/help.js.map +1 -1
  31. package/lib/index.js +31 -1
  32. package/lib/index.js.map +1 -1
  33. package/lib/input.js +54 -21
  34. package/lib/input.js.map +1 -1
  35. package/lib/inputs.js +95 -61
  36. package/lib/inputs.js.map +1 -1
  37. package/lib/langs.js +100 -56
  38. package/lib/langs.js.map +1 -1
  39. package/lib/layout/__tests__/config.layout.test.js +33 -0
  40. package/lib/layout/__tests__/layout-content.test.js +6 -0
  41. package/lib/layout/config-layout.js +99 -48
  42. package/lib/layout/config-layout.js.map +1 -1
  43. package/lib/layout/index.js +3 -0
  44. package/lib/layout/index.js.map +1 -1
  45. package/lib/layout/layout-contents.js +101 -72
  46. package/lib/layout/layout-contents.js.map +1 -1
  47. package/lib/layout/settings-box.js +56 -27
  48. package/lib/layout/settings-box.js.map +1 -1
  49. package/lib/mui-box/index.js +57 -41
  50. package/lib/mui-box/index.js.map +1 -1
  51. package/lib/number-text-field-custom.js +161 -79
  52. package/lib/number-text-field-custom.js.map +1 -1
  53. package/lib/number-text-field.js +115 -57
  54. package/lib/number-text-field.js.map +1 -1
  55. package/lib/radio-with-label.js +31 -23
  56. package/lib/radio-with-label.js.map +1 -1
  57. package/lib/settings/display-size.js +32 -16
  58. package/lib/settings/display-size.js.map +1 -1
  59. package/lib/settings/index.js +47 -14
  60. package/lib/settings/index.js.map +1 -1
  61. package/lib/settings/panel.js +228 -142
  62. package/lib/settings/panel.js.map +1 -1
  63. package/lib/settings/settings-radio-label.js +30 -21
  64. package/lib/settings/settings-radio-label.js.map +1 -1
  65. package/lib/settings/toggle.js +46 -34
  66. package/lib/settings/toggle.js.map +1 -1
  67. package/lib/tabs/index.js +57 -22
  68. package/lib/tabs/index.js.map +1 -1
  69. package/lib/tags-input/__tests__/index.test.js +88 -0
  70. package/lib/tags-input/index.js +99 -50
  71. package/lib/tags-input/index.js.map +1 -1
  72. package/lib/two-choice.js +90 -46
  73. package/lib/two-choice.js.map +1 -1
  74. package/lib/with-stateful-model.js +31 -8
  75. package/lib/with-stateful-model.js.map +1 -1
  76. package/package.json +10 -12
  77. package/src/__tests__/number-text-field.test.jsx +1 -1
  78. package/src/alert-dialog.jsx +18 -14
  79. package/src/checkbox.jsx +46 -42
  80. package/src/choice-configuration/feedback-menu.jsx +5 -5
  81. package/src/choice-configuration/index.jsx +193 -205
  82. package/src/feedback-config/feedback-selector.jsx +53 -51
  83. package/src/feedback-config/group.jsx +22 -21
  84. package/src/feedback-config/index.jsx +29 -27
  85. package/src/form-section.jsx +18 -18
  86. package/src/help.jsx +28 -20
  87. package/src/input.jsx +1 -1
  88. package/src/inputs.jsx +50 -34
  89. package/src/langs.jsx +46 -40
  90. package/src/layout/config-layout.jsx +36 -25
  91. package/src/layout/layout-contents.jsx +34 -34
  92. package/src/layout/settings-box.jsx +19 -16
  93. package/src/mui-box/index.jsx +43 -35
  94. package/src/number-text-field-custom.jsx +36 -30
  95. package/src/number-text-field.jsx +30 -22
  96. package/src/radio-with-label.jsx +13 -17
  97. package/src/settings/display-size.jsx +11 -12
  98. package/src/settings/panel.jsx +89 -83
  99. package/src/settings/settings-radio-label.jsx +13 -17
  100. package/src/settings/toggle.jsx +29 -29
  101. package/src/tabs/index.jsx +8 -8
  102. package/src/tags-input/index.jsx +38 -35
  103. package/src/two-choice.jsx +19 -15
  104. package/LICENSE.md +0 -5
  105. package/NEXT.CHANGELOG.json +0 -1
@@ -1,37 +1,16 @@
1
1
  import React from 'react';
2
+ import classnames from 'classnames';
2
3
  import PropTypes from 'prop-types';
3
- import { styled } from '@mui/material/styles';
4
+ import { withStyles } from '@material-ui/core';
4
5
  import Tabs from '../tabs';
5
6
  import classNames from 'classnames';
6
7
 
7
- const StyledContainer = styled('div')(({ theme }) => ({
8
- display: 'flex',
9
- flexDirection: 'column',
10
- position: 'relative',
11
- }));
12
-
13
- const StyledFlow = styled('div')(() => ({
14
- display: 'flex',
15
- justifyContent: 'space-between',
16
- }));
17
-
18
- const StyledContentContainer = styled('div')(({ theme }) => ({
19
- padding: `${theme.spacing(2)}px 0`,
20
- }));
21
-
22
- const StyledConfigContainer = styled('div')(() => ({
23
- flex: '1',
24
- }));
25
-
26
- const StyledSettingsContainer = styled('div')(({ theme }) => ({
27
- marginLeft: theme.spacing(2),
28
- }));
29
-
30
8
  class RawLayoutContents extends React.Component {
31
9
  static propTypes = {
32
10
  mode: PropTypes.oneOf(['tabbed', 'inline']),
33
11
  secondary: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
34
12
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
13
+ classes: PropTypes.object,
35
14
  dimensions: PropTypes.object,
36
15
  };
37
16
 
@@ -68,7 +47,7 @@ class RawLayoutContents extends React.Component {
68
47
  // }
69
48
 
70
49
  render() {
71
- const { mode, secondary, children, dimensions } = this.props;
50
+ const { mode, secondary, children, classes, dimensions } = this.props;
72
51
  const { minHeight, minWidth, maxHeight, maxWidth } = dimensions || {};
73
52
  const configuration = this.getConfiguration();
74
53
 
@@ -86,18 +65,18 @@ class RawLayoutContents extends React.Component {
86
65
  }
87
66
 
88
67
  return (
89
- <StyledContainer style={{ minHeight, minWidth, maxHeight, maxWidth }}>
68
+ <div className={classes.container} style={{ minHeight, minWidth, maxHeight, maxWidth }}>
90
69
  {mode === 'inline' && (
91
- <StyledFlow>
92
- <StyledConfigContainer className="design-container">{children}</StyledConfigContainer>
70
+ <div className={classnames(classes.flow, classes.contentContainer)}>
71
+ <div className={classnames(classes.configContainer, 'design-container')}>{children}</div>
93
72
  {hasSettingsPanel && (
94
- <StyledSettingsContainer className="settings-container">{secondary}</StyledSettingsContainer>
73
+ <div className={classnames(classes.settingsContainer, 'settings-container')}>{secondary}</div>
95
74
  )}
96
- </StyledFlow>
75
+ </div>
97
76
  )}
98
77
 
99
78
  {mode === 'tabbed' && hasSettingsPanel && (
100
- <Tabs onChange={this.onTabsChange} contentClassName="content-container" indicatorColor="primary">
79
+ <Tabs onChange={this.onTabsChange} contentClassName={classes.contentContainer} indicatorColor="primary">
101
80
  <div title="Design" className="design-container">
102
81
  {children}
103
82
  </div>
@@ -108,11 +87,32 @@ class RawLayoutContents extends React.Component {
108
87
  )}
109
88
 
110
89
  {mode === 'tabbed' && !hasSettingsPanel && (
111
- <StyledContentContainer className="design-container">{children}</StyledContentContainer>
90
+ <div className={classNames(classes.contentContainer, 'design-container')}>{children}</div>
112
91
  )}
113
- </StyledContainer>
92
+ </div>
114
93
  );
115
94
  }
116
95
  }
117
96
 
118
- export default RawLayoutContents;
97
+ const styles = (theme) => ({
98
+ flow: {
99
+ display: 'flex',
100
+ justifyContent: 'space-between',
101
+ },
102
+ container: {
103
+ display: 'flex',
104
+ flexDirection: 'column',
105
+ position: 'relative',
106
+ },
107
+ contentContainer: {
108
+ padding: `${theme.spacing.unit * 2}px 0`,
109
+ },
110
+ configContainer: {
111
+ flex: '1',
112
+ },
113
+ settingsContainer: {
114
+ marginLeft: theme.spacing.unit * 2,
115
+ },
116
+ });
117
+
118
+ export default withStyles(styles)(RawLayoutContents);
@@ -1,21 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { styled } from '@mui/material/styles';
4
-
5
- const StyledSettingsBox = styled('div')(({ theme }) => ({
6
- backgroundColor: theme.palette.background.paper,
7
- border: `2px solid ${theme.palette.grey[200]}`,
8
- display: 'flex',
9
- flexDirection: 'column',
10
- justifyContent: 'flex-start',
11
- minWidth: '275px',
12
- maxWidth: '300px',
13
- padding: '20px 4px 4px 20px',
14
- zIndex: 99,
15
- }));
3
+ import { withStyles } from '@material-ui/core/styles';
4
+ import classNames from 'classnames';
16
5
 
17
6
  export class SettingsBox extends React.Component {
18
7
  static propTypes = {
8
+ classes: PropTypes.object.isRequired,
19
9
  className: PropTypes.string,
20
10
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
21
11
  };
@@ -23,10 +13,23 @@ export class SettingsBox extends React.Component {
23
13
  static defaultProps = {};
24
14
 
25
15
  render() {
26
- const { className, children } = this.props;
16
+ const { classes, className, children } = this.props;
27
17
 
28
- return <StyledSettingsBox className={className}>{children}</StyledSettingsBox>;
18
+ return <div className={classNames(classes.settingsBox, className)}>{children}</div>;
29
19
  }
30
20
  }
21
+ const styles = (theme) => ({
22
+ settingsBox: {
23
+ backgroundColor: theme.palette.background.paper,
24
+ border: `2px solid ${theme.palette.grey[200]}`,
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ justifyContent: 'flex-start',
28
+ minWidth: '275px',
29
+ maxWidth: '300px',
30
+ padding: '20px 4px 4px 20px',
31
+ zIndex: 99,
32
+ },
33
+ });
31
34
 
32
- export default SettingsBox;
35
+ export default withStyles(styles)(SettingsBox);
@@ -1,52 +1,60 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { styled } from '@mui/material/styles';
3
+ import { withStyles } from '@material-ui/core/styles';
4
4
  import debug from 'debug';
5
+ import classNames from 'classnames';
5
6
 
6
7
  const log = debug('pie-elements:config-ui:mui-box');
7
8
 
8
- const StyledMuiBox = styled('div')(({ theme, focused }) => {
9
- const light = theme.palette.mode === 'light';
9
+ const MuiBox = withStyles((theme) => {
10
+ const light = theme.palette.type === 'light';
10
11
  const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
11
12
 
12
- log(theme.palette.primary[theme.palette.mode || 'light']);
13
+ log(theme.palette.primary[theme.palette.type || 'light']);
13
14
 
14
15
  return {
15
- paddingTop: theme.spacing(1),
16
- paddingBottom: theme.spacing(1),
17
- position: 'relative',
18
- '&:before': {
19
- left: 0,
20
- right: 0,
21
- bottom: 0,
22
- height: '1px',
23
- content: '""',
24
- position: 'absolute',
25
- transition: 'background-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
26
- pointerEvents: 'none',
27
- backgroundColor: bottomLineColor,
16
+ muiBox: {
17
+ paddingTop: theme.spacing.unit,
18
+ paddingBottom: theme.spacing.unit,
19
+ position: 'relative',
20
+ '&:before': {
21
+ left: 0,
22
+ right: 0,
23
+ bottom: 0,
24
+ height: '1px',
25
+ content: '""',
26
+ position: 'absolute',
27
+ transition: 'background-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
28
+ pointerEvents: 'none',
29
+ backgroundColor: bottomLineColor,
30
+ },
31
+ '&:hover:before': {
32
+ height: '2px',
33
+ },
34
+ '&:after': {
35
+ left: 0,
36
+ right: 0,
37
+ bottom: 0,
38
+ height: '2px',
39
+ content: '""',
40
+ position: 'absolute',
41
+ transform: 'scaleX(0)',
42
+ transition: 'transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms',
43
+ pointerEvents: 'none',
44
+ backgroundColor: theme.palette.primary[theme.palette.type], //'#304ffe'
45
+ },
28
46
  },
29
- '&:hover:before': {
30
- height: '2px',
31
- },
32
- '&:after': {
33
- left: 0,
34
- right: 0,
35
- bottom: 0,
36
- height: '2px',
37
- content: '""',
38
- position: 'absolute',
39
- transform: focused ? 'scaleX(1)' : 'scaleX(0)',
40
- transition: 'transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms',
41
- pointerEvents: 'none',
42
- backgroundColor: theme.palette.primary[theme.palette.mode], //'#304ffe'
47
+ focused: {
48
+ '&:after': {
49
+ transform: 'scaleX(1)',
50
+ },
43
51
  },
44
52
  };
45
- });
53
+ })(({ children, classes, focused }) => {
54
+ const names = classNames(classes.muiBox, focused && classes.focused);
46
55
 
47
- const MuiBox = ({ children, focused }) => {
48
- return <StyledMuiBox focused={focused}>{children}</StyledMuiBox>;
49
- };
56
+ return <div className={names}>{children}</div>;
57
+ });
50
58
 
51
59
  MuiBox.propTypes = {
52
60
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
@@ -1,31 +1,33 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import TextField from '@mui/material/TextField';
4
- import { styled } from '@mui/material/styles';
3
+ import TextField from '@material-ui/core/TextField';
4
+ import classNames from 'classnames';
5
+ import { withStyles } from '@material-ui/core/styles';
5
6
  import isFinite from 'lodash/isFinite';
6
- import IconButton from '@mui/material/IconButton';
7
- import InputAdornment from '@mui/material/InputAdornment';
8
- import Remove from '@mui/icons-material/Remove';
9
- import Add from '@mui/icons-material/Add';
7
+ import IconButton from '@material-ui/core/IconButton';
8
+ import InputAdornment from '@material-ui/core/InputAdornment';
9
+ import Remove from '@material-ui/icons/Remove';
10
+ import Add from '@material-ui/icons/Add';
10
11
  import * as math from 'mathjs';
11
12
 
12
- const StyledTextField = styled(TextField)(() => ({
13
- '& input[type=number]': {
14
- MozAppearance: 'textfield',
13
+ const styles = () => ({
14
+ input: {
15
+ '& input[type=number]': {
16
+ '-moz-appearance': 'textfield',
17
+ },
18
+ '& input[type=number]::-webkit-outer-spin-button': {
19
+ '-webkit-appearance': 'none',
20
+ margin: 0,
21
+ },
22
+ '& input[type=number]::-webkit-inner-spin-button': {
23
+ '-webkit-appearance': 'none',
24
+ margin: 0,
25
+ },
15
26
  },
16
- '& input[type=number]::-webkit-outer-spin-button': {
17
- WebkitAppearance: 'none',
18
- margin: 0,
27
+ iconButton: {
28
+ padding: '2px',
19
29
  },
20
- '& input[type=number]::-webkit-inner-spin-button': {
21
- WebkitAppearance: 'none',
22
- margin: 0,
23
- },
24
- }));
25
-
26
- const StyledIconButton = styled(IconButton)(() => ({
27
- padding: '2px',
28
- }));
30
+ });
29
31
 
30
32
  const fallbackNumber = (min, max) => {
31
33
  if (!isFinite(min) && !isFinite(max)) {
@@ -43,6 +45,7 @@ const fallbackNumber = (min, max) => {
43
45
 
44
46
  export class NumberTextFieldCustom extends React.Component {
45
47
  static propTypes = {
48
+ classes: PropTypes.object.isRequired,
46
49
  className: PropTypes.string,
47
50
  customValues: PropTypes.array,
48
51
  disabled: PropTypes.bool,
@@ -239,6 +242,7 @@ export class NumberTextFieldCustom extends React.Component {
239
242
  render() {
240
243
  const {
241
244
  className,
245
+ classes,
242
246
  label,
243
247
  disabled,
244
248
  error,
@@ -253,7 +257,7 @@ export class NumberTextFieldCustom extends React.Component {
253
257
  type = 'number',
254
258
  } = this.props;
255
259
  const { value } = this.state;
256
- const names = className;
260
+ const names = classNames(className, classes.input);
257
261
  //Logic to disable the increment and decrement buttons
258
262
  let disabledStart = false;
259
263
  let disabledEnd = false;
@@ -266,7 +270,7 @@ export class NumberTextFieldCustom extends React.Component {
266
270
  }
267
271
 
268
272
  return (
269
- <StyledTextField
273
+ <TextField
270
274
  variant={variant}
271
275
  inputRef={(ref) => (this.inputRef = ref)}
272
276
  disabled={disabled}
@@ -299,22 +303,24 @@ export class NumberTextFieldCustom extends React.Component {
299
303
  disableUnderline: disableUnderline,
300
304
  startAdornment: (
301
305
  <InputAdornment position="start">
302
- <StyledIconButton
306
+ <IconButton
307
+ className={classes.iconButton}
303
308
  disabled={disabled ? disabled : disabledStart}
304
309
  onClick={(e) => this.changeValue(e, -1, true)}
305
- size="large">
310
+ >
306
311
  <Remove fontSize="small" />
307
- </StyledIconButton>
312
+ </IconButton>
308
313
  </InputAdornment>
309
314
  ),
310
315
  endAdornment: (
311
316
  <InputAdornment position="end">
312
- <StyledIconButton
317
+ <IconButton
318
+ className={classes.iconButton}
313
319
  disabled={disabled ? disabled : disabledEnd}
314
320
  onClick={(e) => this.changeValue(e, 1, true)}
315
- size="large">
321
+ >
316
322
  <Add fontSize="small" />
317
- </StyledIconButton>
323
+ </IconButton>
318
324
  </InputAdornment>
319
325
  ),
320
326
  }}
@@ -328,4 +334,4 @@ export class NumberTextFieldCustom extends React.Component {
328
334
  }
329
335
  }
330
336
 
331
- export default NumberTextFieldCustom;
337
+ export default withStyles(styles)(NumberTextFieldCustom);
@@ -1,18 +1,21 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import TextField from '@mui/material/TextField';
4
- import { styled } from '@mui/material/styles';
3
+ import TextField from '@material-ui/core/TextField';
4
+ import classNames from 'classnames';
5
+ import { withStyles } from '@material-ui/core/styles';
5
6
  import debug from 'debug';
6
7
  import isFinite from 'lodash/isFinite';
7
- import InputAdornment from '@mui/material/InputAdornment';
8
+ import InputAdornment from '@material-ui/core/InputAdornment';
8
9
  const log = debug('@pie-lib:config-ui:number-text-field');
9
10
 
10
- const StyledTextField = styled(TextField)(({ theme }) => ({
11
- marginRight: theme.spacing(1),
12
- '& label': {
13
- width: 'max-content',
11
+ const styles = (theme) => ({
12
+ root: {
13
+ marginRight: theme.spacing.unit,
14
+ '& label': {
15
+ width: 'max-content',
16
+ },
14
17
  },
15
- }));
18
+ });
16
19
 
17
20
  const fallbackNumber = (min, max) => {
18
21
  if (!isFinite(min) && !isFinite(max)) {
@@ -30,6 +33,7 @@ const fallbackNumber = (min, max) => {
30
33
  export class NumberTextField extends React.Component {
31
34
  static propTypes = {
32
35
  disabled: PropTypes.bool,
36
+ classes: PropTypes.object.isRequired,
33
37
  className: PropTypes.string,
34
38
  inputClassName: PropTypes.string,
35
39
  onChange: PropTypes.func.isRequired,
@@ -142,6 +146,7 @@ export class NumberTextField extends React.Component {
142
146
  render() {
143
147
  const {
144
148
  className,
149
+ classes,
145
150
  label,
146
151
  disabled,
147
152
  suffix,
@@ -152,11 +157,12 @@ export class NumberTextField extends React.Component {
152
157
  showErrorWhenOutsideRange,
153
158
  variant,
154
159
  } = this.props;
160
+ const names = classNames(classes.root, className);
155
161
 
156
162
  const error = showErrorWhenOutsideRange && this.getError();
157
163
  return (
158
- <StyledTextField
159
- variant={disableUnderline ? 'filled' : (variant || 'standard')}
164
+ <TextField
165
+ variant={variant || 'standard'}
160
166
  inputRef={(ref) => {
161
167
  this.inputRef = ref;
162
168
  }}
@@ -167,23 +173,25 @@ export class NumberTextField extends React.Component {
167
173
  helperText={error}
168
174
  onChange={this.onChange}
169
175
  onBlur={this.onBlur}
170
- onKeyDown={(e) => {
176
+ onKeyPress={(e) => {
171
177
  // once the Enter key is pressed, we force input blur
172
178
  if (e.key === 'Enter' && this.inputRef) {
173
179
  this.inputRef.blur();
174
180
  }
175
181
  }}
176
182
  type="number"
177
- className={className}
178
- slotProps={{
179
- input: {
180
- endAdornment: suffix && <InputAdornment position="end">{suffix}</InputAdornment>,
181
- className: inputClassName,
182
- inputProps: {
183
- min,
184
- max,
185
- },
186
- },
183
+ className={names}
184
+ InputLabelProps={{
185
+ shrink: true,
186
+ }}
187
+ InputProps={{
188
+ endAdornment: suffix && <InputAdornment position="end">{suffix}</InputAdornment>,
189
+ className: inputClassName,
190
+ disableUnderline: disableUnderline,
191
+ }}
192
+ inputProps={{
193
+ min,
194
+ max,
187
195
  }}
188
196
  margin="normal"
189
197
  />
@@ -191,4 +199,4 @@ export class NumberTextField extends React.Component {
191
199
  }
192
200
  }
193
201
 
194
- export default NumberTextField;
202
+ export default withStyles(styles)(NumberTextField);
@@ -1,26 +1,22 @@
1
- import FormControlLabel from '@mui/material/FormControlLabel';
2
- import Radio from '@mui/material/Radio';
1
+ import FormControlLabel from '@material-ui/core/FormControlLabel';
2
+ import Radio from '@material-ui/core/Radio';
3
3
  import React from 'react';
4
- import { styled } from '@mui/material/styles';
4
+ import { withStyles } from '@material-ui/core/styles';
5
5
  import { color } from '@pie-lib/render-ui';
6
6
 
7
- const StyledFormControlLabel = styled(FormControlLabel)(() => ({
8
- '& .MuiFormControlLabel-label': {
7
+ export default withStyles({
8
+ label: {
9
9
  left: '-5px',
10
10
  position: 'relative',
11
11
  },
12
- }));
13
-
14
- const StyledRadio = styled(Radio)(() => ({
15
- color: `${color.tertiary()} !important`,
16
- }));
17
-
18
- const RadioWithLabel = ({ label, value, checked, onChange }) => (
19
- <StyledFormControlLabel
12
+ customColor: {
13
+ color: `${color.tertiary()} !important`,
14
+ },
15
+ })(({ label, value, checked, onChange, classes }) => (
16
+ <FormControlLabel
20
17
  value={value}
21
- control={<StyledRadio checked={checked} onChange={onChange} />}
18
+ classes={{ label: classes.label }}
19
+ control={<Radio className={classes.customColor} checked={checked} onChange={onChange} />}
22
20
  label={label}
23
21
  />
24
- );
25
-
26
- export default RadioWithLabel;
22
+ ));
@@ -1,23 +1,22 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import Typography from '@mui/material/Typography';
4
- import { styled } from '@mui/material/styles';
3
+ import Typography from '@material-ui/core/Typography';
4
+ import { withStyles } from '@material-ui/core/styles';
5
5
  import NumberTextField from '../number-text-field';
6
6
 
7
- const StyledDisplaySize = styled('div')(({ theme }) => ({
8
- display: 'flex',
9
- paddingTop: theme.spacing(1),
10
- }));
11
-
12
- const DisplaySize = ({ size, label, onChange }) => {
7
+ const DisplaySize = withStyles((theme) => ({
8
+ displaySize: {
9
+ display: 'flex',
10
+ paddingTop: theme.spacing.unit,
11
+ },
12
+ }))(({ size, label, classes, onChange }) => {
13
13
  const updateSize = (key, v) => {
14
14
  onChange({ ...size, [key]: v });
15
15
  };
16
-
17
16
  return (
18
17
  <div>
19
18
  <Typography>{label}</Typography>
20
- <StyledDisplaySize>
19
+ <div className={classes.displaySize}>
21
20
  <NumberTextField
22
21
  label="Width"
23
22
  type="number"
@@ -36,10 +35,10 @@ const DisplaySize = ({ size, label, onChange }) => {
36
35
  value={size.height}
37
36
  onChange={(e, v) => updateSize('height', v)}
38
37
  />
39
- </StyledDisplaySize>
38
+ </div>
40
39
  </div>
41
40
  );
42
- };
41
+ });
43
42
 
44
43
  DisplaySize.propTypes = {
45
44
  size: PropTypes.shape({