cozy-ui 130.10.0 → 130.11.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [130.11.0](https://github.com/cozy/cozy-ui/compare/v130.10.0...v130.11.0) (2025-10-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Checkbox:** Now `label` type also accept `node` in addition to `string` ([caf3de5](https://github.com/cozy/cozy-ui/commit/caf3de5))
7
+ * **Switch:** Adjust spacing to better deal with `start` label's position ([528834b](https://github.com/cozy/cozy-ui/commit/528834b))
8
+
9
+
10
+ ### Features
11
+
12
+ * **Checkbox:** Add `labelPlacement` prop ([24c884d](https://github.com/cozy/cozy-ui/commit/24c884d))
13
+
1
14
  # [130.10.0](https://github.com/cozy/cozy-ui/compare/v130.9.0...v130.10.0) (2025-10-16)
2
15
 
3
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "130.10.0",
3
+ "version": "130.11.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -3,49 +3,54 @@
3
3
  ```jsx
4
4
  import Checkbox from 'cozy-ui/transpiled/react/Checkbox'
5
5
  import Grid from 'cozy-ui/transpiled/react/Grid'
6
+ import Variants from 'cozy-ui/docs/components/Variants'
7
+
8
+ const initialVariants = [{ before: false }]
6
9
 
7
10
  ;
8
11
 
9
- <>
10
- <Grid container>
11
- <Grid item xs={6} sm={3}>
12
- <div><Checkbox label="Checkbox" /></div>
13
- <div><Checkbox label="Small Checked" size="small" /></div>
14
- <div><Checkbox label="Checked checkbox" checked /></div>
15
- <div><Checkbox label="Mixed checkbox" mixed /></div>
16
- <div><Checkbox label="Mixed checked checkbox" checked mixed /></div>
17
- <div><Checkbox label="No effect" disableEffect /></div>
18
- <div><Checkbox label="Small no effect" size="small" disableEffect /></div>
19
- </Grid>
20
- <Grid item xs={6} sm={3}>
21
- <div><Checkbox label="Disabled checkbox" disabled /></div>
22
- <div><Checkbox label="Small disabled checkbox" size="small" disabled /></div>
23
- <div><Checkbox label="Disabled checked checkbox" checked disabled /></div>
24
- <div><Checkbox label="Disabled mixed checkbox" mixed disabled /></div>
25
- <div><Checkbox label="Disabled mixed checked checkbox" checked mixed disabled /></div>
26
- <div><Checkbox label="Disabled no effect" disableEffect disabled /></div>
27
- <div><Checkbox label="Small disabled no effect" size="small" disableEffect disabled /></div>
28
- </Grid>
29
- <Grid item xs={6} sm={3}>
30
- <div><Checkbox label="Error checkbox" error /></div>
31
- <div><Checkbox label="Small error checkbox" size="small" error /></div>
32
- <div><Checkbox label="Error checked checkbox" error checked /></div>
33
- <div><Checkbox label="Error mixed checkbox" error mixed /></div>
34
- <div><Checkbox label="Error mixed checked checkbox" error checked mixed /></div>
35
- <div><Checkbox label="Error no effect" error disableEffect /></div>
36
- <div><Checkbox label="Small error no effect" size="small" error disableEffect /></div>
37
- </Grid>
38
- <Grid item xs={6} sm={3}>
39
- <div><Checkbox label="Error disabled checkbox" error disabled /></div>
40
- <div><Checkbox label="Small error disabled checkbox" size="small" error disabled /></div>
41
- <div><Checkbox label="Error disabled checked checkbox" error checked disabled /></div>
42
- <div><Checkbox label="Error disabled mixed checkbox" error mixed disabled /></div>
43
- <div><Checkbox label="Error disabled mixed checked checkbox" error checked mixed disabled /></div>
44
- <div><Checkbox label="Error disabled no effect" error disableEffect disabled /></div>
45
- <div><Checkbox label="Small error disabled no effect" size="small" error disableEffect disabled /></div>
12
+ <Variants initialVariants={initialVariants} screenshotAllVariants>
13
+ {variant => (
14
+ <Grid container>
15
+ <Grid item xs={6} sm={3}>
16
+ <div><Checkbox label="Checkbox" labelPlacement={variant.before ? "start" : "end"} /></div>
17
+ <div><Checkbox label="Small Checked" size="small" labelPlacement={variant.before ? "start" : "end"} /></div>
18
+ <div><Checkbox label="Checked checkbox" checked labelPlacement={variant.before ? "start" : "end"} /></div>
19
+ <div><Checkbox label="Mixed checkbox" mixed labelPlacement={variant.before ? "start" : "end"} /></div>
20
+ <div><Checkbox label="Mixed checked checkbox" checked mixed labelPlacement={variant.before ? "start" : "end"} /></div>
21
+ <div><Checkbox label="No effect" disableEffect labelPlacement={variant.before ? "start" : "end"} /></div>
22
+ <div><Checkbox label="Small no effect" size="small" disableEffect labelPlacement={variant.before ? "start" : "end"} /></div>
23
+ </Grid>
24
+ <Grid item xs={6} sm={3}>
25
+ <div><Checkbox label="Disabled checkbox" disabled labelPlacement={variant.before ? "start" : "end"} /></div>
26
+ <div><Checkbox label="Small disabled checkbox" size="small" disabled labelPlacement={variant.before ? "start" : "end"} /></div>
27
+ <div><Checkbox label="Disabled checked checkbox" checked disabled labelPlacement={variant.before ? "start" : "end"} /></div>
28
+ <div><Checkbox label="Disabled mixed checkbox" mixed disabled labelPlacement={variant.before ? "start" : "end"} /></div>
29
+ <div><Checkbox label="Disabled mixed checked checkbox" checked mixed disabled labelPlacement={variant.before ? "start" : "end"} /></div>
30
+ <div><Checkbox label="Disabled no effect" disableEffect disabled labelPlacement={variant.before ? "start" : "end"} /></div>
31
+ <div><Checkbox label="Small disabled no effect" size="small" disableEffect disabled labelPlacement={variant.before ? "start" : "end"} /></div>
32
+ </Grid>
33
+ <Grid item xs={6} sm={3}>
34
+ <div><Checkbox label="Error checkbox" error labelPlacement={variant.before ? "start" : "end"} /></div>
35
+ <div><Checkbox label="Small error checkbox" size="small" error labelPlacement={variant.before ? "start" : "end"} /></div>
36
+ <div><Checkbox label="Error checked checkbox" error checked labelPlacement={variant.before ? "start" : "end"} /></div>
37
+ <div><Checkbox label="Error mixed checkbox" error mixed labelPlacement={variant.before ? "start" : "end"} /></div>
38
+ <div><Checkbox label="Error mixed checked checkbox" error checked mixed labelPlacement={variant.before ? "start" : "end"} /></div>
39
+ <div><Checkbox label="Error no effect" error disableEffect labelPlacement={variant.before ? "start" : "end"} /></div>
40
+ <div><Checkbox label="Small error no effect" size="small" error disableEffect labelPlacement={variant.before ? "start" : "end"} /></div>
41
+ </Grid>
42
+ <Grid item xs={6} sm={3}>
43
+ <div><Checkbox label="Error disabled checkbox" error disabled labelPlacement={variant.before ? "start" : "end"} /></div>
44
+ <div><Checkbox label="Small error disabled checkbox" size="small" error disabled labelPlacement={variant.before ? "start" : "end"} /></div>
45
+ <div><Checkbox label="Error disabled checked checkbox" error checked disabled labelPlacement={variant.before ? "start" : "end"} /></div>
46
+ <div><Checkbox label="Error disabled mixed checkbox" error mixed disabled labelPlacement={variant.before ? "start" : "end"} /></div>
47
+ <div><Checkbox label="Error disabled mixed checked checkbox" error checked mixed disabled labelPlacement={variant.before ? "start" : "end"} /></div>
48
+ <div><Checkbox label="Error disabled no effect" error disableEffect disabled labelPlacement={variant.before ? "start" : "end"} /></div>
49
+ <div><Checkbox label="Small error disabled no effect" size="small" error disableEffect disabled labelPlacement={variant.before ? "start" : "end"} /></div>
50
+ </Grid>
46
51
  </Grid>
47
- </Grid>
48
- </>
52
+ )}
53
+ </Variants>
49
54
  ```
50
55
 
51
56
  ### Checkbox with complex children
@@ -52,7 +52,14 @@ const DefaultCheckbox = ({
52
52
  )
53
53
  }
54
54
 
55
- const Checkbox = ({ className, label, onChange, children, ...props }) => {
55
+ const Checkbox = ({
56
+ className,
57
+ label,
58
+ labelPlacement,
59
+ onChange,
60
+ children,
61
+ ...props
62
+ }) => {
56
63
  if (children) {
57
64
  logDepecratedCheckbox(
58
65
  '<Checkbox> used with children is deprecated, please use <Checkbox label={something} /> instead of <Checkbox>something</Checkbox>'
@@ -69,6 +76,7 @@ const Checkbox = ({ className, label, onChange, children, ...props }) => {
69
76
  className
70
77
  )}
71
78
  label={label || children}
79
+ labelPlacement={labelPlacement}
72
80
  control={<DefaultCheckbox {...props} label={label} />}
73
81
  onChange={onChange}
74
82
  />
@@ -93,7 +101,8 @@ Checkbox.propTypes = {
93
101
  mixed: PropTypes.bool,
94
102
  disableEffect: PropTypes.bool,
95
103
  size: PropTypes.oneOf(['small', 'medium']),
96
- label: PropTypes.string
104
+ labelPlacement: PropTypes.oneOf(['top', 'end', 'bottom', 'start']),
105
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
97
106
  }
98
107
 
99
108
  Checkbox.defaultProps = {
@@ -103,6 +112,7 @@ Checkbox.defaultProps = {
103
112
  mixed: false,
104
113
  disableEffect: false,
105
114
  size: 'medium',
115
+ labelPlacement: 'end',
106
116
  label: ''
107
117
  }
108
118
 
@@ -898,9 +898,10 @@ export const makeLightNormalOverrides = theme => ({
898
898
  },
899
899
  MuiSwitch: {
900
900
  root: {
901
- width: 50,
901
+ width: 56,
902
902
  height: 40,
903
- padding: '6px 1px'
903
+ padding: '6px 1px',
904
+ justifyContent: 'center'
904
905
  },
905
906
  checked: {
906
907
  '& + $track$track': {
@@ -910,6 +911,7 @@ export const makeLightNormalOverrides = theme => ({
910
911
  switchBase: {
911
912
  padding: 5,
912
913
  top: 5,
914
+ left: 5,
913
915
  color: theme.palette.text.icon,
914
916
  '& .cozySwitchThumb': {
915
917
  display: 'flex',
@@ -5,79 +5,80 @@ import Radio from 'cozy-ui/transpiled/react/Radios'
5
5
  import RadioGroup from 'cozy-ui/transpiled/react/RadioGroup'
6
6
  import FormControlLabel from 'cozy-ui/transpiled/react/FormControlLabel'
7
7
  import Variants from 'cozy-ui/docs/components/Variants'
8
- const Box = ({ children }) => {
9
- return <div style={{ height: '3rem', width: '3rem', border: '2px dashed #CCC', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
10
- { children }
11
- </div>
12
- }
13
8
 
14
9
  initialState = { radioValue: 'item1' }
15
10
 
16
- const initialVariants = [
17
- { checked: false, disabled: false, secondary: false }
18
- ]
11
+ const initialVariantsForScreenshots = [{ checked: false, disabled: false, secondary: false }]
12
+ const initialVariants = [{ before: false }]
19
13
 
20
14
  const handleChange = event => {
21
15
  setState({ radioValue: event.target.value })
22
16
  }
23
17
 
24
- const bboxStyle = { border: '1px solid red' }
25
-
26
18
  ;
27
19
 
28
20
  <>
29
- <RadioGroup
30
- aria-label="radio"
31
- name="radioName"
32
- value={state.radioValue.toString()}
33
- onChange={handleChange}
34
- >
35
- <FormControlLabel
36
- value="item1"
37
- label="This is a radio button"
38
- control={
39
- <Radio />
40
- }
41
- />
42
- <FormControlLabel
43
- value="item2"
44
- label="This is an intent radio button"
45
- control={
46
- <Radio color="secondary" />
47
- }
48
- />
49
- <FormControlLabel
50
- value="item3"
51
- label="This is a disabled radio button"
52
- control={
53
- <Radio disabled />
54
- }
55
- />
56
- <FormControlLabel
57
- value="item4"
58
- label="This is a checked disabled radio button"
59
- control={
60
- <Radio checked disabled />
61
- }
62
- />
63
- <FormControlLabel
64
- value="item5"
65
- label="This is a edge start radio button"
66
- control={
67
- <Radio edge="start" />
68
- }
69
- />
70
- <FormControlLabel
71
- value="item6"
72
- label="This is a edge end radio button"
73
- control={
74
- <Radio edge="end" />
75
- }
76
- />
77
- </RadioGroup>
78
-
21
+ <Variants initialVariants={initialVariants} screenshotAllVariants>
22
+ {variant => (
23
+ <RadioGroup
24
+ aria-label="radio"
25
+ name="radioName"
26
+ value={state.radioValue.toString()}
27
+ onChange={handleChange}
28
+ >
29
+ <FormControlLabel
30
+ value="item1"
31
+ label="This is a radio button"
32
+ labelPlacement={variant.before ? "start" : "end"}
33
+ control={
34
+ <Radio />
35
+ }
36
+ />
37
+ <FormControlLabel
38
+ value="item2"
39
+ label="This is an intent radio button"
40
+ labelPlacement={variant.before ? "start" : "end"}
41
+ control={
42
+ <Radio color="secondary" />
43
+ }
44
+ />
45
+ <FormControlLabel
46
+ value="item3"
47
+ label="This is a disabled radio button"
48
+ labelPlacement={variant.before ? "start" : "end"}
49
+ control={
50
+ <Radio disabled />
51
+ }
52
+ />
53
+ <FormControlLabel
54
+ value="item4"
55
+ label="This is a checked disabled radio button"
56
+ labelPlacement={variant.before ? "start" : "end"}
57
+ control={
58
+ <Radio checked disabled />
59
+ }
60
+ />
61
+ <FormControlLabel
62
+ value="item5"
63
+ label="This is a edge start radio button"
64
+ labelPlacement={variant.before ? "start" : "end"}
65
+ control={
66
+ <Radio edge="start" />
67
+ }
68
+ />
69
+ <FormControlLabel
70
+ value="item6"
71
+ label="This is a edge end radio button"
72
+ labelPlacement={variant.before ? "start" : "end"}
73
+ control={
74
+ <Radio edge="end" />
75
+ }
76
+ />
77
+ </RadioGroup>
78
+ )}
79
+ </Variants>
79
80
  {isTesting() && (
80
- <Variants initialVariants={initialVariants} screenshotAllVariants>
81
+ <Variants initialVariants={initialVariantsForScreenshots} screenshotAllVariants>
81
82
  {variant => (
82
83
  <Radio
83
84
  color={variant.secondary ? 'secondary' : 'primary'}
@@ -99,22 +100,13 @@ import Radio from 'cozy-ui/transpiled/react/Radios'
99
100
  import RadioGroup from 'cozy-ui/transpiled/react/RadioGroup'
100
101
  import FormControlLabel from 'cozy-ui/transpiled/react/FormControlLabel'
101
102
  import Variants from 'cozy-ui/docs/components/Variants'
103
+
102
104
  const Box = ({ children }) => {
103
105
  return <div style={{ height: '3rem', width: '3rem', border: '2px dashed #CCC', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
104
106
  { children }
105
107
  </div>
106
108
  }
107
109
 
108
- initialState = { radioValue: 'item1' }
109
-
110
- const initialVariants = [
111
- { checked: false, disabled: false, secondary: false }
112
- ]
113
-
114
- const handleChange = event => {
115
- setState({ radioValue: event.target.value })
116
- }
117
-
118
110
  const bboxStyle = { border: '1px solid red' }
119
111
 
120
112
  ;
@@ -6,14 +6,14 @@ import Switch from 'cozy-ui/transpiled/react/Switch'
6
6
  import Typography from "cozy-ui/transpiled/react/Typography"
7
7
  import Stack from "cozy-ui/transpiled/react/Stack"
8
8
  import Box from 'cozy-ui/transpiled/react/Box'
9
+ import Divider from 'cozy-ui/transpiled/react/Divider'
9
10
  import CheckIcon from 'cozy-ui/transpiled/react/Icons/Check'
10
11
  import FormControlLabel from 'cozy-ui/transpiled/react/FormControlLabel'
12
+ import FormGroup from 'cozy-ui/transpiled/react/FormGroup'
13
+ import Variants from 'cozy-ui/docs/components/Variants'
11
14
 
12
- initialState = {
13
- switch0: true,
14
- switch1: true,
15
- switch2: false
16
- }
15
+ initialState = { switch0: true, switch1: true, switch2: false }
16
+ const initialVariants = [{ before: false }]
17
17
 
18
18
  const StateSwitch = ({ id, color }) => {
19
19
  const [checked, setChecked] = useState(initialState[`switch${id}`])
@@ -28,47 +28,94 @@ const StateSwitch = ({ id, color }) => {
28
28
 
29
29
  ;
30
30
 
31
- <Stack spacing='xs'>
32
- {['primary', 'secondary', 'default'].map((color, i) => {
33
- return (
34
- <Box display='flex' alignItems='center' key={i}>
35
- <Typography variant='body1' display="inline">{ color }</Typography>
36
- <StateSwitch id={i} color={color} />
37
- </Box>
38
- )
39
- })}
40
- <FormControlLabel control={<Switch color="primary" />} label="With label" />
41
- <FormControlLabel control={<Switch color="primary" checked />} label="With label" />
42
- <br />
43
- <FormControlLabel control={<Switch color="primary" disabled />} label="Primary, disabled with label" />
44
- <FormControlLabel control={<Switch color="primary" checked disabled />} label="Primary, checked - disabled with label" />
45
- <br />
46
- <FormControlLabel
47
- label="Primary, disabled with label"
48
- control={
49
- <Switch
50
- color="primary"
51
- icon={CheckIcon}
52
- disabled
31
+ <Variants initialVariants={initialVariants} screenshotAllVariants>
32
+ {variant => (
33
+ <Stack spacing='xs'>
34
+ {['primary', 'secondary', 'default'].map((color, i) => {
35
+ return (
36
+ <Box display='flex' alignItems='center' key={i}>
37
+ <Typography display="inline">{`${color}:`}</Typography>
38
+ <StateSwitch id={i} color={color} />
39
+ </Box>
40
+ )
41
+ })}
42
+ <Divider className="u-mv-1" />
43
+ <Typography variant="h4">With labels</Typography>
44
+ <FormGroup row>
45
+ <FormControlLabel
46
+ control={<Switch color="primary" />}
47
+ label="With label"
48
+ labelPlacement={variant.before ? "start" : "end"}
49
+ />
50
+ <FormControlLabel
51
+ control={<Switch color="primary" checked />}
52
+ label="With label - checked"
53
+ labelPlacement={variant.before ? "start" : "end"}
54
+ />
55
+ </FormGroup>
56
+ <Typography className="u-mv-1" variant="h5">With disable</Typography>
57
+ <FormGroup row>
58
+ <FormControlLabel
59
+ control={<Switch color="primary" disabled />}
60
+ label="Primary"
61
+ labelPlacement={variant.before ? "start" : "end"}
53
62
  />
54
- }
55
- />
56
- <FormControlLabel
57
- label="Primary, checked - disabled with label"
58
- control={
59
- <Switch
60
- color="primary"
61
- icon={CheckIcon}
62
- checked
63
- disabled
63
+ <FormControlLabel
64
+ control={<Switch color="primary" checked disabled />}
65
+ label="Primary - checked"
66
+ labelPlacement={variant.before ? "start" : "end"}
64
67
  />
65
- }
66
- />
67
- <br />
68
- <FormControlLabel control={<Switch color="secondary" disabled />} label="Secondary, checked with label" />
69
- <FormControlLabel control={<Switch color="secondary" checked disabled />} label="Secondary, checked - disabled with label" />
70
- <br />
71
- <FormControlLabel control={<Switch disabled />} label="Default, checked with label" />
72
- <FormControlLabel control={<Switch checked disabled />} label="Default, checked - disabled with label" />
73
- </Stack>
68
+ </FormGroup>
69
+ <FormGroup row>
70
+ <FormControlLabel
71
+ label="Primary"
72
+ labelPlacement={variant.before ? "start" : "end"}
73
+ control={
74
+ <Switch
75
+ color="primary"
76
+ icon={CheckIcon}
77
+ disabled
78
+ />
79
+ }
80
+ />
81
+ <FormControlLabel
82
+ label="Primary - checked"
83
+ labelPlacement={variant.before ? "start" : "end"}
84
+ control={
85
+ <Switch
86
+ color="primary"
87
+ icon={CheckIcon}
88
+ checked
89
+ disabled
90
+ />
91
+ }
92
+ />
93
+ </FormGroup>
94
+ <FormGroup row>
95
+ <FormControlLabel
96
+ control={<Switch color="secondary" disabled />}
97
+ label="Secondary"
98
+ labelPlacement={variant.before ? "start" : "end"}
99
+ />
100
+ <FormControlLabel
101
+ control={<Switch color="secondary" checked disabled />}
102
+ label="Secondary - checked"
103
+ labelPlacement={variant.before ? "start" : "end"}
104
+ />
105
+ </FormGroup>
106
+ <FormGroup row>
107
+ <FormControlLabel
108
+ control={<Switch disabled />}
109
+ label="Default"
110
+ labelPlacement={variant.before ? "start" : "end"}
111
+ />
112
+ <FormControlLabel
113
+ control={<Switch checked disabled />}
114
+ label="Default - checked"
115
+ labelPlacement={variant.before ? "start" : "end"}
116
+ />
117
+ </FormGroup>
118
+ </Stack>
119
+ )}
120
+ </Variants>
74
121
  ```
@@ -1,8 +1,9 @@
1
1
  export default Checkbox;
2
- declare function Checkbox({ className, label, onChange, children, ...props }: {
2
+ declare function Checkbox({ className, label, labelPlacement, onChange, children, ...props }: {
3
3
  [x: string]: any;
4
4
  className: any;
5
5
  label: any;
6
+ labelPlacement: any;
6
7
  onChange: any;
7
8
  children: any;
8
9
  }): JSX.Element;
@@ -15,7 +16,8 @@ declare namespace Checkbox {
15
16
  const mixed: PropTypes.Requireable<boolean>;
16
17
  const disableEffect: PropTypes.Requireable<boolean>;
17
18
  const size: PropTypes.Requireable<string>;
18
- const label: PropTypes.Requireable<string>;
19
+ const labelPlacement: PropTypes.Requireable<string>;
20
+ const label: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
19
21
  }
20
22
  namespace defaultProps {
21
23
  const className_1: string;
@@ -30,6 +32,8 @@ declare namespace Checkbox {
30
32
  export { disableEffect_1 as disableEffect };
31
33
  const size_1: string;
32
34
  export { size_1 as size };
35
+ const labelPlacement_1: string;
36
+ export { labelPlacement_1 as labelPlacement };
33
37
  const label_1: string;
34
38
  export { label_1 as label };
35
39
  }
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["className", "label", "error", "mixed", "disabled", "size", "disableEffect"],
5
- _excluded2 = ["className", "label", "onChange", "children"];
5
+ _excluded2 = ["className", "label", "labelPlacement", "onChange", "children"];
6
6
  import MUICheckbox from '@material-ui/core/Checkbox';
7
7
  import FormControlLabel from '@material-ui/core/FormControlLabel';
8
8
  import cx from 'classnames';
@@ -53,6 +53,7 @@ var DefaultCheckbox = function DefaultCheckbox(_ref) {
53
53
  var Checkbox = function Checkbox(_ref2) {
54
54
  var className = _ref2.className,
55
55
  label = _ref2.label,
56
+ labelPlacement = _ref2.labelPlacement,
56
57
  onChange = _ref2.onChange,
57
58
  children = _ref2.children,
58
59
  props = _objectWithoutProperties(_ref2, _excluded2);
@@ -67,6 +68,7 @@ var Checkbox = function Checkbox(_ref2) {
67
68
  'FormControlLabel-error': props.error
68
69
  }, className),
69
70
  label: label || children,
71
+ labelPlacement: labelPlacement,
70
72
  control: /*#__PURE__*/React.createElement(DefaultCheckbox, _extends({}, props, {
71
73
  label: label
72
74
  })),
@@ -89,7 +91,8 @@ Checkbox.propTypes = {
89
91
  mixed: PropTypes.bool,
90
92
  disableEffect: PropTypes.bool,
91
93
  size: PropTypes.oneOf(['small', 'medium']),
92
- label: PropTypes.string
94
+ labelPlacement: PropTypes.oneOf(['top', 'end', 'bottom', 'start']),
95
+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
93
96
  };
94
97
  Checkbox.defaultProps = {
95
98
  className: '',
@@ -98,6 +101,7 @@ Checkbox.defaultProps = {
98
101
  mixed: false,
99
102
  disableEffect: false,
100
103
  size: 'medium',
104
+ labelPlacement: 'end',
101
105
  label: ''
102
106
  };
103
107
  export default Checkbox;
@@ -922,6 +922,7 @@ export function makeDarkInvertedOverrides(theme: any): {
922
922
  width: number;
923
923
  height: number;
924
924
  padding: string;
925
+ justifyContent: string;
925
926
  };
926
927
  checked: {
927
928
  '& + $track$track': {
@@ -931,6 +932,7 @@ export function makeDarkInvertedOverrides(theme: any): {
931
932
  switchBase: {
932
933
  padding: number;
933
934
  top: number;
935
+ left: number;
934
936
  color: any;
935
937
  '& .cozySwitchThumb': {
936
938
  display: string;
@@ -922,6 +922,7 @@ export function makeDarkNormalOverrides(theme: any): {
922
922
  width: number;
923
923
  height: number;
924
924
  padding: string;
925
+ justifyContent: string;
925
926
  };
926
927
  checked: {
927
928
  '& + $track$track': {
@@ -931,6 +932,7 @@ export function makeDarkNormalOverrides(theme: any): {
931
932
  switchBase: {
932
933
  padding: number;
933
934
  top: number;
935
+ left: number;
934
936
  color: any;
935
937
  '& .cozySwitchThumb': {
936
938
  display: string;
@@ -922,6 +922,7 @@ export function makeLightInvertedOverrides(theme: any): {
922
922
  width: number;
923
923
  height: number;
924
924
  padding: string;
925
+ justifyContent: string;
925
926
  };
926
927
  checked: {
927
928
  '& + $track$track': {
@@ -931,6 +932,7 @@ export function makeLightInvertedOverrides(theme: any): {
931
932
  switchBase: {
932
933
  padding: number;
933
934
  top: number;
935
+ left: number;
934
936
  color: any;
935
937
  '& .cozySwitchThumb': {
936
938
  display: string;
@@ -922,6 +922,7 @@ export function makeLightNormalOverrides(theme: any): {
922
922
  width: number;
923
923
  height: number;
924
924
  padding: string;
925
+ justifyContent: string;
925
926
  };
926
927
  checked: {
927
928
  '& + $track$track': {
@@ -931,6 +932,7 @@ export function makeLightNormalOverrides(theme: any): {
931
932
  switchBase: {
932
933
  padding: number;
933
934
  top: number;
935
+ left: number;
934
936
  color: any;
935
937
  '& .cozySwitchThumb': {
936
938
  display: string;
@@ -844,9 +844,10 @@ export var makeLightNormalOverrides = function makeLightNormalOverrides(theme) {
844
844
  },
845
845
  MuiSwitch: {
846
846
  root: {
847
- width: 50,
847
+ width: 56,
848
848
  height: 40,
849
- padding: '6px 1px'
849
+ padding: '6px 1px',
850
+ justifyContent: 'center'
850
851
  },
851
852
  checked: {
852
853
  '& + $track$track': {
@@ -856,6 +857,7 @@ export var makeLightNormalOverrides = function makeLightNormalOverrides(theme) {
856
857
  switchBase: {
857
858
  padding: 5,
858
859
  top: 5,
860
+ left: 5,
859
861
  color: theme.palette.text.icon,
860
862
  '& .cozySwitchThumb': {
861
863
  display: 'flex',