@mui/material 6.0.0-alpha.3 → 6.0.0-alpha.4

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 (75) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/Checkbox/Checkbox.js +51 -20
  3. package/FormHelperText/FormHelperText.js +18 -8
  4. package/IconButton/IconButton.js +97 -40
  5. package/ImageList/ImageList.js +16 -14
  6. package/ImageListItem/ImageListItem.js +37 -22
  7. package/ImageListItemBar/ImageListItemBar.js +65 -32
  8. package/ListItem/ListItem.js +94 -50
  9. package/ListItemAvatar/ListItemAvatar.js +12 -8
  10. package/ListItemButton/ListItemButton.js +35 -15
  11. package/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  12. package/ListItemText/ListItemText.js +20 -11
  13. package/ListSubheader/ListSubheader.js +44 -19
  14. package/Radio/Radio.js +50 -20
  15. package/Radio/RadioButtonIcon.js +18 -12
  16. package/Rating/Rating.js +71 -37
  17. package/Table/Table.js +11 -6
  18. package/TableCell/TableCell.js +96 -41
  19. package/TableSortLabel/TableSortLabel.js +19 -9
  20. package/Toolbar/Toolbar.js +33 -17
  21. package/Typography/Typography.js +3 -2
  22. package/index.js +1 -1
  23. package/modern/Checkbox/Checkbox.js +51 -20
  24. package/modern/FormHelperText/FormHelperText.js +18 -8
  25. package/modern/IconButton/IconButton.js +97 -40
  26. package/modern/ImageList/ImageList.js +16 -14
  27. package/modern/ImageListItem/ImageListItem.js +37 -22
  28. package/modern/ImageListItemBar/ImageListItemBar.js +65 -32
  29. package/modern/ListItem/ListItem.js +94 -50
  30. package/modern/ListItemAvatar/ListItemAvatar.js +12 -8
  31. package/modern/ListItemButton/ListItemButton.js +35 -15
  32. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  33. package/modern/ListItemText/ListItemText.js +20 -11
  34. package/modern/ListSubheader/ListSubheader.js +44 -19
  35. package/modern/Radio/Radio.js +50 -20
  36. package/modern/Radio/RadioButtonIcon.js +18 -12
  37. package/modern/Rating/Rating.js +71 -37
  38. package/modern/Table/Table.js +11 -6
  39. package/modern/TableCell/TableCell.js +96 -41
  40. package/modern/TableSortLabel/TableSortLabel.js +19 -9
  41. package/modern/Toolbar/Toolbar.js +33 -17
  42. package/modern/Typography/Typography.js +3 -2
  43. package/modern/index.js +1 -1
  44. package/modern/styles/experimental_extendTheme.js +2 -1
  45. package/modern/styles/getOverlayAlpha.js +3 -4
  46. package/node/Checkbox/Checkbox.js +54 -23
  47. package/node/FormHelperText/FormHelperText.js +18 -8
  48. package/node/IconButton/IconButton.js +99 -43
  49. package/node/ImageList/ImageList.js +16 -14
  50. package/node/ImageListItem/ImageListItem.js +37 -22
  51. package/node/ImageListItemBar/ImageListItemBar.js +65 -32
  52. package/node/ListItem/ListItem.js +94 -50
  53. package/node/ListItemAvatar/ListItemAvatar.js +12 -8
  54. package/node/ListItemButton/ListItemButton.js +35 -15
  55. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  56. package/node/ListItemText/ListItemText.js +20 -11
  57. package/node/ListSubheader/ListSubheader.js +44 -19
  58. package/node/Radio/Radio.js +52 -22
  59. package/node/Radio/RadioButtonIcon.js +21 -15
  60. package/node/Rating/Rating.js +71 -37
  61. package/node/Table/Table.js +11 -6
  62. package/node/TableCell/TableCell.js +96 -41
  63. package/node/TableSortLabel/TableSortLabel.js +19 -9
  64. package/node/Toolbar/Toolbar.js +33 -17
  65. package/node/Typography/Typography.js +3 -2
  66. package/node/index.js +1 -1
  67. package/node/styles/experimental_extendTheme.js +1 -0
  68. package/node/styles/getOverlayAlpha.js +4 -5
  69. package/package.json +4 -4
  70. package/styles/experimental_extendTheme.d.ts +2 -0
  71. package/styles/experimental_extendTheme.js +2 -1
  72. package/styles/getOverlayAlpha.d.ts +1 -2
  73. package/styles/getOverlayAlpha.js +3 -4
  74. package/umd/material-ui.development.js +1028 -533
  75. package/umd/material-ui.production.min.js +4 -4
package/Rating/Rating.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["value"],
6
6
  _excluded2 = ["className", "defaultValue", "disabled", "emptyIcon", "emptyLabelText", "getLabelText", "highlightSelectedOnly", "icon", "IconContainerComponent", "max", "name", "onChange", "onChangeActive", "onMouseLeave", "onMouseMove", "precision", "readOnly", "size", "value"];
7
7
  import * as React from 'react';
@@ -66,9 +66,8 @@ const RatingRoot = styled('span', {
66
66
  }, styles.root, styles[`size${capitalize(ownerState.size)}`], ownerState.readOnly && styles.readOnly];
67
67
  }
68
68
  })(({
69
- theme,
70
- ownerState
71
- }) => _extends({
69
+ theme
70
+ }) => ({
72
71
  display: 'inline-flex',
73
72
  // Required to position the pristine input absolutely
74
73
  position: 'relative',
@@ -85,13 +84,30 @@ const RatingRoot = styled('span', {
85
84
  [`&.${ratingClasses.focusVisible} .${ratingClasses.iconActive}`]: {
86
85
  outline: '1px solid #999'
87
86
  },
88
- [`& .${ratingClasses.visuallyHidden}`]: visuallyHidden
89
- }, ownerState.size === 'small' && {
90
- fontSize: theme.typography.pxToRem(18)
91
- }, ownerState.size === 'large' && {
92
- fontSize: theme.typography.pxToRem(30)
93
- }, ownerState.readOnly && {
94
- pointerEvents: 'none'
87
+ [`& .${ratingClasses.visuallyHidden}`]: visuallyHidden,
88
+ variants: [{
89
+ props: {
90
+ size: 'small'
91
+ },
92
+ style: {
93
+ fontSize: theme.typography.pxToRem(18)
94
+ }
95
+ }, {
96
+ props: {
97
+ size: 'large'
98
+ },
99
+ style: {
100
+ fontSize: theme.typography.pxToRem(30)
101
+ }
102
+ }, {
103
+ // TODO v6: use the .Mui-readOnly global state class
104
+ props: ({
105
+ ownerState
106
+ }) => ownerState.readOnly,
107
+ style: {
108
+ pointerEvents: 'none'
109
+ }
110
+ }]
95
111
  }));
96
112
  const RatingLabel = styled('label', {
97
113
  name: 'MuiRating',
@@ -99,17 +115,21 @@ const RatingLabel = styled('label', {
99
115
  overridesResolver: ({
100
116
  ownerState
101
117
  }, styles) => [styles.label, ownerState.emptyValueFocused && styles.labelEmptyValueActive]
102
- })(({
103
- ownerState
104
- }) => _extends({
105
- cursor: 'inherit'
106
- }, ownerState.emptyValueFocused && {
107
- top: 0,
108
- bottom: 0,
109
- position: 'absolute',
110
- outline: '1px solid #999',
111
- width: '100%'
112
- }));
118
+ })({
119
+ cursor: 'inherit',
120
+ variants: [{
121
+ props: ({
122
+ ownerState
123
+ }) => ownerState.emptyValueFocused,
124
+ style: {
125
+ top: 0,
126
+ bottom: 0,
127
+ position: 'absolute',
128
+ outline: '1px solid #999',
129
+ width: '100%'
130
+ }
131
+ }]
132
+ });
113
133
  const RatingIcon = styled('span', {
114
134
  name: 'MuiRating',
115
135
  slot: 'Icon',
@@ -120,9 +140,8 @@ const RatingIcon = styled('span', {
120
140
  return [styles.icon, ownerState.iconEmpty && styles.iconEmpty, ownerState.iconFilled && styles.iconFilled, ownerState.iconHover && styles.iconHover, ownerState.iconFocus && styles.iconFocus, ownerState.iconActive && styles.iconActive];
121
141
  }
122
142
  })(({
123
- theme,
124
- ownerState
125
- }) => _extends({
143
+ theme
144
+ }) => ({
126
145
  // Fit wrapper to actual icon size.
127
146
  display: 'flex',
128
147
  transition: theme.transitions.create('transform', {
@@ -130,11 +149,22 @@ const RatingIcon = styled('span', {
130
149
  }),
131
150
  // Fix mouseLeave issue.
132
151
  // https://github.com/facebook/react/issues/4492
133
- pointerEvents: 'none'
134
- }, ownerState.iconActive && {
135
- transform: 'scale(1.2)'
136
- }, ownerState.iconEmpty && {
137
- color: (theme.vars || theme).palette.action.disabled
152
+ pointerEvents: 'none',
153
+ variants: [{
154
+ props: ({
155
+ ownerState
156
+ }) => ownerState.iconActive,
157
+ style: {
158
+ transform: 'scale(1.2)'
159
+ }
160
+ }, {
161
+ props: ({
162
+ ownerState
163
+ }) => ownerState.iconEmpty,
164
+ style: {
165
+ color: (theme.vars || theme).palette.action.disabled
166
+ }
167
+ }]
138
168
  }));
139
169
  const RatingDecimal = styled('span', {
140
170
  name: 'MuiRating',
@@ -146,13 +176,17 @@ const RatingDecimal = styled('span', {
146
176
  } = props;
147
177
  return [styles.decimal, iconActive && styles.iconActive];
148
178
  }
149
- })(({
150
- iconActive
151
- }) => _extends({
152
- position: 'relative'
153
- }, iconActive && {
154
- transform: 'scale(1.2)'
155
- }));
179
+ })({
180
+ position: 'relative',
181
+ variants: [{
182
+ props: ({
183
+ iconActive
184
+ }) => iconActive,
185
+ style: {
186
+ transform: 'scale(1.2)'
187
+ }
188
+ }]
189
+ });
156
190
  function IconContainer(props) {
157
191
  const other = _objectWithoutPropertiesLoose(props, _excluded);
158
192
  return /*#__PURE__*/_jsx("span", _extends({}, other));
package/Table/Table.js CHANGED
@@ -32,9 +32,8 @@ const TableRoot = styled('table', {
32
32
  return [styles.root, ownerState.stickyHeader && styles.stickyHeader];
33
33
  }
34
34
  })(({
35
- theme,
36
- ownerState
37
- }) => _extends({
35
+ theme
36
+ }) => ({
38
37
  display: 'table',
39
38
  width: '100%',
40
39
  borderCollapse: 'collapse',
@@ -44,9 +43,15 @@ const TableRoot = styled('table', {
44
43
  color: (theme.vars || theme).palette.text.secondary,
45
44
  textAlign: 'left',
46
45
  captionSide: 'bottom'
47
- })
48
- }, ownerState.stickyHeader && {
49
- borderCollapse: 'separate'
46
+ }),
47
+ variants: [{
48
+ props: ({
49
+ ownerState
50
+ }) => ownerState.stickyHeader,
51
+ style: {
52
+ borderCollapse: 'separate'
53
+ }
54
+ }]
50
55
  }));
51
56
  const defaultComponent = 'table';
52
57
  const Table = /*#__PURE__*/React.forwardRef(function Table(inProps, ref) {
@@ -39,8 +39,7 @@ const TableCellRoot = styled('td', {
39
39
  return [styles.root, styles[ownerState.variant], styles[`size${capitalize(ownerState.size)}`], ownerState.padding !== 'normal' && styles[`padding${capitalize(ownerState.padding)}`], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.stickyHeader && styles.stickyHeader];
40
40
  }
41
41
  })(({
42
- theme,
43
- ownerState
42
+ theme
44
43
  }) => _extends({}, theme.typography.body2, {
45
44
  display: 'table-cell',
46
45
  verticalAlign: 'inherit',
@@ -49,47 +48,103 @@ const TableCellRoot = styled('td', {
49
48
  borderBottom: theme.vars ? `1px solid ${theme.vars.palette.TableCell.border}` : `1px solid
50
49
  ${theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)}`,
51
50
  textAlign: 'left',
52
- padding: 16
53
- }, ownerState.variant === 'head' && {
54
- color: (theme.vars || theme).palette.text.primary,
55
- lineHeight: theme.typography.pxToRem(24),
56
- fontWeight: theme.typography.fontWeightMedium
57
- }, ownerState.variant === 'body' && {
58
- color: (theme.vars || theme).palette.text.primary
59
- }, ownerState.variant === 'footer' && {
60
- color: (theme.vars || theme).palette.text.secondary,
61
- lineHeight: theme.typography.pxToRem(21),
62
- fontSize: theme.typography.pxToRem(12)
63
- }, ownerState.size === 'small' && {
64
- padding: '6px 16px',
65
- [`&.${tableCellClasses.paddingCheckbox}`]: {
66
- width: 24,
67
- // prevent the checkbox column from growing
68
- padding: '0 12px 0 16px',
69
- '& > *': {
51
+ padding: 16,
52
+ variants: [{
53
+ props: {
54
+ variant: 'head'
55
+ },
56
+ style: {
57
+ color: (theme.vars || theme).palette.text.primary,
58
+ lineHeight: theme.typography.pxToRem(24),
59
+ fontWeight: theme.typography.fontWeightMedium
60
+ }
61
+ }, {
62
+ props: {
63
+ variant: 'body'
64
+ },
65
+ style: {
66
+ color: (theme.vars || theme).palette.text.primary
67
+ }
68
+ }, {
69
+ props: {
70
+ variant: 'footer'
71
+ },
72
+ style: {
73
+ color: (theme.vars || theme).palette.text.secondary,
74
+ lineHeight: theme.typography.pxToRem(21),
75
+ fontSize: theme.typography.pxToRem(12)
76
+ }
77
+ }, {
78
+ props: {
79
+ size: 'small'
80
+ },
81
+ style: {
82
+ padding: '6px 16px',
83
+ [`&.${tableCellClasses.paddingCheckbox}`]: {
84
+ width: 24,
85
+ // prevent the checkbox column from growing
86
+ padding: '0 12px 0 16px',
87
+ '& > *': {
88
+ padding: 0
89
+ }
90
+ }
91
+ }
92
+ }, {
93
+ props: {
94
+ padding: 'checkbox'
95
+ },
96
+ style: {
97
+ width: 48,
98
+ // prevent the checkbox column from growing
99
+ padding: '0 0 0 4px'
100
+ }
101
+ }, {
102
+ props: {
103
+ padding: 'none'
104
+ },
105
+ style: {
70
106
  padding: 0
71
107
  }
72
- }
73
- }, ownerState.padding === 'checkbox' && {
74
- width: 48,
75
- // prevent the checkbox column from growing
76
- padding: '0 0 0 4px'
77
- }, ownerState.padding === 'none' && {
78
- padding: 0
79
- }, ownerState.align === 'left' && {
80
- textAlign: 'left'
81
- }, ownerState.align === 'center' && {
82
- textAlign: 'center'
83
- }, ownerState.align === 'right' && {
84
- textAlign: 'right',
85
- flexDirection: 'row-reverse'
86
- }, ownerState.align === 'justify' && {
87
- textAlign: 'justify'
88
- }, ownerState.stickyHeader && {
89
- position: 'sticky',
90
- top: 0,
91
- zIndex: 2,
92
- backgroundColor: (theme.vars || theme).palette.background.default
108
+ }, {
109
+ props: {
110
+ align: 'left'
111
+ },
112
+ style: {
113
+ textAlign: 'left'
114
+ }
115
+ }, {
116
+ props: {
117
+ align: 'center'
118
+ },
119
+ style: {
120
+ textAlign: 'center'
121
+ }
122
+ }, {
123
+ props: {
124
+ align: 'right'
125
+ },
126
+ style: {
127
+ textAlign: 'right',
128
+ flexDirection: 'row-reverse'
129
+ }
130
+ }, {
131
+ props: {
132
+ align: 'justify'
133
+ },
134
+ style: {
135
+ textAlign: 'justify'
136
+ }
137
+ }, {
138
+ props: ({
139
+ ownerState
140
+ }) => ownerState.stickyHeader,
141
+ style: {
142
+ position: 'sticky',
143
+ top: 0,
144
+ zIndex: 2,
145
+ backgroundColor: (theme.vars || theme).palette.background.default
146
+ }
147
+ }]
93
148
  }));
94
149
 
95
150
  /**
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["active", "children", "className", "direction", "hideSortIcon", "IconComponent"];
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
7
  import clsx from 'clsx';
@@ -70,9 +70,8 @@ const TableSortLabelIcon = styled('span', {
70
70
  return [styles.icon, styles[`iconDirection${capitalize(ownerState.direction)}`]];
71
71
  }
72
72
  })(({
73
- theme,
74
- ownerState
75
- }) => _extends({
73
+ theme
74
+ }) => ({
76
75
  fontSize: 18,
77
76
  marginRight: 4,
78
77
  marginLeft: 4,
@@ -80,11 +79,22 @@ const TableSortLabelIcon = styled('span', {
80
79
  transition: theme.transitions.create(['opacity', 'transform'], {
81
80
  duration: theme.transitions.duration.shorter
82
81
  }),
83
- userSelect: 'none'
84
- }, ownerState.direction === 'desc' && {
85
- transform: 'rotate(0deg)'
86
- }, ownerState.direction === 'asc' && {
87
- transform: 'rotate(180deg)'
82
+ userSelect: 'none',
83
+ variants: [{
84
+ props: {
85
+ direction: 'desc'
86
+ },
87
+ style: {
88
+ transform: 'rotate(0deg)'
89
+ }
90
+ }, {
91
+ props: {
92
+ direction: 'asc'
93
+ },
94
+ style: {
95
+ transform: 'rotate(180deg)'
96
+ }
97
+ }]
88
98
  }));
89
99
 
90
100
  /**
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["className", "component", "disableGutters", "variant"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
@@ -32,25 +32,41 @@ const ToolbarRoot = styled('div', {
32
32
  return [styles.root, !ownerState.disableGutters && styles.gutters, styles[ownerState.variant]];
33
33
  }
34
34
  })(({
35
- theme,
36
- ownerState
37
- }) => _extends({
35
+ theme
36
+ }) => ({
38
37
  position: 'relative',
39
38
  display: 'flex',
40
- alignItems: 'center'
41
- }, !ownerState.disableGutters && {
42
- paddingLeft: theme.spacing(2),
43
- paddingRight: theme.spacing(2),
44
- [theme.breakpoints.up('sm')]: {
45
- paddingLeft: theme.spacing(3),
46
- paddingRight: theme.spacing(3)
47
- }
48
- }, ownerState.variant === 'dense' && {
49
- minHeight: 48
39
+ alignItems: 'center',
40
+ variants: [{
41
+ props: ({
42
+ ownerState
43
+ }) => !ownerState.disableGutters,
44
+ style: {
45
+ paddingLeft: theme.spacing(2),
46
+ paddingRight: theme.spacing(2),
47
+ [theme.breakpoints.up('sm')]: {
48
+ paddingLeft: theme.spacing(3),
49
+ paddingRight: theme.spacing(3)
50
+ }
51
+ }
52
+ }, {
53
+ props: {
54
+ variant: 'dense'
55
+ },
56
+ style: {
57
+ minHeight: 48
58
+ }
59
+ }]
50
60
  }), ({
51
- theme,
52
- ownerState
53
- }) => ownerState.variant === 'regular' && theme.mixins.toolbar);
61
+ theme
62
+ }) => ({
63
+ variants: [{
64
+ props: {
65
+ variant: 'regular'
66
+ },
67
+ style: theme.mixins.toolbar
68
+ }]
69
+ }));
54
70
  const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
55
71
  const props = useThemeProps({
56
72
  props: inProps,
@@ -118,9 +118,10 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
118
118
  return /*#__PURE__*/_jsx(TypographyRoot, _extends({
119
119
  as: Component,
120
120
  ref: ref,
121
- ownerState: ownerState,
122
121
  className: clsx(classes.root, className)
123
- }, other));
122
+ }, other, {
123
+ ownerState: ownerState
124
+ }));
124
125
  });
125
126
  process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes */ = {
126
127
  // ┌────────────────────────────── Warning ──────────────────────────────┐
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-alpha.3
2
+ * @mui/material v6.0.0-alpha.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -14,10 +14,11 @@ import CheckBoxOutlineBlankIcon from '../internal/svg-icons/CheckBoxOutlineBlank
14
14
  import CheckBoxIcon from '../internal/svg-icons/CheckBox';
15
15
  import IndeterminateCheckBoxIcon from '../internal/svg-icons/IndeterminateCheckBox';
16
16
  import capitalize from '../utils/capitalize';
17
- import useThemeProps from '../styles/useThemeProps';
18
- import styled, { rootShouldForwardProp } from '../styles/styled';
17
+ import rootShouldForwardProp from '../styles/rootShouldForwardProp';
19
18
  import checkboxClasses, { getCheckboxUtilityClass } from './checkboxClasses';
19
+ import { createUseThemeProps, styled } from '../zero-styled';
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
+ const useThemeProps = createUseThemeProps('MuiCheckbox');
21
22
  const useUtilityClasses = ownerState => {
22
23
  const {
23
24
  classes,
@@ -42,25 +43,55 @@ const CheckboxRoot = styled(SwitchBase, {
42
43
  return [styles.root, ownerState.indeterminate && styles.indeterminate, styles[`size${capitalize(ownerState.size)}`], ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`]];
43
44
  }
44
45
  })(({
45
- theme,
46
- ownerState
47
- }) => _extends({
48
- color: (theme.vars || theme).palette.text.secondary
49
- }, !ownerState.disableRipple && {
50
- '&:hover': {
51
- backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
52
- // Reset on touch devices, it doesn't add specificity
53
- '@media (hover: none)': {
54
- backgroundColor: 'transparent'
46
+ theme
47
+ }) => ({
48
+ color: (theme.vars || theme).palette.text.secondary,
49
+ variants: [{
50
+ props: {
51
+ color: 'default',
52
+ disableRipple: false
53
+ },
54
+ style: {
55
+ '&:hover': {
56
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)
57
+ }
55
58
  }
56
- }
57
- }, ownerState.color !== 'default' && {
58
- [`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]: {
59
- color: (theme.vars || theme).palette[ownerState.color].main
60
- },
61
- [`&.${checkboxClasses.disabled}`]: {
62
- color: (theme.vars || theme).palette.action.disabled
63
- }
59
+ }, ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
60
+ props: {
61
+ color,
62
+ disableRipple: false
63
+ },
64
+ style: {
65
+ '&:hover': {
66
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
67
+ }
68
+ }
69
+ })), ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
70
+ props: {
71
+ color
72
+ },
73
+ style: {
74
+ [`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]: {
75
+ color: (theme.vars || theme).palette[color].main
76
+ },
77
+ [`&.${checkboxClasses.disabled}`]: {
78
+ color: (theme.vars || theme).palette.action.disabled
79
+ }
80
+ }
81
+ })), {
82
+ // Should be last to override other colors
83
+ props: {
84
+ disableRipple: false
85
+ },
86
+ style: {
87
+ // Reset on touch devices, it doesn't add specificity
88
+ '&:hover': {
89
+ '@media (hover: none)': {
90
+ backgroundColor: 'transparent'
91
+ }
92
+ }
93
+ }
94
+ }]
64
95
  }));
65
96
  const defaultCheckedIcon = /*#__PURE__*/_jsx(CheckBoxIcon, {});
66
97
  const defaultIcon = /*#__PURE__*/_jsx(CheckBoxOutlineBlankIcon, {});
@@ -41,8 +41,7 @@ const FormHelperTextRoot = styled('p', {
41
41
  return [styles.root, ownerState.size && styles[`size${capitalize(ownerState.size)}`], ownerState.contained && styles.contained, ownerState.filled && styles.filled];
42
42
  }
43
43
  })(({
44
- theme,
45
- ownerState
44
+ theme
46
45
  }) => _extends({
47
46
  color: (theme.vars || theme).palette.text.secondary
48
47
  }, theme.typography.caption, {
@@ -56,12 +55,23 @@ const FormHelperTextRoot = styled('p', {
56
55
  },
57
56
  [`&.${formHelperTextClasses.error}`]: {
58
57
  color: (theme.vars || theme).palette.error.main
59
- }
60
- }, ownerState.size === 'small' && {
61
- marginTop: 4
62
- }, ownerState.contained && {
63
- marginLeft: 14,
64
- marginRight: 14
58
+ },
59
+ variants: [{
60
+ props: {
61
+ size: 'small'
62
+ },
63
+ style: {
64
+ marginTop: 4
65
+ }
66
+ }, {
67
+ props: ({
68
+ ownerState
69
+ }) => ownerState.contained,
70
+ style: {
71
+ marginLeft: 14,
72
+ marginRight: 14
73
+ }
74
+ }]
65
75
  }));
66
76
  const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inProps, ref) {
67
77
  const props = useThemeProps({