@pie-lib/config-ui 11.2.1 → 11.3.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 (49) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/checkbox.js +2 -2
  3. package/lib/checkbox.js.map +1 -1
  4. package/lib/choice-configuration/feedback-menu.js.map +1 -1
  5. package/lib/choice-configuration/index.js +5 -5
  6. package/lib/choice-configuration/index.js.map +1 -1
  7. package/lib/feedback-config/feedback-selector.js +5 -4
  8. package/lib/feedback-config/feedback-selector.js.map +1 -1
  9. package/lib/feedback-config/group.js +2 -2
  10. package/lib/feedback-config/group.js.map +1 -1
  11. package/lib/feedback-config/index.js.map +1 -1
  12. package/lib/help.js +7 -5
  13. package/lib/help.js.map +1 -1
  14. package/lib/inputs.js +11 -9
  15. package/lib/inputs.js.map +1 -1
  16. package/lib/langs.js.map +1 -1
  17. package/lib/layout/config-layout.js +17 -10
  18. package/lib/layout/config-layout.js.map +1 -1
  19. package/lib/layout/layout-contents.js +11 -7
  20. package/lib/layout/layout-contents.js.map +1 -1
  21. package/lib/layout/settings-box.js +3 -4
  22. package/lib/layout/settings-box.js.map +1 -1
  23. package/lib/settings/index.js.map +1 -1
  24. package/lib/settings/panel.js +49 -43
  25. package/lib/settings/panel.js.map +1 -1
  26. package/lib/settings/settings-radio-label.js +9 -7
  27. package/lib/settings/settings-radio-label.js.map +1 -1
  28. package/lib/settings/toggle.js +1 -1
  29. package/lib/settings/toggle.js.map +1 -1
  30. package/lib/tags-input/index.js +2 -2
  31. package/lib/tags-input/index.js.map +1 -1
  32. package/package.json +3 -3
  33. package/src/checkbox.jsx +2 -2
  34. package/src/choice-configuration/feedback-menu.jsx +0 -3
  35. package/src/choice-configuration/index.jsx +12 -5
  36. package/src/feedback-config/feedback-selector.jsx +8 -3
  37. package/src/feedback-config/group.jsx +3 -5
  38. package/src/feedback-config/index.jsx +6 -0
  39. package/src/help.jsx +6 -3
  40. package/src/inputs.jsx +5 -5
  41. package/src/langs.jsx +4 -0
  42. package/src/layout/config-layout.jsx +4 -1
  43. package/src/layout/layout-contents.jsx +6 -4
  44. package/src/layout/settings-box.jsx +3 -4
  45. package/src/settings/index.js +1 -0
  46. package/src/settings/panel.jsx +22 -21
  47. package/src/settings/settings-radio-label.jsx +3 -3
  48. package/src/settings/toggle.jsx +1 -1
  49. package/src/tags-input/index.jsx +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/config-ui",
3
- "version": "11.2.1",
3
+ "version": "11.3.0",
4
4
  "main": "lib/index.js",
5
5
  "module": "src/index.js",
6
6
  "publishConfig": {
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@material-ui/core": "^3.8.3",
12
12
  "@material-ui/icons": "^3.0.2",
13
- "@pie-lib/editable-html": "^9.4.0",
13
+ "@pie-lib/editable-html": "^9.5.0",
14
14
  "@pie-lib/icons": "^2.4.26",
15
15
  "@pie-lib/render-ui": "^4.13.7",
16
16
  "classnames": "^2.2.6",
@@ -26,5 +26,5 @@
26
26
  "peerDependencies": {
27
27
  "react": "^16.8.1"
28
28
  },
29
- "gitHead": "7f09c22d79137a0c566882c1079349830a0d9ed2"
29
+ "gitHead": "629368c10c78d61b6551df2b0f0a04ec56fdef99"
30
30
  }
package/src/checkbox.jsx CHANGED
@@ -40,7 +40,7 @@ Checkbox.defaultProps = {
40
40
 
41
41
  export default withStyles((theme) => ({
42
42
  label: {
43
- fontSize: '13px',
43
+ fontSize: theme.typography.fontSize - 1,
44
44
  transform: 'translate(-4%, 2%)',
45
45
  color: 'rgba(0,0,0,1.0)',
46
46
  },
@@ -53,7 +53,7 @@ export default withStyles((theme) => ({
53
53
  miniLabel: {
54
54
  marginLeft: theme.spacing.unit,
55
55
  color: grey[700],
56
- fontSize: '11px',
56
+ fontSize: theme.typography.fontSize - 3,
57
57
  },
58
58
  mini: {
59
59
  margin: 0,
@@ -30,7 +30,6 @@ export class IconMenu extends React.Component {
30
30
 
31
31
  render() {
32
32
  const { opts, onClick } = this.props;
33
-
34
33
  const keys = Object.keys(opts);
35
34
 
36
35
  const handleMenuClick = (key) => () => {
@@ -66,10 +65,8 @@ export default class FeedbackMenu extends React.Component {
66
65
 
67
66
  render() {
68
67
  const { value, onChange, classes } = this.props;
69
-
70
68
  const t = value && value.type;
71
69
  const iconColor = t === 'custom' || t === 'default' ? 'primary' : 'disabled';
72
-
73
70
  const tooltip = t === 'custom' ? 'Custom Feedback' : t === 'default' ? 'Default Feedback' : 'Feedback disabled';
74
71
 
75
72
  const icon = (
@@ -61,7 +61,7 @@ const EditableHtmlContainer = withStyles((theme) => ({
61
61
  },
62
62
  );
63
63
 
64
- const Feedback = withStyles(() => ({
64
+ const Feedback = withStyles((theme) => ({
65
65
  text: {
66
66
  width: '100%',
67
67
  },
@@ -69,7 +69,7 @@ const Feedback = withStyles(() => ({
69
69
  position: 'relative',
70
70
  },
71
71
  arrowIcon: {
72
- fill: '#ccc',
72
+ fill: theme.palette.grey[400],
73
73
  left: -56,
74
74
  position: 'absolute',
75
75
  top: 20,
@@ -146,6 +146,7 @@ export class ChoiceConfiguration extends React.Component {
146
146
 
147
147
  _changeFn = (key) => (update) => {
148
148
  const { data, onChange } = this.props;
149
+
149
150
  if (onChange) {
150
151
  onChange({ ...data, [key]: update });
151
152
  }
@@ -177,6 +178,7 @@ export class ChoiceConfiguration extends React.Component {
177
178
  onFeedbackTypeChange = (t) => {
178
179
  const { data, onChange } = this.props;
179
180
  const fb = { ...data.feedback, type: t };
181
+
180
182
  if (fb.type !== 'custom') {
181
183
  fb.value = undefined;
182
184
  }
@@ -210,6 +212,7 @@ export class ChoiceConfiguration extends React.Component {
210
212
 
211
213
  const InputToggle = mode === 'checkbox' ? InputCheckbox : InputRadio;
212
214
  const names = classNames(classes.choiceConfiguration, className);
215
+
213
216
  return (
214
217
  <div className={names}>
215
218
  <div className={classes.topRow}>
@@ -218,6 +221,7 @@ export class ChoiceConfiguration extends React.Component {
218
221
  {useLetterOrdering ? String.fromCharCode(96 + index).toUpperCase() : index}
219
222
  </span>
220
223
  )}
224
+
221
225
  <InputToggle
222
226
  className={classes.toggle}
223
227
  onChange={this.onCheckedChange}
@@ -225,6 +229,7 @@ export class ChoiceConfiguration extends React.Component {
225
229
  checked={!!data.correct}
226
230
  error={noCorrectAnswerError}
227
231
  />
232
+
228
233
  <div className={classes.middleColumn}>
229
234
  <EditableHtmlContainer
230
235
  label={!noLabels ? 'Label' : ''}
@@ -251,6 +256,7 @@ export class ChoiceConfiguration extends React.Component {
251
256
  />
252
257
  )}
253
258
  </div>
259
+
254
260
  {allowFeedBack && (
255
261
  <InputContainer className={classes.feedback} label={!noLabels ? 'Feedback' : ''}>
256
262
  <FeedbackMenu
@@ -262,6 +268,7 @@ export class ChoiceConfiguration extends React.Component {
262
268
  />
263
269
  </InputContainer>
264
270
  )}
271
+
265
272
  {allowDelete && (
266
273
  <InputContainer className={classes.delete} label={!noLabels ? 'Delete' : ''}>
267
274
  <IconButton aria-label="delete" className={classes.deleteIcon} onClick={onDelete}>
@@ -277,7 +284,7 @@ export class ChoiceConfiguration extends React.Component {
277
284
 
278
285
  const styles = (theme) => ({
279
286
  index: {
280
- padding: '24px 10px 0 0',
287
+ padding: '24px 8px 0 0',
281
288
  },
282
289
  choiceConfiguration: {},
283
290
  topRow: {
@@ -321,8 +328,8 @@ const styles = (theme) => ({
321
328
  flexDirection: 'column',
322
329
  },
323
330
  errorText: {
324
- fontSize: '12px',
325
- color: 'red',
331
+ fontSize: theme.typography.fontSize - 2,
332
+ color: theme.palette.error.main,
326
333
  },
327
334
  });
328
335
 
@@ -13,9 +13,10 @@ const feedbackLabels = {
13
13
 
14
14
  const holder = (theme, extras) => ({
15
15
  marginTop: '0px',
16
- background: '#e0dee0',
17
- padding: theme.spacing.unit * 0.9,
16
+ background: theme.palette.grey[300],
17
+ padding: theme.spacing.unit,
18
18
  marginBottom: theme.spacing.unit * 2,
19
+ borderRadius: '4px',
19
20
  ...extras,
20
21
  });
21
22
 
@@ -33,7 +34,7 @@ const style = (theme) => ({
33
34
  paddingBottom: 0,
34
35
  },
35
36
  customHolder: holder(theme, {
36
- background: '#e0dee0',
37
+ background: theme.palette.grey[400],
37
38
  padding: 0,
38
39
  }),
39
40
  defaultHolder: holder(theme, {
@@ -66,11 +67,13 @@ export class FeedbackSelector extends React.Component {
66
67
 
67
68
  changeType = (type) => {
68
69
  const { onChange, feedback } = this.props;
70
+
69
71
  onChange({ ...feedback, type });
70
72
  };
71
73
 
72
74
  changeCustom = (custom) => {
73
75
  const { onChange, feedback } = this.props;
76
+
74
77
  onChange({ ...feedback, type: 'custom', custom });
75
78
  };
76
79
 
@@ -95,6 +98,7 @@ export class FeedbackSelector extends React.Component {
95
98
  feedbackLabels={feedbackLabels}
96
99
  />
97
100
  </InputContainer>
101
+
98
102
  {feedback.type === 'custom' && (
99
103
  <div className={classes.customHolder}>
100
104
  <EditableHTML
@@ -106,6 +110,7 @@ export class FeedbackSelector extends React.Component {
106
110
  />
107
111
  </div>
108
112
  )}
113
+
109
114
  {feedback.type === 'default' && <div className={classes.defaultHolder}> {feedback.default}</div>}
110
115
  </div>
111
116
  );
@@ -4,9 +4,9 @@ import React from 'react';
4
4
  import { withStyles } from '@material-ui/core/styles';
5
5
  import classNames from 'classnames';
6
6
 
7
- const styles = () => ({
7
+ const styles = (theme) => ({
8
8
  radioLabel: {
9
- fontSize: '12px',
9
+ fontSize: theme.typography.fontSize - 2,
10
10
  },
11
11
  choice: {
12
12
  display: 'flex',
@@ -29,9 +29,7 @@ const Group = (props) => {
29
29
  <RadioWithLabel
30
30
  value={key}
31
31
  checked={value === key}
32
- classes={{
33
- label: classes.radioLabel,
34
- }}
32
+ classes={{ label: classes.radioLabel }}
35
33
  onChange={(e) => onChange(e.currentTarget.value)}
36
34
  label={feedbackLabels[key]}
37
35
  />
@@ -51,11 +51,14 @@ export class FeedbackConfig extends React.Component {
51
51
  onChange(key, config) {
52
52
  const { feedback, onChange } = this.props;
53
53
  const update = { ...feedback, [key]: config };
54
+
54
55
  onChange(update);
55
56
  }
56
57
 
57
58
  onCorrectChange = this.onChange.bind(this, 'correct');
59
+
58
60
  onIncorrectChange = this.onChange.bind(this, 'incorrect');
61
+
59
62
  onPartialChange = this.onChange.bind(this, 'partial');
60
63
 
61
64
  render() {
@@ -66,6 +69,7 @@ export class FeedbackConfig extends React.Component {
66
69
  <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
67
70
  <Typography className={classes.heading}>Feedback</Typography>
68
71
  </ExpansionPanelSummary>
72
+
69
73
  <ExpansionPanelDetails>
70
74
  <div className={classes.feedbackContainer}>
71
75
  <FeedbackSelector
@@ -74,6 +78,7 @@ export class FeedbackConfig extends React.Component {
74
78
  onChange={this.onCorrectChange}
75
79
  toolbarOpts={toolbarOpts}
76
80
  />
81
+
77
82
  {allowPartial && (
78
83
  <FeedbackSelector
79
84
  label="If partially correct, show"
@@ -82,6 +87,7 @@ export class FeedbackConfig extends React.Component {
82
87
  toolbarOpts={toolbarOpts}
83
88
  />
84
89
  )}
90
+
85
91
  <FeedbackSelector
86
92
  label="If incorrect, show"
87
93
  feedback={feedback.incorrect}
package/src/help.jsx CHANGED
@@ -21,18 +21,19 @@ const RawHelpButton = ({ onClick, classes }) => (
21
21
  <HelpIcon />
22
22
  </IconButton>
23
23
  );
24
+
24
25
  RawHelpButton.propTypes = {
25
26
  onClick: PropTypes.func,
26
27
  classes: PropTypes.object.isRequired,
27
28
  };
28
29
 
29
- export const HelpButton = withStyles({
30
+ export const HelpButton = withStyles((theme) => ({
30
31
  icon: {
31
32
  '&:hover': {
32
- color: '#ddd',
33
+ color: theme.palette.grey[300],
33
34
  },
34
35
  },
35
- })(RawHelpButton);
36
+ }))(RawHelpButton);
36
37
 
37
38
  export const HelpDialog = ({ open, onClose, children, title }) => (
38
39
  <Dialog open={open} onRequestClose={onClose}>
@@ -70,9 +71,11 @@ class Help extends React.Component {
70
71
 
71
72
  render() {
72
73
  const { children, title } = this.props;
74
+
73
75
  return (
74
76
  <div>
75
77
  <HelpButton color="accent" onClick={() => this.setState({ open: true })} />
78
+
76
79
  <HelpDialog open={this.state.open} title={title} onClose={() => this.setState({ open: false })}>
77
80
  {children}
78
81
  </HelpDialog>
package/src/inputs.jsx CHANGED
@@ -70,21 +70,21 @@ const RawInputRadio = (props) => {
70
70
 
71
71
  RawInputRadio.propTypes = { ...InputTypes };
72
72
 
73
- const InputCheckbox = withStyles({
73
+ const InputCheckbox = withStyles((theme) => ({
74
74
  checkboxRoot: {
75
75
  transform: 'translate(-25%, 20%)',
76
76
  },
77
77
  error: {
78
- color: 'red',
78
+ color: theme.palette.error.main,
79
79
  },
80
- })(RawInputCheckbox);
80
+ }))(RawInputCheckbox);
81
81
 
82
- const InputRadio = withStyles(() => ({
82
+ const InputRadio = withStyles((theme) => ({
83
83
  radioRoot: {
84
84
  transform: 'translate(-20%, 20%)',
85
85
  },
86
86
  error: {
87
- color: 'red',
87
+ color: theme.palette.error.main,
88
88
  },
89
89
  }))(RawInputRadio);
90
90
 
package/src/langs.jsx CHANGED
@@ -45,6 +45,7 @@ export class RawLangs extends React.Component {
45
45
 
46
46
  choose = (event) => {
47
47
  log('[choose] event: ', event);
48
+
48
49
  if (this.props.onChange) {
49
50
  this.props.onChange(event.target.value);
50
51
  }
@@ -52,13 +53,16 @@ export class RawLangs extends React.Component {
52
53
 
53
54
  render() {
54
55
  let { langs, selected, label, classes } = this.props;
56
+
55
57
  log('[render] selected:', selected);
58
+
56
59
  return (
57
60
  <div className={classes.root}>
58
61
  <FormControl className={classes.formControl}>
59
62
  <InputLabel className={classes.inputLabel} htmlFor={this.uid}>
60
63
  {label}
61
64
  </InputLabel>
65
+
62
66
  <Select value={selected} onChange={this.choose} input={<Input id={this.uid} />}>
63
67
  {langs.map((l, index) => (
64
68
  <MenuItem key={index} value={l}>
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import Measure from 'react-measure';
3
+ import { withContentRect } from 'react-measure';
3
4
  import PropTypes from 'prop-types';
4
5
  import LayoutContents from './layout-contents';
5
6
  import SettingsBox from './settings-box';
6
7
 
7
- class ConfigLayout extends React.Component {
8
+ class MeasuredConfigLayout extends React.Component {
8
9
  static propTypes = {
9
10
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.element), PropTypes.element]),
10
11
  className: PropTypes.string,
@@ -55,4 +56,6 @@ class ConfigLayout extends React.Component {
55
56
  }
56
57
  }
57
58
 
59
+ const ConfigLayout = withContentRect('bounds')(MeasuredConfigLayout);
60
+
58
61
  export default ConfigLayout;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { withStyles } from '@material-ui/core';
3
- import Tabs from '../tabs';
4
2
  import classnames from 'classnames';
5
3
  import PropTypes from 'prop-types';
4
+ import { withStyles } from '@material-ui/core';
5
+ import Tabs from '../tabs';
6
6
 
7
7
  class RawLayoutContents extends React.Component {
8
8
  static propTypes = {
@@ -65,7 +65,7 @@ class RawLayoutContents extends React.Component {
65
65
  {mode === 'inline' && (
66
66
  <div className={classnames(classes.flow, classes.contentContainer)}>
67
67
  <div className={classes.configContainer}>{children}</div>
68
- {hasSettingsPanel && <div>{secondary}</div>}
68
+ {hasSettingsPanel && <div className={classes.settingsContainer}>{secondary}</div>}
69
69
  </div>
70
70
  )}
71
71
 
@@ -97,7 +97,9 @@ const styles = (theme) => ({
97
97
  },
98
98
  configContainer: {
99
99
  flex: '1',
100
- marginRight: theme.spacing.unit * 2,
100
+ },
101
+ settingsContainer: {
102
+ marginLeft: theme.spacing.unit * 2,
101
103
  },
102
104
  });
103
105
 
@@ -18,17 +18,16 @@ export class SettingsBox extends React.Component {
18
18
  return <div className={classNames(classes.settingsBox, className)}>{children}</div>;
19
19
  }
20
20
  }
21
- const styles = () => ({
21
+ const styles = (theme) => ({
22
22
  settingsBox: {
23
- backgroundColor: '#FFF',
24
- border: '2px solid #EEE',
23
+ backgroundColor: theme.palette.background.paper,
24
+ border: `2px solid ${theme.palette.grey[200]}`,
25
25
  display: 'flex',
26
26
  flexDirection: 'column',
27
27
  justifyContent: 'flex-start',
28
28
  minWidth: '275px',
29
29
  maxWidth: '300px',
30
30
  padding: '20px 4px 4px 20px',
31
- width: '80%',
32
31
  zIndex: 99,
33
32
  },
34
33
  });
@@ -19,6 +19,7 @@ const toChoice = (opt) => {
19
19
  export const radio = function() {
20
20
  const args = Array.prototype.slice.call(arguments);
21
21
  const [label, choices, isConfigProperty = false] = args;
22
+
22
23
  return {
23
24
  type: 'radio',
24
25
  label,
@@ -61,10 +61,10 @@ const Radio = ({ classes, label, value, onChange, choices }) => {
61
61
 
62
62
  Radio.propTypes = { ...baseTypes, choices: PropTypes.arrayOf(PropTypes.shape(labelValue)) };
63
63
 
64
- const StyledRadio = withStyles({
64
+ const StyledRadio = withStyles((theme) => ({
65
65
  radioSettings: {
66
- marginTop: '4px',
67
- paddingBottom: '4px',
66
+ marginTop: theme.spacing.unit / 2,
67
+ paddingBottom: theme.spacing.unit / 2,
68
68
  width: '100%',
69
69
  '& > label': {
70
70
  color: 'rgba(0, 0, 0, 0.89)',
@@ -72,26 +72,26 @@ const StyledRadio = withStyles({
72
72
  fontSize: '14px',
73
73
  },
74
74
  '& > div': {
75
- marginTop: '20px',
75
+ marginTop: theme.spacing.unit * 2.5,
76
76
  },
77
77
  },
78
78
  label: {
79
79
  display: 'none',
80
80
  },
81
- })(Radio);
81
+ }))(Radio);
82
82
 
83
- const Dropdown = withStyles({
83
+ const Dropdown = withStyles((theme) => ({
84
84
  label: {
85
85
  margin: 0,
86
- fontSize: '14px',
86
+ fontSize: theme.typography.fontSize,
87
87
  },
88
88
  wrapper: {
89
- marginTop: '4px',
89
+ marginTop: theme.spacing.unit / 2,
90
90
  border: '2px solid lightgrey',
91
91
  borderRadius: '4px',
92
- padding: '0 8px',
92
+ padding: `0 ${theme.spacing.unit}px`,
93
93
  },
94
- })(({ classes, label, value, onChange, choices = [] }) => {
94
+ }))(({ classes, label, value, onChange, choices = [] }) => {
95
95
  return (
96
96
  <div>
97
97
  {label && <p className={classes.label}>{label}</p>}
@@ -114,19 +114,19 @@ const Dropdown = withStyles({
114
114
 
115
115
  Dropdown.propTypes = { ...baseTypes, choices: PropTypes.arrayOf(PropTypes.string) };
116
116
 
117
- const NumberField = withStyles({
117
+ const NumberField = withStyles((theme) => ({
118
118
  field: {
119
119
  width: '35%',
120
- marginRight: '24px',
121
- marginTop: '8px',
120
+ marginRight: theme.spacing.unit * 3,
121
+ marginTop: theme.spacing.unit,
122
122
  },
123
123
  wrapper: {
124
- marginTop: '4px',
124
+ marginTop: theme.spacing.unit / 2,
125
125
  border: '2px solid lightgrey',
126
126
  borderRadius: '4px',
127
- padding: '0 8px',
127
+ padding: `0 ${theme.spacing.unit}px`,
128
128
  },
129
- })(({ classes, label, value, onChange = () => {}, suffix, min, max }) => {
129
+ }))(({ classes, label, value, onChange = () => {}, suffix, min, max }) => {
130
130
  return (
131
131
  <NumberTextField
132
132
  label={label || 'Label'}
@@ -164,18 +164,18 @@ const tagMap = {
164
164
  checkbox: CheckboxChoice,
165
165
  };
166
166
 
167
- const Group = withStyles(() => ({
167
+ const Group = withStyles((theme) => ({
168
168
  group: {
169
- margin: '0 0 16px 0',
169
+ margin: `0 0 ${theme.spacing.unit * 2}px 0`,
170
170
  },
171
171
  groupHeader: {
172
172
  color: '#495B8F',
173
- fontSize: '16px',
173
+ fontSize: theme.typography.fontSize + 2,
174
174
  fontWeight: 600,
175
- marginBottom: '8px',
175
+ marginBottom: theme.spacing.unit,
176
176
  },
177
177
  numberFields: {
178
- fontSize: '0.85rem',
178
+ fontSize: theme.typography.fontSize,
179
179
  marginBottom: 0,
180
180
  },
181
181
  }))((props) => {
@@ -273,6 +273,7 @@ export class Panel extends React.Component {
273
273
 
274
274
  render() {
275
275
  const { groups, model, configuration } = this.props;
276
+
276
277
  log('render:', model);
277
278
 
278
279
  const renderedGroups = Object.keys(groups || {}).map((group) => {
@@ -3,14 +3,14 @@ import Radio from '@material-ui/core/Radio';
3
3
  import React from 'react';
4
4
  import { withStyles } from '@material-ui/core/styles';
5
5
 
6
- export default withStyles({
6
+ export default withStyles((theme) => ({
7
7
  label: {
8
8
  color: 'rgba(0, 0, 0, 0.89)',
9
- fontSize: '12px',
9
+ fontSize: theme.typography.fontSize - 2,
10
10
  left: '-5px',
11
11
  position: 'relative',
12
12
  },
13
- })(({ label, value, checked, onChange, classes }) => (
13
+ }))(({ label, value, checked, onChange, classes }) => (
14
14
  <FormControlLabel
15
15
  value={value}
16
16
  classes={classes}
@@ -12,7 +12,7 @@ const Toggle = withStyles((theme) => ({
12
12
  },
13
13
  label: {
14
14
  color: 'rgba(0, 0, 0, 0.89)',
15
- fontSize: '14px',
15
+ fontSize: theme.typography.fontSize,
16
16
  paddingTop: theme.spacing.unit * 2,
17
17
  },
18
18
  }))(({ checked, label, toggle, classes }) => (
@@ -95,7 +95,7 @@ export class TagsInput extends React.Component {
95
95
 
96
96
  const styles = (theme) => ({
97
97
  tagsInput: {
98
- border: 'solid 0px white',
98
+ border: `0px solid ${theme.palette.background.paper}`,
99
99
  display: 'flex',
100
100
  flexWrap: 'wrap',
101
101
  },
@@ -105,7 +105,7 @@ const styles = (theme) => ({
105
105
  minWidth: '30px',
106
106
  width: '100%',
107
107
  flex: '1',
108
- border: 'solid 0px white',
108
+ border: `0px solid ${theme.palette.background.paper}`,
109
109
  height: '28px',
110
110
  fontSize: theme.typography.fontSize,
111
111
  fontFamily: theme.typography.fontFamily,