@pie-lib/config-ui 11.26.6-esmbeta.0 → 11.27.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 (94) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/lib/alert-dialog.js +23 -42
  3. package/lib/alert-dialog.js.map +1 -1
  4. package/lib/checkbox.js +56 -71
  5. package/lib/checkbox.js.map +1 -1
  6. package/lib/choice-configuration/feedback-menu.js +24 -63
  7. package/lib/choice-configuration/feedback-menu.js.map +1 -1
  8. package/lib/choice-configuration/index.js +201 -257
  9. package/lib/choice-configuration/index.js.map +1 -1
  10. package/lib/choice-utils.js +6 -18
  11. package/lib/choice-utils.js.map +1 -1
  12. package/lib/feedback-config/feedback-selector.js +77 -114
  13. package/lib/feedback-config/feedback-selector.js.map +1 -1
  14. package/lib/feedback-config/group.js +26 -40
  15. package/lib/feedback-config/group.js.map +1 -1
  16. package/lib/feedback-config/index.js +38 -90
  17. package/lib/feedback-config/index.js.map +1 -1
  18. package/lib/form-section.js +24 -33
  19. package/lib/form-section.js.map +1 -1
  20. package/lib/help.js +39 -80
  21. package/lib/help.js.map +1 -1
  22. package/lib/index.js +1 -31
  23. package/lib/index.js.map +1 -1
  24. package/lib/input.js +21 -54
  25. package/lib/input.js.map +1 -1
  26. package/lib/inputs.js +61 -95
  27. package/lib/inputs.js.map +1 -1
  28. package/lib/langs.js +56 -100
  29. package/lib/langs.js.map +1 -1
  30. package/lib/layout/config-layout.js +30 -65
  31. package/lib/layout/config-layout.js.map +1 -1
  32. package/lib/layout/index.js +0 -3
  33. package/lib/layout/index.js.map +1 -1
  34. package/lib/layout/layout-contents.js +72 -101
  35. package/lib/layout/layout-contents.js.map +1 -1
  36. package/lib/layout/settings-box.js +27 -56
  37. package/lib/layout/settings-box.js.map +1 -1
  38. package/lib/mui-box/index.js +41 -57
  39. package/lib/mui-box/index.js.map +1 -1
  40. package/lib/number-text-field-custom.js +79 -161
  41. package/lib/number-text-field-custom.js.map +1 -1
  42. package/lib/number-text-field.js +57 -115
  43. package/lib/number-text-field.js.map +1 -1
  44. package/lib/radio-with-label.js +23 -31
  45. package/lib/radio-with-label.js.map +1 -1
  46. package/lib/settings/display-size.js +16 -32
  47. package/lib/settings/display-size.js.map +1 -1
  48. package/lib/settings/index.js +14 -47
  49. package/lib/settings/index.js.map +1 -1
  50. package/lib/settings/panel.js +142 -228
  51. package/lib/settings/panel.js.map +1 -1
  52. package/lib/settings/settings-radio-label.js +21 -30
  53. package/lib/settings/settings-radio-label.js.map +1 -1
  54. package/lib/settings/toggle.js +34 -46
  55. package/lib/settings/toggle.js.map +1 -1
  56. package/lib/tabs/index.js +22 -57
  57. package/lib/tabs/index.js.map +1 -1
  58. package/lib/tags-input/index.js +50 -99
  59. package/lib/tags-input/index.js.map +1 -1
  60. package/lib/two-choice.js +46 -90
  61. package/lib/two-choice.js.map +1 -1
  62. package/lib/with-stateful-model.js +8 -31
  63. package/lib/with-stateful-model.js.map +1 -1
  64. package/package.json +12 -17
  65. package/src/__tests__/number-text-field.test.jsx +1 -1
  66. package/src/alert-dialog.jsx +14 -18
  67. package/src/checkbox.jsx +42 -46
  68. package/src/choice-configuration/feedback-menu.jsx +5 -5
  69. package/src/choice-configuration/index.jsx +205 -193
  70. package/src/feedback-config/feedback-selector.jsx +51 -53
  71. package/src/feedback-config/group.jsx +21 -22
  72. package/src/feedback-config/index.jsx +27 -29
  73. package/src/form-section.jsx +18 -18
  74. package/src/help.jsx +20 -28
  75. package/src/input.jsx +1 -1
  76. package/src/inputs.jsx +34 -50
  77. package/src/langs.jsx +40 -46
  78. package/src/layout/config-layout.jsx +27 -23
  79. package/src/layout/layout-contents.jsx +34 -34
  80. package/src/layout/settings-box.jsx +16 -19
  81. package/src/mui-box/index.jsx +35 -43
  82. package/src/number-text-field-custom.jsx +30 -36
  83. package/src/number-text-field.jsx +22 -30
  84. package/src/radio-with-label.jsx +17 -13
  85. package/src/settings/display-size.jsx +12 -11
  86. package/src/settings/panel.jsx +83 -89
  87. package/src/settings/settings-radio-label.jsx +17 -13
  88. package/src/settings/toggle.jsx +29 -29
  89. package/src/tabs/index.jsx +8 -8
  90. package/src/tags-input/index.jsx +35 -38
  91. package/src/two-choice.jsx +15 -19
  92. package/esm/index.js +0 -78747
  93. package/esm/index.js.map +0 -1
  94. package/esm/package.json +0 -1
@@ -1,42 +1,42 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import RadioWithLabel from '../radio-with-label';
3
3
  import React from 'react';
4
- import { withStyles } from '@material-ui/core/styles';
5
- import classNames from 'classnames';
4
+ import { styled } from '@mui/material/styles';
6
5
 
7
- const styles = (theme) => ({
8
- radioLabel: {
6
+ const StyledChoiceHolder = styled('div')(() => ({
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ }));
10
+
11
+ const StyledChoice = styled('div')(() => ({
12
+ display: 'flex',
13
+ alignItems: 'center',
14
+ }));
15
+
16
+ const StyledRadioWithLabel = styled(RadioWithLabel)(({ theme }) => ({
17
+ '& .MuiFormControlLabel-label': {
9
18
  fontSize: theme.typography.fontSize - 2,
10
19
  },
11
- choice: {
12
- display: 'flex',
13
- alignItems: 'center',
14
- },
15
- choiceHolder: {
16
- display: 'flex',
17
- alignItems: 'center',
18
- },
19
- });
20
+ }));
20
21
 
21
22
  const Group = (props) => {
22
- const { feedbackLabels, value, classes, className, onChange, keys } = props;
23
+ const { feedbackLabels, value, className, onChange, keys } = props;
23
24
 
24
25
  return (
25
- <div className={classNames(classes.choiceHolder, className)}>
26
+ <StyledChoiceHolder className={className}>
26
27
  {keys.map((key) => {
27
28
  return (
28
- <div className={classes.choice} key={key}>
29
- <RadioWithLabel
29
+ <StyledChoice key={key}>
30
+ <StyledRadioWithLabel
30
31
  value={key}
31
32
  checked={value === key}
32
- classes={{ label: classes.radioLabel }}
33
33
  onChange={(e) => onChange(e.currentTarget.value)}
34
34
  label={feedbackLabels[key]}
35
35
  />
36
- </div>
36
+ </StyledChoice>
37
37
  );
38
38
  })}
39
- </div>
39
+ </StyledChoiceHolder>
40
40
  );
41
41
  };
42
42
 
@@ -44,9 +44,8 @@ Group.propTypes = {
44
44
  className: PropTypes.string,
45
45
  feedbackLabels: PropTypes.object.isRequired,
46
46
  value: PropTypes.string.isRequired,
47
- classes: PropTypes.object.isRequired,
48
47
  keys: PropTypes.arrayOf(PropTypes.string),
49
48
  onChange: PropTypes.func,
50
49
  };
51
50
 
52
- export default withStyles(styles)(Group);
51
+ export default Group;
@@ -1,27 +1,26 @@
1
1
  import FeedbackSelector, { FeedbackType } from './feedback-selector';
2
2
  import PropTypes from 'prop-types';
3
3
  import React from 'react';
4
- import { withStyles } from '@material-ui/core/styles';
5
- import ExpansionPanel from '@material-ui/core/ExpansionPanel';
6
- import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';
7
- import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';
8
- import Typography from '@material-ui/core/Typography';
9
- import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
4
+ import { styled } from '@mui/material/styles';
5
+ import Accordion from '@mui/material/Accordion';
6
+ import AccordionSummary from '@mui/material/AccordionSummary';
7
+ import AccordionDetails from '@mui/material/AccordionDetails';
8
+ import Typography from '@mui/material/Typography';
9
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
10
10
  import merge from 'lodash/merge';
11
11
 
12
12
  export { FeedbackSelector };
13
13
 
14
- const style = {
15
- feedbackContainer: {
16
- display: 'flex',
17
- flex: 1,
18
- flexDirection: 'column',
19
- },
20
- panelDetails: {
21
- paddingTop: 0,
22
- paddingBottom: 0,
23
- },
24
- };
14
+ const StyledFeedbackContainer = styled('div')(() => ({
15
+ display: 'flex',
16
+ flex: 1,
17
+ flexDirection: 'column',
18
+ }));
19
+
20
+ const StyledAccordionDetails = styled(AccordionDetails)(() => ({
21
+ paddingTop: 0,
22
+ paddingBottom: 0,
23
+ }));
25
24
 
26
25
  export const buildDefaults = (input) => {
27
26
  return merge(
@@ -45,7 +44,6 @@ export class FeedbackConfig extends React.Component {
45
44
  partial: PropTypes.shape(FeedbackType),
46
45
  }),
47
46
  onChange: PropTypes.func.isRequired,
48
- classes: PropTypes.object.isRequired,
49
47
  toolbarOpts: PropTypes.object,
50
48
  };
51
49
 
@@ -68,17 +66,17 @@ export class FeedbackConfig extends React.Component {
68
66
  onPartialChange = this.onChange.bind(this, 'partial');
69
67
 
70
68
  render() {
71
- const { classes, className, allowPartial, feedback, toolbarOpts } = this.props;
69
+ const { className, allowPartial, feedback, toolbarOpts } = this.props;
72
70
 
73
71
  return (
74
72
  <div className={className}>
75
- <ExpansionPanel>
76
- <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
77
- <Typography className={classes.heading}>Feedback</Typography>
78
- </ExpansionPanelSummary>
73
+ <Accordion>
74
+ <AccordionSummary expandIcon={<ExpandMoreIcon />}>
75
+ <Typography>Feedback</Typography>
76
+ </AccordionSummary>
79
77
 
80
- <ExpansionPanelDetails className={classes.panelDetails}>
81
- <div className={classes.feedbackContainer}>
78
+ <StyledAccordionDetails>
79
+ <StyledFeedbackContainer>
82
80
  <FeedbackSelector
83
81
  label="If correct, show"
84
82
  feedback={feedback.correct}
@@ -101,12 +99,12 @@ export class FeedbackConfig extends React.Component {
101
99
  onChange={this.onIncorrectChange}
102
100
  toolbarOpts={toolbarOpts}
103
101
  />
104
- </div>
105
- </ExpansionPanelDetails>
106
- </ExpansionPanel>
102
+ </StyledFeedbackContainer>
103
+ </StyledAccordionDetails>
104
+ </Accordion>
107
105
  </div>
108
106
  );
109
107
  }
110
108
  }
111
109
 
112
- export default withStyles(style)(FeedbackConfig);
110
+ export default FeedbackConfig;
@@ -1,23 +1,23 @@
1
1
  import React from 'react';
2
- import Typography from '@material-ui/core/Typography';
3
- import classNames from 'classnames';
4
- import { withStyles } from '@material-ui/core/styles';
2
+ import Typography from '@mui/material/Typography';
3
+ import { styled } from '@mui/material/styles';
5
4
 
6
- const styles = (theme) => ({
7
- formSection: {
8
- marginTop: theme.spacing.unit * 2,
9
- marginBottom: theme.spacing.unit * 2,
10
- },
11
- label: {
12
- marginBottom: theme.spacing.unit,
13
- },
14
- });
5
+ const StyledFormSection = styled('div')(({ theme }) => ({
6
+ marginTop: theme.spacing(2),
7
+ marginBottom: theme.spacing(2),
8
+ }));
15
9
 
16
- export default withStyles(styles)(({ className, classes, label, children, labelExtraStyle }) => (
17
- <div className={classNames(classes.formSection, className)}>
18
- <Typography className={classes.label} type="subheading" style={labelExtraStyle}>
10
+ const StyledTypography = styled(Typography)(({ theme }) => ({
11
+ marginBottom: theme.spacing(1),
12
+ }));
13
+
14
+ const FormSection = ({ className, label, children, labelExtraStyle }) => (
15
+ <StyledFormSection className={className}>
16
+ <StyledTypography variant="subtitle1" style={labelExtraStyle}>
19
17
  {label}
20
- </Typography>
18
+ </StyledTypography>
21
19
  {children}
22
- </div>
23
- ));
20
+ </StyledFormSection>
21
+ );
22
+
23
+ export default FormSection;
package/src/help.jsx CHANGED
@@ -1,42 +1,34 @@
1
- import Dialog from '@material-ui/core/Dialog';
2
- import DialogTitle from '@material-ui/core/DialogTitle';
3
- import DialogContentText from '@material-ui/core/DialogContentText';
4
- import DialogContent from '@material-ui/core/DialogContent';
5
- import DialogActions from '@material-ui/core/DialogActions';
1
+ import Dialog from '@mui/material/Dialog';
2
+ import DialogTitle from '@mui/material/DialogTitle';
3
+ import DialogContentText from '@mui/material/DialogContentText';
4
+ import DialogContent from '@mui/material/DialogContent';
5
+ import DialogActions from '@mui/material/DialogActions';
6
6
  import PropTypes from 'prop-types';
7
7
 
8
- import Button from '@material-ui/core/Button';
9
- import HelpIcon from '@material-ui/icons/Help';
10
- import IconButton from '@material-ui/core/IconButton';
8
+ import Button from '@mui/material/Button';
9
+ import HelpIcon from '@mui/icons-material/Help';
10
+ import IconButton from '@mui/material/IconButton';
11
11
  import React from 'react';
12
- import { withStyles } from '@material-ui/core/styles';
12
+ import { styled } from '@mui/material/styles';
13
13
 
14
- const RawHelpButton = ({ onClick, classes }) => (
15
- <IconButton
16
- classes={{
17
- label: classes.icon,
18
- }}
19
- onClick={onClick}
20
- >
14
+ const StyledIconButton = styled(IconButton)(({ theme }) => ({
15
+ '&:hover': {
16
+ color: theme.palette.grey[300],
17
+ },
18
+ }));
19
+
20
+ export const HelpButton = ({ onClick }) => (
21
+ <StyledIconButton onClick={onClick} size="large">
21
22
  <HelpIcon />
22
- </IconButton>
23
+ </StyledIconButton>
23
24
  );
24
25
 
25
- RawHelpButton.propTypes = {
26
+ HelpButton.propTypes = {
26
27
  onClick: PropTypes.func,
27
- classes: PropTypes.object.isRequired,
28
28
  };
29
29
 
30
- export const HelpButton = withStyles((theme) => ({
31
- icon: {
32
- '&:hover': {
33
- color: theme.palette.grey[300],
34
- },
35
- },
36
- }))(RawHelpButton);
37
-
38
30
  export const HelpDialog = ({ open, onClose, children, title }) => (
39
- <Dialog open={open} onRequestClose={onClose}>
31
+ <Dialog open={open} onClose={onClose}>
40
32
  <DialogTitle>{title}</DialogTitle>
41
33
  <DialogContent>
42
34
  <DialogContentText>{children}</DialogContentText>
package/src/input.jsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { default as MaterialInput } from '@material-ui/core/Input';
3
+ import { default as MaterialInput } from '@mui/material/Input';
4
4
  import { InputContainer } from '@pie-lib/render-ui';
5
5
 
6
6
  export default class Input extends React.Component {
package/src/inputs.jsx CHANGED
@@ -1,15 +1,13 @@
1
- import Checkbox from '@material-ui/core/Checkbox';
2
- import Radio from '@material-ui/core/Radio';
1
+ import Checkbox from '@mui/material/Checkbox';
2
+ import Radio from '@mui/material/Radio';
3
3
  import { InputContainer } from '@pie-lib/render-ui';
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
- import Switch from '@material-ui/core/Switch';
7
- import { withStyles } from '@material-ui/core/styles';
8
- import classNames from 'classnames';
6
+ import Switch from '@mui/material/Switch';
7
+ import { styled } from '@mui/material/styles';
9
8
  import { color } from '@pie-lib/render-ui';
10
9
 
11
10
  const InputTypes = {
12
- classes: PropTypes.object.isRequired,
13
11
  className: PropTypes.string,
14
12
  label: PropTypes.string,
15
13
  checked: PropTypes.bool,
@@ -18,81 +16,67 @@ const InputTypes = {
18
16
  error: PropTypes.string,
19
17
  };
20
18
 
21
- const RawInputSwitch = ({ classes, className, label, checked, onChange }) => {
19
+ const StyledSwitch = styled(Switch)(() => ({
20
+ justifyContent: 'inherit',
21
+ transform: 'translate(-20%, 20%)',
22
+ }));
23
+
24
+ const InputSwitch = ({ className, label, checked, onChange }) => {
22
25
  return (
23
26
  <InputContainer className={className} label={label}>
24
- <Switch className={classes.switchRoot} checked={checked} onChange={onChange} aria-label={label} />
27
+ <StyledSwitch checked={checked} onChange={onChange} aria-label={label} />
25
28
  </InputContainer>
26
29
  );
27
30
  };
28
31
 
29
- RawInputSwitch.propTypes = { ...InputTypes };
30
-
31
- const InputSwitch = withStyles({
32
- switchRoot: {
33
- justifyContent: 'inherit',
34
- transform: 'translate(-20%, 20%)',
35
- },
36
- })(RawInputSwitch);
32
+ InputSwitch.propTypes = { ...InputTypes };
37
33
 
38
- const RawInputCheckbox = (props) => {
39
- const { classes, className, label, checked, onChange, disabled, error } = props;
34
+ const StyledCheckbox = styled(Checkbox)(({ theme, error }) => ({
35
+ transform: 'translate(-25%, 20%)',
36
+ color: `${color.tertiary()} !important`,
37
+ ...(error && {
38
+ color: `${theme.palette.error.main} !important`,
39
+ }),
40
+ }));
40
41
 
42
+ const InputCheckbox = ({ className, label, checked, onChange, disabled, error }) => {
41
43
  return (
42
44
  <InputContainer className={className} label={label}>
43
- <Checkbox
44
- className={classNames(classes.checkboxRoot, classes.customColor, error && classes.error)}
45
+ <StyledCheckbox
45
46
  disabled={disabled}
46
47
  checked={checked}
47
48
  onChange={onChange}
48
49
  aria-label={label}
50
+ error={error}
49
51
  />
50
52
  </InputContainer>
51
53
  );
52
54
  };
53
55
 
54
- RawInputCheckbox.propTypes = { ...InputTypes };
56
+ InputCheckbox.propTypes = { ...InputTypes };
55
57
 
56
- const RawInputRadio = (props) => {
57
- const { classes, className, label, checked, onChange, disabled, error } = props;
58
+ const StyledRadio = styled(Radio)(({ theme, error }) => ({
59
+ transform: 'translate(-20%, 20%)',
60
+ color: `${color.tertiary()} !important`,
61
+ ...(error && {
62
+ color: `${theme.palette.error.main} !important`,
63
+ }),
64
+ }));
58
65
 
66
+ const InputRadio = ({ className, label, checked, onChange, disabled, error }) => {
59
67
  return (
60
68
  <InputContainer className={className} label={label}>
61
- <Radio
62
- className={classNames(classes.radioRoot, classes.customColor, error && classes.error)}
69
+ <StyledRadio
63
70
  disabled={disabled}
64
71
  checked={checked}
65
72
  onChange={onChange}
66
73
  aria-label={label}
74
+ error={error}
67
75
  />
68
76
  </InputContainer>
69
77
  );
70
78
  };
71
79
 
72
- RawInputRadio.propTypes = { ...InputTypes };
73
-
74
- const InputCheckbox = withStyles((theme) => ({
75
- checkboxRoot: {
76
- transform: 'translate(-25%, 20%)',
77
- },
78
- error: {
79
- color: theme.palette.error.main,
80
- },
81
- customColor: {
82
- color: `${color.tertiary()} !important`,
83
- },
84
- }))(RawInputCheckbox);
85
-
86
- const InputRadio = withStyles((theme) => ({
87
- radioRoot: {
88
- transform: 'translate(-20%, 20%)',
89
- },
90
- error: {
91
- color: theme.palette.error.main,
92
- },
93
- customColor: {
94
- color: `${color.tertiary()} !important`,
95
- },
96
- }))(RawInputRadio);
80
+ InputRadio.propTypes = { ...InputTypes };
97
81
 
98
82
  export { InputSwitch, InputCheckbox, InputRadio };
package/src/langs.jsx CHANGED
@@ -1,40 +1,38 @@
1
- import Input from '@material-ui/core/Input';
2
- import InputLabel from '@material-ui/core/InputLabel';
1
+ import Input from '@mui/material/Input';
2
+ import InputLabel from '@mui/material/InputLabel';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
- import classNames from 'classnames';
6
- import { withStyles } from '@material-ui/core/styles';
7
- import Select from '@material-ui/core/Select';
8
- import MenuItem from '@material-ui/core/MenuItem';
9
- import FormControl from '@material-ui/core/FormControl';
5
+ import { styled } from '@mui/material/styles';
6
+ import Select from '@mui/material/Select';
7
+ import MenuItem from '@mui/material/MenuItem';
8
+ import FormControl from '@mui/material/FormControl';
10
9
  import debug from 'debug';
11
10
 
12
11
  const log = debug('pie-elements:config-ui:langs');
13
12
 
14
- const styles = (theme) => ({
15
- root: {
16
- flexDirection: 'column',
17
- alignItems: 'start',
18
- display: 'flex',
19
- position: 'relative',
20
- paddingTop: '0px',
21
- paddingRight: '0px',
22
- },
23
- formControl: {
24
- position: 'initial',
25
- },
26
- inputLabel: {
27
- paddingBottom: theme.spacing.unit,
28
- },
29
- });
13
+ const StyledRoot = styled('div')(() => ({
14
+ flexDirection: 'column',
15
+ alignItems: 'start',
16
+ display: 'flex',
17
+ position: 'relative',
18
+ paddingTop: '0px',
19
+ paddingRight: '0px',
20
+ }));
30
21
 
31
- export class RawLangs extends React.Component {
22
+ const StyledFormControl = styled(FormControl)(() => ({
23
+ position: 'initial',
24
+ }));
25
+
26
+ const StyledInputLabel = styled(InputLabel)(({ theme }) => ({
27
+ paddingBottom: theme.spacing(1),
28
+ }));
29
+
30
+ export class Langs extends React.Component {
32
31
  static propTypes = {
33
32
  onChange: PropTypes.func,
34
33
  langs: PropTypes.array,
35
34
  selected: PropTypes.string,
36
35
  label: PropTypes.string,
37
- classes: PropTypes.object.isRequired,
38
36
  uid: PropTypes.string,
39
37
  };
40
38
 
@@ -52,16 +50,16 @@ export class RawLangs extends React.Component {
52
50
  };
53
51
 
54
52
  render() {
55
- let { langs, selected, label, classes } = this.props;
53
+ let { langs, selected, label } = this.props;
56
54
 
57
55
  log('[render] selected:', selected);
58
56
 
59
57
  return (
60
- <div className={classes.root}>
61
- <FormControl className={classes.formControl}>
62
- <InputLabel className={classes.inputLabel} htmlFor={this.uid}>
58
+ <StyledRoot>
59
+ <StyledFormControl>
60
+ <StyledInputLabel htmlFor={this.uid}>
63
61
  {label}
64
- </InputLabel>
62
+ </StyledInputLabel>
65
63
 
66
64
  <Select value={selected} onChange={this.choose} input={<Input id={this.uid} />}>
67
65
  {langs.map((l, index) => (
@@ -70,27 +68,23 @@ export class RawLangs extends React.Component {
70
68
  </MenuItem>
71
69
  ))}
72
70
  </Select>
73
- </FormControl>
74
- </div>
71
+ </StyledFormControl>
72
+ </StyledRoot>
75
73
  );
76
74
  }
77
75
  }
78
-
79
- const Langs = withStyles(styles, { name: 'Langs' })(RawLangs);
80
76
  export default Langs;
81
77
 
82
- export const LanguageControls = withStyles({
83
- languageControls: {
84
- display: 'grid',
85
- gridAutoFlow: 'column',
86
- gridAutoColumns: '1fr',
87
- gridGap: '8px',
88
- },
89
- })(({ classes, langs, activeLang, defaultLang, onActiveLangChange, onDefaultLangChange, className }) => {
90
- const names = classNames(classes.languageControls, className);
78
+ const StyledLanguageControls = styled('div')(() => ({
79
+ display: 'grid',
80
+ gridAutoFlow: 'column',
81
+ gridAutoColumns: '1fr',
82
+ gridGap: '8px',
83
+ }));
91
84
 
85
+ export const LanguageControls = ({ langs, activeLang, defaultLang, onActiveLangChange, onDefaultLangChange, className }) => {
92
86
  return (
93
- <div className={names}>
87
+ <StyledLanguageControls className={className}>
94
88
  <Langs
95
89
  label="Choose language to edit"
96
90
  langs={langs}
@@ -98,9 +92,9 @@ export const LanguageControls = withStyles({
98
92
  onChange={(l) => onActiveLangChange(l)}
99
93
  />
100
94
  <Langs label="Default language" langs={langs} selected={defaultLang} onChange={(l) => onDefaultLangChange(l)} />
101
- </div>
95
+ </StyledLanguageControls>
102
96
  );
103
- });
97
+ };
104
98
 
105
99
  LanguageControls.propTypes = {
106
100
  langs: PropTypes.array,
@@ -1,22 +1,23 @@
1
1
  import React from 'react';
2
2
  import Measure from 'react-measure';
3
+ import { createTheme, ThemeProvider, StyledEngineProvider } from '@mui/material/styles';
3
4
  import { withContentRect } from 'react-measure';
4
- import { withStyles } from '@material-ui/core/styles';
5
5
  import PropTypes from 'prop-types';
6
6
  import classNames from 'classnames';
7
7
  import LayoutContents from './layout-contents';
8
8
  import SettingsBox from './settings-box';
9
9
  import { AppendCSSRules } from '@pie-lib/render-ui';
10
10
 
11
- const styles = {
12
- extraCSSRules: {},
13
- };
11
+ const theme = createTheme({
12
+ typography: {
13
+ fontFamily: 'inherit',
14
+ },
15
+ });
14
16
 
15
17
  class MeasuredConfigLayout extends AppendCSSRules {
16
18
  static propTypes = {
17
19
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.element), PropTypes.element]),
18
20
  className: PropTypes.string,
19
- classes: PropTypes.object,
20
21
  dimensions: PropTypes.object,
21
22
  settings: PropTypes.element,
22
23
  sidePanelMinWidth: PropTypes.number,
@@ -47,29 +48,32 @@ class MeasuredConfigLayout extends AppendCSSRules {
47
48
 
48
49
  render() {
49
50
  return (
50
- <Measure bounds onResize={this.onResize}>
51
- {({ measureRef }) => {
52
- const { children, settings, hideSettings, dimensions, classes } = this.props;
53
- const { layoutMode } = this.state;
51
+ <StyledEngineProvider injectFirst>(<ThemeProvider theme={theme}>
52
+ <Measure bounds onResize={this.onResize}>
53
+ {({ measureRef }) => {
54
+ const { children, settings, hideSettings, dimensions } = this.props;
55
+ const { layoutMode } = this.state;
54
56
 
55
- const settingsPanel =
56
- layoutMode === 'inline' ? <SettingsBox className="settings-box">{settings}</SettingsBox> : settings;
57
- const secondaryContent = hideSettings ? null : settingsPanel;
58
- const finalClass = classNames('main-container', classes.extraCSSRules);
57
+ const settingsPanel =
58
+ layoutMode === 'inline' ? <SettingsBox className="settings-box">{settings}</SettingsBox> : settings;
59
+ const secondaryContent = hideSettings ? null : settingsPanel;
60
+ const finalClass = classNames('main-container');
59
61
 
60
- return (
61
- <div ref={measureRef} className={finalClass}>
62
- <LayoutContents mode={layoutMode} secondary={secondaryContent} dimensions={dimensions}>
63
- {children}
64
- </LayoutContents>
65
- </div>
66
- );
67
- }}
68
- </Measure>
62
+ return (
63
+ <div ref={measureRef} className={finalClass}>
64
+ <LayoutContents mode={layoutMode} secondary={secondaryContent} dimensions={dimensions}>
65
+ {children}
66
+ </LayoutContents>
67
+ </div>
68
+ );
69
+ }}
70
+ </Measure>
71
+ </ThemeProvider>)
72
+ </StyledEngineProvider>
69
73
  );
70
74
  }
71
75
  }
72
76
 
73
- const ConfigLayout = withStyles(styles)(withContentRect('bounds')(MeasuredConfigLayout));
77
+ const ConfigLayout = withContentRect('bounds')(MeasuredConfigLayout);
74
78
 
75
79
  export default ConfigLayout;