@mui/material 5.15.13 → 5.15.15

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 (92) 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 +60 -34
  7. package/Autocomplete/autocompleteClasses.d.ts +3 -3
  8. package/CHANGELOG.md +156 -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/RadioGroup/RadioGroup.d.ts +0 -2
  17. package/RadioGroup/RadioGroup.js +23 -2
  18. package/RadioGroup/index.d.ts +3 -0
  19. package/RadioGroup/index.js +3 -1
  20. package/RadioGroup/radioGroupClasses.d.ts +6 -0
  21. package/RadioGroup/radioGroupClasses.js +7 -0
  22. package/Select/Select.d.ts +8 -20
  23. package/Slider/Slider.js +404 -223
  24. package/SvgIcon/SvgIcon.js +1 -1
  25. package/index.js +1 -1
  26. package/legacy/Accordion/Accordion.js +33 -22
  27. package/legacy/AccordionActions/AccordionActions.js +17 -14
  28. package/legacy/AccordionDetails/AccordionDetails.js +2 -2
  29. package/legacy/AccordionSummary/AccordionSummary.js +31 -22
  30. package/legacy/Autocomplete/Autocomplete.js +133 -114
  31. package/legacy/CircularProgress/CircularProgress.js +1 -1
  32. package/legacy/Icon/Icon.js +1 -1
  33. package/legacy/RadioGroup/RadioGroup.js +21 -2
  34. package/legacy/RadioGroup/index.js +3 -1
  35. package/legacy/RadioGroup/radioGroupClasses.js +7 -0
  36. package/legacy/Slider/Slider.js +373 -191
  37. package/legacy/SvgIcon/SvgIcon.js +1 -1
  38. package/legacy/index.js +1 -1
  39. package/legacy/styles/experimental_extendTheme.js +1 -1
  40. package/legacy/styles/rootShouldForwardProp.js +5 -0
  41. package/legacy/styles/slotShouldForwardProp.js +5 -0
  42. package/legacy/styles/styled.js +4 -5
  43. package/legacy/usePagination/usePagination.js +1 -1
  44. package/modern/Accordion/Accordion.js +30 -23
  45. package/modern/AccordionActions/AccordionActions.js +14 -12
  46. package/modern/AccordionDetails/AccordionDetails.js +2 -2
  47. package/modern/AccordionSummary/AccordionSummary.js +29 -23
  48. package/modern/Autocomplete/Autocomplete.js +60 -34
  49. package/modern/CircularProgress/CircularProgress.js +1 -1
  50. package/modern/Icon/Icon.js +1 -1
  51. package/modern/RadioGroup/RadioGroup.js +23 -2
  52. package/modern/RadioGroup/index.js +3 -1
  53. package/modern/RadioGroup/radioGroupClasses.js +7 -0
  54. package/modern/Slider/Slider.js +337 -172
  55. package/modern/SvgIcon/SvgIcon.js +1 -1
  56. package/modern/index.js +1 -1
  57. package/modern/styles/experimental_extendTheme.js +1 -1
  58. package/modern/styles/rootShouldForwardProp.js +3 -0
  59. package/modern/styles/slotShouldForwardProp.js +5 -0
  60. package/modern/styles/styled.js +4 -3
  61. package/modern/usePagination/usePagination.js +1 -1
  62. package/node/Accordion/Accordion.js +32 -25
  63. package/node/AccordionActions/AccordionActions.js +16 -14
  64. package/node/AccordionDetails/AccordionDetails.js +4 -4
  65. package/node/AccordionSummary/AccordionSummary.js +33 -27
  66. package/node/Autocomplete/Autocomplete.js +72 -46
  67. package/node/CircularProgress/CircularProgress.js +1 -1
  68. package/node/Icon/Icon.js +1 -1
  69. package/node/RadioGroup/RadioGroup.js +23 -2
  70. package/node/RadioGroup/index.js +25 -1
  71. package/node/RadioGroup/radioGroupClasses.js +15 -0
  72. package/node/Slider/Slider.js +414 -233
  73. package/node/SvgIcon/SvgIcon.js +1 -1
  74. package/node/index.js +1 -1
  75. package/node/styles/experimental_extendTheme.js +1 -1
  76. package/node/styles/rootShouldForwardProp.js +10 -0
  77. package/node/styles/slotShouldForwardProp.js +11 -0
  78. package/node/styles/styled.js +17 -8
  79. package/node/usePagination/usePagination.js +1 -1
  80. package/package.json +6 -6
  81. package/styles/components.d.ts +5 -0
  82. package/styles/experimental_extendTheme.js +1 -1
  83. package/styles/overrides.d.ts +2 -0
  84. package/styles/rootShouldForwardProp.d.ts +2 -0
  85. package/styles/rootShouldForwardProp.js +3 -0
  86. package/styles/slotShouldForwardProp.d.ts +2 -0
  87. package/styles/slotShouldForwardProp.js +5 -0
  88. package/styles/styled.d.ts +2 -3
  89. package/styles/styled.js +4 -3
  90. package/umd/material-ui.development.js +1010 -746
  91. package/umd/material-ui.production.min.js +2 -2
  92. package/usePagination/usePagination.js +1 -1
@@ -2,7 +2,7 @@ import { PopperProps as BasePopperProps } from '@mui/base/Popper';
2
2
  import { SxProps } from '@mui/system';
3
3
  import * as React from 'react';
4
4
  import { Theme } from '../styles';
5
- export type PopperProps = Omit<BasePopperProps, 'direction'> & {
5
+ export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
6
6
  /**
7
7
  * The component used for the root node.
8
8
  * Either a string to use a HTML element or a component.
@@ -25,7 +25,7 @@ export type PopperProps = Omit<BasePopperProps, 'direction'> & {
25
25
  * The system prop that allows defining system overrides as well as additional CSS styles.
26
26
  */
27
27
  sx?: SxProps<Theme>;
28
- };
28
+ }
29
29
  /**
30
30
  *
31
31
  * Demos:
@@ -38,28 +38,5 @@ export type PopperProps = Omit<BasePopperProps, 'direction'> & {
38
38
  *
39
39
  * - [Popper API](https://mui.com/material-ui/api/popper/)
40
40
  */
41
- declare const Popper: React.ForwardRefExoticComponent<Omit<BasePopperProps, "direction"> & {
42
- /**
43
- * The component used for the root node.
44
- * Either a string to use a HTML element or a component.
45
- */
46
- component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
47
- /**
48
- * The components used for each slot inside the Popper.
49
- * Either a string to use a HTML element or a component.
50
- * @default {}
51
- */
52
- components?: {
53
- Root?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
54
- } | undefined;
55
- /**
56
- * The props used for each slot inside the Popper.
57
- * @default {}
58
- */
59
- componentsProps?: BasePopperProps['slotProps'];
60
- /**
61
- * The system prop that allows defining system overrides as well as additional CSS styles.
62
- */
63
- sx?: SxProps<Theme> | undefined;
64
- } & React.RefAttributes<HTMLDivElement>>;
41
+ declare const Popper: React.ForwardRefExoticComponent<PopperProps & React.RefAttributes<HTMLDivElement>>;
65
42
  export default Popper;
package/README.md CHANGED
@@ -33,7 +33,7 @@ Our documentation features [a collection of example projects using Material UI]
33
33
  Read the [contributing guide](/CONTRIBUTING.md) to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.
34
34
 
35
35
  Contributing to Material UI is about more than just issues and pull requests!
36
- There are many other ways to [support MUI](https://mui.com/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project) beyond contributing to the code base.
36
+ There are many other ways to [support Material UI](https://mui.com/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project) beyond contributing to the code base.
37
37
 
38
38
  ## Changelog
39
39
 
@@ -41,7 +41,7 @@ The [changelog](https://github.com/mui/material-ui/releases) is regularly update
41
41
 
42
42
  ## Roadmap
43
43
 
44
- Future plans and high-priority features and enhancements can be found in our [roadmap](https://mui.com/material-ui/discover-more/roadmap/).
44
+ Future plans and high-priority features and enhancements can be found in the [roadmap](https://mui.com/material-ui/discover-more/roadmap/).
45
45
 
46
46
  ## License
47
47
 
@@ -25,8 +25,6 @@ export interface RadioGroupProps extends Omit<FormGroupProps, 'onChange'> {
25
25
  value?: any;
26
26
  }
27
27
 
28
- export type RadioGroupClassKey = keyof NonNullable<RadioGroupProps['classes']>;
29
-
30
28
  /**
31
29
  *
32
30
  * Demos:
@@ -2,21 +2,36 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["actions", "children", "defaultValue", "name", "onChange", "value"];
5
+ const _excluded = ["actions", "children", "className", "defaultValue", "name", "onChange", "value"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
+ import clsx from 'clsx';
9
+ import composeClasses from '@mui/utils/composeClasses';
8
10
  import FormGroup from '../FormGroup';
11
+ import { getRadioGroupUtilityClass } from './radioGroupClasses';
9
12
  import useForkRef from '../utils/useForkRef';
10
13
  import useControlled from '../utils/useControlled';
11
14
  import RadioGroupContext from './RadioGroupContext';
12
15
  import useId from '../utils/useId';
13
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
+ const useUtilityClasses = props => {
18
+ const {
19
+ classes,
20
+ row,
21
+ error
22
+ } = props;
23
+ const slots = {
24
+ root: ['root', row && 'row', error && 'error']
25
+ };
26
+ return composeClasses(slots, getRadioGroupUtilityClass, classes);
27
+ };
14
28
  const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
15
29
  const {
16
30
  // private
17
31
  // eslint-disable-next-line react/prop-types
18
32
  actions,
19
33
  children,
34
+ className,
20
35
  defaultValue,
21
36
  name: nameProp,
22
37
  onChange,
@@ -24,6 +39,7 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
24
39
  } = props,
25
40
  other = _objectWithoutPropertiesLoose(props, _excluded);
26
41
  const rootRef = React.useRef(null);
42
+ const classes = useUtilityClasses(props);
27
43
  const [value, setValueState] = useControlled({
28
44
  controlled: valueProp,
29
45
  default: defaultValue,
@@ -56,7 +72,8 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
56
72
  value: contextValue,
57
73
  children: /*#__PURE__*/_jsx(FormGroup, _extends({
58
74
  role: "radiogroup",
59
- ref: handleRef
75
+ ref: handleRef,
76
+ className: clsx(classes.root, className)
60
77
  }, other, {
61
78
  children: children
62
79
  }))
@@ -71,6 +88,10 @@ process.env.NODE_ENV !== "production" ? RadioGroup.propTypes /* remove-proptypes
71
88
  * The content of the component.
72
89
  */
73
90
  children: PropTypes.node,
91
+ /**
92
+ * @ignore
93
+ */
94
+ className: PropTypes.string,
74
95
  /**
75
96
  * The default value. Use when the component is not controlled.
76
97
  */
@@ -2,3 +2,6 @@ export { default } from './RadioGroup';
2
2
  export * from './RadioGroup';
3
3
 
4
4
  export { default as useRadioGroup, RadioGroupState } from './useRadioGroup';
5
+
6
+ export { default as radioGroupClasses } from './radioGroupClasses';
7
+ export * from './radioGroupClasses';
@@ -1,4 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  export { default } from './RadioGroup';
4
- export { default as useRadioGroup } from './useRadioGroup';
4
+ export { default as useRadioGroup } from './useRadioGroup';
5
+ export { default as radioGroupClasses } from './radioGroupClasses';
6
+ export * from './radioGroupClasses';
@@ -0,0 +1,6 @@
1
+ import { FormGroupClasses } from '../FormGroup';
2
+ export type RadioGroupClassKey = keyof FormGroupClasses;
3
+ export type RadioGroupClasses = FormGroupClasses;
4
+ export declare function getRadioGroupUtilityClass(slot: string): string;
5
+ declare const radioGroupClasses: RadioGroupClasses;
6
+ export default radioGroupClasses;
@@ -0,0 +1,7 @@
1
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
2
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
+ export function getRadioGroupUtilityClass(slot) {
4
+ return generateUtilityClass('MuiRadioGroup', slot);
5
+ }
6
+ const radioGroupClasses = generateUtilityClasses('MuiRadioGroup', ['root', 'row', 'error']);
7
+ export default radioGroupClasses;
@@ -148,7 +148,7 @@ export interface BaseSelectProps<Value = unknown>
148
148
  * The variant to use.
149
149
  * @default 'outlined'
150
150
  */
151
- variant?: 'filled' | 'standard' | 'outlined';
151
+ variant?: SelectVariants;
152
152
  }
153
153
 
154
154
  export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onChange'> {
@@ -172,20 +172,15 @@ export interface OutlinedSelectProps extends Omit<OutlinedInputProps, 'value' |
172
172
  * The variant to use.
173
173
  * @default 'outlined'
174
174
  */
175
- variant: 'outlined';
175
+ variant?: 'outlined';
176
176
  }
177
177
 
178
178
  export type SelectVariants = 'outlined' | 'standard' | 'filled';
179
179
 
180
- export type SelectProps<
181
- Value = unknown,
182
- Variant extends SelectVariants = SelectVariants,
183
- > = BaseSelectProps<Value> &
184
- (Variant extends 'filled'
185
- ? FilledSelectProps
186
- : Variant extends 'standard'
187
- ? StandardSelectProps
188
- : OutlinedSelectProps);
180
+ export type SelectProps<Value = unknown> =
181
+ | (FilledSelectProps & BaseSelectProps<Value>)
182
+ | (StandardSelectProps & BaseSelectProps<Value>)
183
+ | (OutlinedSelectProps & BaseSelectProps<Value>);
189
184
 
190
185
  /**
191
186
  *
@@ -198,15 +193,8 @@ export type SelectProps<
198
193
  * - [Select API](https://mui.com/material-ui/api/select/)
199
194
  * - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
200
195
  */
201
-
202
- export default function Select<Value = unknown, Variant extends SelectVariants = 'outlined'>(
203
- props: {
204
- /**
205
- * The variant to use.
206
- * @default 'outlined'
207
- */
208
- variant?: Variant;
209
- } & Omit<SelectProps<Value, Variant>, 'variant'>,
196
+ export default function Select<Value = unknown>(
197
+ props: SelectProps<Value>,
210
198
  ): JSX.Element & {
211
199
  muiName: string;
212
200
  };