@mui/material 5.15.13 → 5.15.14

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/Accordion/Accordion.js +30 -23
  2. package/AccordionActions/AccordionActions.js +14 -12
  3. package/AccordionDetails/AccordionDetails.js +2 -2
  4. package/AccordionSummary/AccordionSummary.js +29 -23
  5. package/Autocomplete/Autocomplete.d.ts +1 -1
  6. package/Autocomplete/Autocomplete.js +59 -33
  7. package/Autocomplete/autocompleteClasses.d.ts +3 -3
  8. package/CHANGELOG.md +116 -60
  9. package/CircularProgress/CircularProgress.d.ts +1 -1
  10. package/CircularProgress/CircularProgress.js +1 -1
  11. package/Icon/Icon.d.ts +1 -1
  12. package/Icon/Icon.js +1 -1
  13. package/OverridableComponent.d.ts +1 -1
  14. package/Popper/Popper.d.ts +3 -26
  15. package/README.md +2 -2
  16. package/Select/Select.d.ts +8 -20
  17. package/Slider/Slider.js +404 -223
  18. package/SvgIcon/SvgIcon.js +1 -1
  19. package/index.js +1 -1
  20. package/legacy/Accordion/Accordion.js +33 -22
  21. package/legacy/AccordionActions/AccordionActions.js +17 -14
  22. package/legacy/AccordionDetails/AccordionDetails.js +2 -2
  23. package/legacy/AccordionSummary/AccordionSummary.js +31 -22
  24. package/legacy/Autocomplete/Autocomplete.js +132 -113
  25. package/legacy/CircularProgress/CircularProgress.js +1 -1
  26. package/legacy/Icon/Icon.js +1 -1
  27. package/legacy/Slider/Slider.js +373 -191
  28. package/legacy/SvgIcon/SvgIcon.js +1 -1
  29. package/legacy/index.js +1 -1
  30. package/legacy/styles/experimental_extendTheme.js +1 -1
  31. package/legacy/styles/rootShouldForwardProp.js +5 -0
  32. package/legacy/styles/slotShouldForwardProp.js +5 -0
  33. package/legacy/styles/styled.js +4 -5
  34. package/legacy/usePagination/usePagination.js +1 -1
  35. package/modern/Accordion/Accordion.js +30 -23
  36. package/modern/AccordionActions/AccordionActions.js +14 -12
  37. package/modern/AccordionDetails/AccordionDetails.js +2 -2
  38. package/modern/AccordionSummary/AccordionSummary.js +29 -23
  39. package/modern/Autocomplete/Autocomplete.js +59 -33
  40. package/modern/CircularProgress/CircularProgress.js +1 -1
  41. package/modern/Icon/Icon.js +1 -1
  42. package/modern/Slider/Slider.js +337 -172
  43. package/modern/SvgIcon/SvgIcon.js +1 -1
  44. package/modern/index.js +1 -1
  45. package/modern/styles/experimental_extendTheme.js +1 -1
  46. package/modern/styles/rootShouldForwardProp.js +3 -0
  47. package/modern/styles/slotShouldForwardProp.js +5 -0
  48. package/modern/styles/styled.js +4 -3
  49. package/modern/usePagination/usePagination.js +1 -1
  50. package/node/Accordion/Accordion.js +32 -25
  51. package/node/AccordionActions/AccordionActions.js +16 -14
  52. package/node/AccordionDetails/AccordionDetails.js +4 -4
  53. package/node/AccordionSummary/AccordionSummary.js +33 -27
  54. package/node/Autocomplete/Autocomplete.js +71 -45
  55. package/node/CircularProgress/CircularProgress.js +1 -1
  56. package/node/Icon/Icon.js +1 -1
  57. package/node/Slider/Slider.js +414 -233
  58. package/node/SvgIcon/SvgIcon.js +1 -1
  59. package/node/index.js +1 -1
  60. package/node/styles/experimental_extendTheme.js +1 -1
  61. package/node/styles/rootShouldForwardProp.js +10 -0
  62. package/node/styles/slotShouldForwardProp.js +11 -0
  63. package/node/styles/styled.js +17 -8
  64. package/node/usePagination/usePagination.js +1 -1
  65. package/package.json +6 -6
  66. package/styles/experimental_extendTheme.js +1 -1
  67. package/styles/rootShouldForwardProp.d.ts +2 -0
  68. package/styles/rootShouldForwardProp.js +3 -0
  69. package/styles/slotShouldForwardProp.d.ts +2 -0
  70. package/styles/slotShouldForwardProp.js +5 -0
  71. package/styles/styled.d.ts +2 -3
  72. package/styles/styled.js +4 -3
  73. package/umd/material-ui.development.js +822 -582
  74. package/umd/material-ui.production.min.js +2 -2
  75. package/usePagination/usePagination.js +1 -1
@@ -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 = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"];
6
6
  import * as React from 'react';
7
7
  import { isFragment } from 'react-is';
@@ -9,8 +9,7 @@ import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
10
10
  import chainPropTypes from '@mui/utils/chainPropTypes';
11
11
  import composeClasses from '@mui/utils/composeClasses';
12
- import styled from '../styles/styled';
13
- import useThemeProps from '../styles/useThemeProps';
12
+ import { styled, createUseThemeProps } from '../zero-styled';
14
13
  import Collapse from '../Collapse';
15
14
  import Paper from '../Paper';
16
15
  import AccordionContext from './AccordionContext';
@@ -19,6 +18,7 @@ import useSlot from '../utils/useSlot';
19
18
  import accordionClasses, { getAccordionUtilityClass } from './accordionClasses';
20
19
  import { jsx as _jsx } from "react/jsx-runtime";
21
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ const useThemeProps = createUseThemeProps('MuiAccordion');
22
22
  const useUtilityClasses = ownerState => {
23
23
  const {
24
24
  classes,
@@ -92,27 +92,34 @@ const AccordionRoot = styled(Paper, {
92
92
  }
93
93
  };
94
94
  }, ({
95
- theme,
96
- ownerState
97
- }) => _extends({}, !ownerState.square && {
98
- borderRadius: 0,
99
- '&:first-of-type': {
100
- borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
101
- borderTopRightRadius: (theme.vars || theme).shape.borderRadius
102
- },
103
- '&:last-of-type': {
104
- borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
105
- borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
106
- // Fix a rendering issue on Edge
107
- '@supports (-ms-ime-align: auto)': {
108
- borderBottomLeftRadius: 0,
109
- borderBottomRightRadius: 0
95
+ theme
96
+ }) => ({
97
+ variants: [{
98
+ props: props => !props.square,
99
+ style: {
100
+ borderRadius: 0,
101
+ '&:first-of-type': {
102
+ borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
103
+ borderTopRightRadius: (theme.vars || theme).shape.borderRadius
104
+ },
105
+ '&:last-of-type': {
106
+ borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
107
+ borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
108
+ // Fix a rendering issue on Edge
109
+ '@supports (-ms-ime-align: auto)': {
110
+ borderBottomLeftRadius: 0,
111
+ borderBottomRightRadius: 0
112
+ }
113
+ }
110
114
  }
111
- }
112
- }, !ownerState.disableGutters && {
113
- [`&.${accordionClasses.expanded}`]: {
114
- margin: '16px 0'
115
- }
115
+ }, {
116
+ props: props => !props.disableGutters,
117
+ style: {
118
+ [`&.${accordionClasses.expanded}`]: {
119
+ margin: '16px 0'
120
+ }
121
+ }
122
+ }]
116
123
  }));
117
124
  const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
118
125
  const props = useThemeProps({
@@ -1,16 +1,16 @@
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", "disableSpacing"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
- import styled from '../styles/styled';
11
- import useThemeProps from '../styles/useThemeProps';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
12
11
  import { getAccordionActionsUtilityClass } from './accordionActionsClasses';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const useThemeProps = createUseThemeProps('MuiAccordionActions');
14
14
  const useUtilityClasses = ownerState => {
15
15
  const {
16
16
  classes,
@@ -30,18 +30,20 @@ const AccordionActionsRoot = styled('div', {
30
30
  } = props;
31
31
  return [styles.root, !ownerState.disableSpacing && styles.spacing];
32
32
  }
33
- })(({
34
- ownerState
35
- }) => _extends({
33
+ })({
36
34
  display: 'flex',
37
35
  alignItems: 'center',
38
36
  padding: 8,
39
- justifyContent: 'flex-end'
40
- }, !ownerState.disableSpacing && {
41
- '& > :not(style) ~ :not(style)': {
42
- marginLeft: 8
43
- }
44
- }));
37
+ justifyContent: 'flex-end',
38
+ variants: [{
39
+ props: props => !props.disableSpacing,
40
+ style: {
41
+ '& > :not(style) ~ :not(style)': {
42
+ marginLeft: 8
43
+ }
44
+ }
45
+ }]
46
+ });
45
47
  const AccordionActions = /*#__PURE__*/React.forwardRef(function AccordionActions(inProps, ref) {
46
48
  const props = useThemeProps({
47
49
  props: inProps,
@@ -7,10 +7,10 @@ import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
- import styled from '../styles/styled';
11
- import useThemeProps from '../styles/useThemeProps';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
12
11
  import { getAccordionDetailsUtilityClass } from './accordionDetailsClasses';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const useThemeProps = createUseThemeProps('MuiAccordionDetails');
14
14
  const useUtilityClasses = ownerState => {
15
15
  const {
16
16
  classes
@@ -1,19 +1,19 @@
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 = ["children", "className", "expandIcon", "focusVisibleClassName", "onClick"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import clsx from 'clsx';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
- import styled from '../styles/styled';
11
- import useThemeProps from '../styles/useThemeProps';
10
+ import { styled, createUseThemeProps } from '../zero-styled';
12
11
  import ButtonBase from '../ButtonBase';
13
12
  import AccordionContext from '../Accordion/AccordionContext';
14
13
  import accordionSummaryClasses, { getAccordionSummaryUtilityClass } from './accordionSummaryClasses';
15
14
  import { jsx as _jsx } from "react/jsx-runtime";
16
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ const useThemeProps = createUseThemeProps('MuiAccordionSummary');
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
19
19
  classes,
@@ -34,13 +34,12 @@ const AccordionSummaryRoot = styled(ButtonBase, {
34
34
  slot: 'Root',
35
35
  overridesResolver: (props, styles) => styles.root
36
36
  })(({
37
- theme,
38
- ownerState
37
+ theme
39
38
  }) => {
40
39
  const transition = {
41
40
  duration: theme.transitions.duration.shortest
42
41
  };
43
- return _extends({
42
+ return {
44
43
  display: 'flex',
45
44
  minHeight: 48,
46
45
  padding: theme.spacing(0, 2),
@@ -53,31 +52,38 @@ const AccordionSummaryRoot = styled(ButtonBase, {
53
52
  },
54
53
  [`&:hover:not(.${accordionSummaryClasses.disabled})`]: {
55
54
  cursor: 'pointer'
56
- }
57
- }, !ownerState.disableGutters && {
58
- [`&.${accordionSummaryClasses.expanded}`]: {
59
- minHeight: 64
60
- }
61
- });
55
+ },
56
+ variants: [{
57
+ props: props => !props.disableGutters,
58
+ style: {
59
+ [`&.${accordionSummaryClasses.expanded}`]: {
60
+ minHeight: 64
61
+ }
62
+ }
63
+ }]
64
+ };
62
65
  });
63
66
  const AccordionSummaryContent = styled('div', {
64
67
  name: 'MuiAccordionSummary',
65
68
  slot: 'Content',
66
69
  overridesResolver: (props, styles) => styles.content
67
70
  })(({
68
- theme,
69
- ownerState
70
- }) => _extends({
71
+ theme
72
+ }) => ({
71
73
  display: 'flex',
72
74
  flexGrow: 1,
73
- margin: '12px 0'
74
- }, !ownerState.disableGutters && {
75
- transition: theme.transitions.create(['margin'], {
76
- duration: theme.transitions.duration.shortest
77
- }),
78
- [`&.${accordionSummaryClasses.expanded}`]: {
79
- margin: '20px 0'
80
- }
75
+ margin: '12px 0',
76
+ variants: [{
77
+ props: props => !props.disableGutters,
78
+ style: {
79
+ transition: theme.transitions.create(['margin'], {
80
+ duration: theme.transitions.duration.shortest
81
+ }),
82
+ [`&.${accordionSummaryClasses.expanded}`]: {
83
+ margin: '20px 0'
84
+ }
85
+ }
86
+ }]
81
87
  }));
82
88
  const AccordionSummaryExpandIconWrapper = styled('div', {
83
89
  name: 'MuiAccordionSummary',
@@ -171,7 +171,7 @@ export interface AutocompleteProps<
171
171
  };
172
172
  /**
173
173
  * If `true`, the component is in a loading state.
174
- * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, e.g. `options` are empty).
174
+ * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, for example `options` are empty).
175
175
  * @default false
176
176
  */
177
177
  loading?: boolean;
@@ -24,14 +24,14 @@ import outlinedInputClasses from '../OutlinedInput/outlinedInputClasses';
24
24
  import filledInputClasses from '../FilledInput/filledInputClasses';
25
25
  import ClearIcon from '../internal/svg-icons/Close';
26
26
  import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown';
27
- import useThemeProps from '../styles/useThemeProps';
28
- import styled from '../styles/styled';
27
+ import { styled, createUseThemeProps } from '../zero-styled';
29
28
  import autocompleteClasses, { getAutocompleteUtilityClass } from './autocompleteClasses';
30
29
  import capitalize from '../utils/capitalize';
31
30
  import useForkRef from '../utils/useForkRef';
32
31
  import { jsx as _jsx } from "react/jsx-runtime";
33
32
  import { jsxs as _jsxs } from "react/jsx-runtime";
34
33
  import { createElement as _createElement } from "react";
34
+ const useThemeProps = createUseThemeProps('MuiAutocomplete');
35
35
  const useUtilityClasses = ownerState => {
36
36
  const {
37
37
  classes,
@@ -90,9 +90,7 @@ const AutocompleteRoot = styled('div', {
90
90
  [`& .${autocompleteClasses.input}`]: inputFocused && styles.inputFocused
91
91
  }, styles.root, fullWidth && styles.fullWidth, hasPopupIcon && styles.hasPopupIcon, hasClearIcon && styles.hasClearIcon];
92
92
  }
93
- })(({
94
- ownerState
95
- }) => _extends({
93
+ })({
96
94
  [`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]: {
97
95
  visibility: 'visible'
98
96
  },
@@ -101,17 +99,11 @@ const AutocompleteRoot = styled('div', {
101
99
  [`&:hover .${autocompleteClasses.clearIndicator}`]: {
102
100
  visibility: 'visible'
103
101
  }
104
- }
105
- }, ownerState.fullWidth && {
106
- width: '100%'
107
- }, {
108
- [`& .${autocompleteClasses.tag}`]: _extends({
102
+ },
103
+ [`& .${autocompleteClasses.tag}`]: {
109
104
  margin: 3,
110
105
  maxWidth: 'calc(100% - 6px)'
111
- }, ownerState.size === 'small' && {
112
- margin: 2,
113
- maxWidth: 'calc(100% - 4px)'
114
- }),
106
+ },
115
107
  [`& .${autocompleteClasses.inputRoot}`]: {
116
108
  flexWrap: 'wrap',
117
109
  [`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]: {
@@ -200,14 +192,39 @@ const AutocompleteRoot = styled('div', {
200
192
  paddingBottom: 9
201
193
  }
202
194
  },
203
- [`& .${autocompleteClasses.input}`]: _extends({
195
+ [`& .${autocompleteClasses.input}`]: {
204
196
  flexGrow: 1,
205
197
  textOverflow: 'ellipsis',
206
198
  opacity: 0
207
- }, ownerState.inputFocused && {
208
- opacity: 1
209
- })
210
- }));
199
+ },
200
+ variants: [{
201
+ props: {
202
+ fullWidth: true
203
+ },
204
+ style: {
205
+ width: '100%'
206
+ }
207
+ }, {
208
+ props: {
209
+ size: 'small'
210
+ },
211
+ style: {
212
+ [`& .${autocompleteClasses.tag}`]: {
213
+ margin: 2,
214
+ maxWidth: 'calc(100% - 4px)'
215
+ }
216
+ }
217
+ }, {
218
+ props: {
219
+ inputFocused: true
220
+ },
221
+ style: {
222
+ [`& .${autocompleteClasses.input}`]: {
223
+ opacity: 1
224
+ }
225
+ }
226
+ }]
227
+ });
211
228
  const AutocompleteEndAdornment = styled('div', {
212
229
  name: 'MuiAutocomplete',
213
230
  slot: 'EndAdornment',
@@ -234,14 +251,18 @@ const AutocompletePopupIndicator = styled(IconButton, {
234
251
  overridesResolver: ({
235
252
  ownerState
236
253
  }, styles) => _extends({}, styles.popupIndicator, ownerState.popupOpen && styles.popupIndicatorOpen)
237
- })(({
238
- ownerState
239
- }) => _extends({
254
+ })({
240
255
  padding: 2,
241
- marginRight: -2
242
- }, ownerState.popupOpen && {
243
- transform: 'rotate(180deg)'
244
- }));
256
+ marginRight: -2,
257
+ variants: [{
258
+ props: {
259
+ popupOpen: true
260
+ },
261
+ style: {
262
+ transform: 'rotate(180deg)'
263
+ }
264
+ }]
265
+ });
245
266
  const AutocompletePopper = styled(Popper, {
246
267
  name: 'MuiAutocomplete',
247
268
  slot: 'Popper',
@@ -254,12 +275,17 @@ const AutocompletePopper = styled(Popper, {
254
275
  }, styles.popper, ownerState.disablePortal && styles.popperDisablePortal];
255
276
  }
256
277
  })(({
257
- theme,
258
- ownerState
259
- }) => _extends({
260
- zIndex: (theme.vars || theme).zIndex.modal
261
- }, ownerState.disablePortal && {
262
- position: 'absolute'
278
+ theme
279
+ }) => ({
280
+ zIndex: (theme.vars || theme).zIndex.modal,
281
+ variants: [{
282
+ props: {
283
+ disablePortal: true
284
+ },
285
+ style: {
286
+ position: 'absolute'
287
+ }
288
+ }]
263
289
  }));
264
290
  const AutocompletePaper = styled(Paper, {
265
291
  name: 'MuiAutocomplete',
@@ -912,7 +938,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
912
938
  ListboxProps: PropTypes.object,
913
939
  /**
914
940
  * If `true`, the component is in a loading state.
915
- * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, e.g. `options` are empty).
941
+ * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, for example `options` are empty).
916
942
  * @default false
917
943
  */
918
944
  loading: PropTypes.bool,
@@ -9,11 +9,11 @@ export interface AutocompleteClasses {
9
9
  focused: string;
10
10
  /** Styles applied to the option elements if they are keyboard focused. */
11
11
  focusVisible: string;
12
- /** Styles applied to the tag elements, e.g. the chips. */
12
+ /** Styles applied to the tag elements, for example the chips. */
13
13
  tag: string;
14
- /** Styles applied to the tag elements, e.g. the chips if `size="small"`. */
14
+ /** Styles applied to the tag elements, for example the chips if `size="small"`. */
15
15
  tagSizeSmall: string;
16
- /** Styles applied to the tag elements, e.g. the chips if `size="medium"`. */
16
+ /** Styles applied to the tag elements, for example the chips if `size="medium"`. */
17
17
  tagSizeMedium: string;
18
18
  /** Styles applied when the popup icon is rendered. */
19
19
  hasPopupIcon: string;