@mui/material 5.12.2 → 5.13.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 (78) hide show
  1. package/Accordion/Accordion.d.ts +71 -57
  2. package/AppBar/AppBar.d.ts +9 -7
  3. package/Autocomplete/Autocomplete.d.ts +2 -1
  4. package/BottomNavigationAction/BottomNavigationAction.js +4 -1
  5. package/ButtonGroup/ButtonGroup.js +8 -2
  6. package/CHANGELOG.md +182 -0
  7. package/Chip/Chip.js +1 -1
  8. package/Divider/Divider.js +10 -11
  9. package/Input/inputClasses.d.ts +4 -0
  10. package/InputBase/InputBase.js +1 -1
  11. package/Paper/Paper.d.ts +6 -1
  12. package/Popper/Popper.d.ts +11 -1
  13. package/Popper/Popper.js +4 -3
  14. package/Select/SelectInput.js +6 -4
  15. package/Slider/Slider.js +1 -1
  16. package/Snackbar/Snackbar.js +4 -3
  17. package/SwipeableDrawer/SwipeableDrawer.js +1 -1
  18. package/TextField/TextField.d.ts +21 -2
  19. package/TextField/TextField.js +7 -1
  20. package/index.js +1 -1
  21. package/legacy/ButtonGroup/ButtonGroup.js +7 -3
  22. package/legacy/Divider/Divider.js +17 -17
  23. package/legacy/Drawer/Drawer.js +4 -4
  24. package/legacy/InputBase/InputBase.js +1 -1
  25. package/legacy/ListItem/ListItem.js +4 -4
  26. package/legacy/Menu/Menu.js +4 -4
  27. package/legacy/Popover/Popover.js +4 -4
  28. package/legacy/Popper/Popper.js +4 -3
  29. package/legacy/Select/SelectInput.js +4 -5
  30. package/legacy/Slider/Slider.js +1 -1
  31. package/legacy/Snackbar/Snackbar.js +16 -15
  32. package/legacy/SpeedDial/SpeedDial.js +8 -8
  33. package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
  34. package/legacy/TextField/TextField.js +7 -1
  35. package/legacy/index.js +1 -1
  36. package/legacy/useMediaQuery/useMediaQuery.js +8 -0
  37. package/modern/BottomNavigationAction/BottomNavigationAction.js +4 -1
  38. package/modern/ButtonGroup/ButtonGroup.js +8 -2
  39. package/modern/Chip/Chip.js +1 -1
  40. package/modern/Divider/Divider.js +10 -11
  41. package/modern/InputBase/InputBase.js +1 -1
  42. package/modern/Popper/Popper.js +4 -3
  43. package/modern/Select/SelectInput.js +6 -4
  44. package/modern/Slider/Slider.js +1 -1
  45. package/modern/Snackbar/Snackbar.js +4 -3
  46. package/modern/SwipeableDrawer/SwipeableDrawer.js +1 -1
  47. package/modern/TextField/TextField.js +7 -1
  48. package/modern/index.js +1 -1
  49. package/modern/useMediaQuery/useMediaQuery.js +8 -0
  50. package/node/BottomNavigationAction/BottomNavigationAction.js +4 -1
  51. package/node/ButtonBase/Ripple.js +1 -2
  52. package/node/ButtonGroup/ButtonGroup.js +8 -2
  53. package/node/Chip/Chip.js +1 -1
  54. package/node/Divider/Divider.js +10 -11
  55. package/node/Grid/Grid.js +10 -1
  56. package/node/Hidden/Hidden.js +2 -2
  57. package/node/Hidden/HiddenJs.js +1 -2
  58. package/node/InputBase/InputBase.js +1 -1
  59. package/node/Popper/Popper.js +4 -3
  60. package/node/Select/SelectInput.js +6 -4
  61. package/node/Slide/Slide.js +2 -3
  62. package/node/Slider/Slider.js +1 -1
  63. package/node/Snackbar/Snackbar.js +4 -3
  64. package/node/SpeedDialAction/SpeedDialAction.js +1 -1
  65. package/node/SwipeableDrawer/SwipeableDrawer.js +3 -4
  66. package/node/Switch/Switch.js +1 -1
  67. package/node/TabScrollButton/TabScrollButton.js +1 -0
  68. package/node/TablePagination/TablePaginationActions.js +2 -2
  69. package/node/TextField/TextField.js +7 -1
  70. package/node/ToggleButton/ToggleButton.js +1 -1
  71. package/node/index.js +1 -1
  72. package/node/styles/index.js +5 -1
  73. package/node/useMediaQuery/useMediaQuery.js +12 -0
  74. package/node/utils/createSvgIcon.js +1 -2
  75. package/package.json +6 -6
  76. package/umd/material-ui.development.js +93 -75
  77. package/umd/material-ui.production.min.js +20 -20
  78. package/useMediaQuery/useMediaQuery.js +8 -0
@@ -1,64 +1,71 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
- import { InternalStandardProps as StandardProps, Theme } from '..';
3
+ import { Theme } from '..';
4
4
  import { TransitionProps } from '../transitions/transition';
5
- import { PaperProps } from '../Paper';
6
5
  import { AccordionClasses } from './accordionClasses';
6
+ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
7
+ import { ExtendPaperTypeMap } from '../Paper/Paper';
7
8
 
8
- export interface AccordionProps extends StandardProps<PaperProps, 'onChange'> {
9
- /**
10
- * The content of the component.
11
- */
12
- children: NonNullable<React.ReactNode>;
13
- /**
14
- * Override or extend the styles applied to the component.
15
- */
16
- classes?: Partial<AccordionClasses>;
17
- /**
18
- * If `true`, expands the accordion by default.
19
- * @default false
20
- */
21
- defaultExpanded?: boolean;
22
- /**
23
- * If `true`, the component is disabled.
24
- * @default false
25
- */
26
- disabled?: boolean;
27
- /**
28
- * If `true`, it removes the margin between two expanded accordion items and the increase of height.
29
- * @default false
30
- */
31
- disableGutters?: boolean;
32
- /**
33
- * If `true`, expands the accordion, otherwise collapse it.
34
- * Setting this prop enables control over the accordion.
35
- */
36
- expanded?: boolean;
37
- /**
38
- * Callback fired when the expand/collapse state is changed.
39
- *
40
- * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
41
- * @param {boolean} expanded The `expanded` state of the accordion.
42
- */
43
- onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
44
- /**
45
- * The system prop that allows defining system overrides as well as additional CSS styles.
46
- */
47
- sx?: SxProps<Theme>;
48
- /**
49
- * The component used for the transition.
50
- * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
51
- * @default Collapse
52
- */
53
- TransitionComponent?: React.JSXElementConstructor<
54
- TransitionProps & { children?: React.ReactElement<any, any> }
55
- >;
56
- /**
57
- * Props applied to the transition element.
58
- * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
59
- */
60
- TransitionProps?: TransitionProps;
61
- }
9
+ export type AccordionTypeMap<P = {}, D extends React.ElementType = 'div'> = ExtendPaperTypeMap<
10
+ {
11
+ props: P & {
12
+ /**
13
+ * The content of the component.
14
+ */
15
+ children: NonNullable<React.ReactNode>;
16
+ /**
17
+ * Override or extend the styles applied to the component.
18
+ */
19
+ classes?: Partial<AccordionClasses>;
20
+ /**
21
+ * If `true`, expands the accordion by default.
22
+ * @default false
23
+ */
24
+ defaultExpanded?: boolean;
25
+ /**
26
+ * If `true`, the component is disabled.
27
+ * @default false
28
+ */
29
+ disabled?: boolean;
30
+ /**
31
+ * If `true`, it removes the margin between two expanded accordion items and the increase of height.
32
+ * @default false
33
+ */
34
+ disableGutters?: boolean;
35
+ /**
36
+ * If `true`, expands the accordion, otherwise collapse it.
37
+ * Setting this prop enables control over the accordion.
38
+ */
39
+ expanded?: boolean;
40
+ /**
41
+ * Callback fired when the expand/collapse state is changed.
42
+ *
43
+ * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
44
+ * @param {boolean} expanded The `expanded` state of the accordion.
45
+ */
46
+ onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
47
+ /**
48
+ * The system prop that allows defining system overrides as well as additional CSS styles.
49
+ */
50
+ sx?: SxProps<Theme>;
51
+ /**
52
+ * The component used for the transition.
53
+ * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
54
+ * @default Collapse
55
+ */
56
+ TransitionComponent?: React.JSXElementConstructor<
57
+ TransitionProps & { children?: React.ReactElement<any, any> }
58
+ >;
59
+ /**
60
+ * Props applied to the transition element.
61
+ * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
62
+ */
63
+ TransitionProps?: TransitionProps;
64
+ };
65
+ defaultComponent: D;
66
+ },
67
+ 'onChange' | 'classes'
68
+ >;
62
69
 
63
70
  /**
64
71
  *
@@ -71,4 +78,11 @@ export interface AccordionProps extends StandardProps<PaperProps, 'onChange'> {
71
78
  * - [Accordion API](https://mui.com/material-ui/api/accordion/)
72
79
  * - inherits [Paper API](https://mui.com/material-ui/api/paper/)
73
80
  */
74
- export default function Accordion(props: AccordionProps): JSX.Element;
81
+ declare const Accordion: OverridableComponent<AccordionTypeMap>;
82
+
83
+ export type AccordionProps<
84
+ D extends React.ElementType = AccordionTypeMap['defaultComponent'],
85
+ P = {},
86
+ > = OverrideProps<AccordionTypeMap<P, D>, D>;
87
+
88
+ export default Accordion;
@@ -1,16 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
- import { DistributiveOmit, OverridableStringUnion } from '@mui/types';
3
+ import { OverridableStringUnion } from '@mui/types';
4
4
  import { OverridableComponent, OverrideProps } from '@mui/material/OverridableComponent';
5
5
  import { PropTypes, Theme } from '..';
6
- import { PaperProps } from '../Paper';
7
6
  import { AppBarClasses } from './appBarClasses';
7
+ import { ExtendPaperTypeMap } from '../Paper/Paper';
8
8
 
9
9
  export interface AppBarPropsColorOverrides {}
10
10
 
11
- export interface AppBarTypeMap<P = {}, D extends React.ElementType = 'header'> {
12
- props: P &
13
- DistributiveOmit<PaperProps, 'position' | 'color' | 'classes'> & {
11
+ export type AppBarTypeMap<P = {}, D extends React.ElementType = 'header'> = ExtendPaperTypeMap<
12
+ {
13
+ props: P & {
14
14
  /**
15
15
  * Override or extend the styles applied to the component.
16
16
  */
@@ -39,8 +39,10 @@ export interface AppBarTypeMap<P = {}, D extends React.ElementType = 'header'> {
39
39
  */
40
40
  sx?: SxProps<Theme>;
41
41
  };
42
- defaultComponent: D;
43
- }
42
+ defaultComponent: D;
43
+ },
44
+ 'position' | 'color' | 'classes'
45
+ >;
44
46
 
45
47
  /**
46
48
  *
@@ -293,4 +293,5 @@ export default function Autocomplete<
293
293
  Multiple extends boolean | undefined = false,
294
294
  DisableClearable extends boolean | undefined = false,
295
295
  FreeSolo extends boolean | undefined = false,
296
- >(props: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>): JSX.Element;
296
+ ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'],
297
+ >(props: AutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent>): JSX.Element;
@@ -86,7 +86,10 @@ const BottomNavigationAction = /*#__PURE__*/React.forwardRef(function BottomNavi
86
86
  icon,
87
87
  label,
88
88
  onChange,
89
- onClick,
89
+ onClick
90
+ // eslint-disable-next-line react/prop-types -- private, always overridden by BottomNavigation
91
+ ,
92
+
90
93
  value
91
94
  } = props,
92
95
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -83,9 +83,15 @@ const ButtonGroupRoot = styled('div', {
83
83
  borderBottomRightRadius: 0,
84
84
  borderBottomLeftRadius: 0
85
85
  }, ownerState.variant === 'text' && ownerState.orientation === 'horizontal' && {
86
- borderRight: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`
86
+ borderRight: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
87
+ [`&.${buttonGroupClasses.disabled}`]: {
88
+ borderRight: `1px solid ${(theme.vars || theme).palette.action.disabled}`
89
+ }
87
90
  }, ownerState.variant === 'text' && ownerState.orientation === 'vertical' && {
88
- borderBottom: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`
91
+ borderBottom: theme.vars ? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`,
92
+ [`&.${buttonGroupClasses.disabled}`]: {
93
+ borderBottom: `1px solid ${(theme.vars || theme).palette.action.disabled}`
94
+ }
89
95
  }, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
90
96
  borderColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : alpha(theme.palette[ownerState.color].main, 0.5)
91
97
  }, ownerState.variant === 'outlined' && ownerState.orientation === 'horizontal' && {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,187 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.13.0
4
+
5
+ <!-- generated comparing v5.12.3..master -->
6
+
7
+ _May 10, 2023_
8
+
9
+ A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🚀 Base UI is now in beta - all planned breaking changes are now complete!
12
+ - 🗺 We have a new [project roadmap](https://github.com/orgs/mui/projects/18/views/1) on GitHub where you can learn about what's coming next.
13
+ - 🐛 Various bug fixes, 📚 documentation and 🧪 testing improvements
14
+
15
+ ### `@mui/material@5.13.0`
16
+
17
+ - [Autocomplete] Support `ChipComponent` type (#37112) @sai6855
18
+ - [AppBar] Fix component type (#37172) @sai6855
19
+ - [Select] Simplify handleChange in SelectInput (#37040) @ulrichstark
20
+
21
+ ### `@mui/joy@5.0.0-alpha.79`
22
+
23
+ - [Input][joy] Improve alignment on date fields (#37146) @wewakekumar
24
+ - [Alery][joy] Turn JS test to TS test (#37077) @hbjORbj
25
+ - [AspectRatio][joy] js test replaced with ts test (#37087) @PunitSoniME
26
+ - [Badge][AvatarGroup][joy] js test replaced with ts test (#37089) @PunitSoniME
27
+ - [Box][Card][MenuList][joy] Turn JS test to TS test (#37126) @uuxxx
28
+ - [List][Menu][joy] Turn JS test to TS test (#37123) @uuxxx
29
+ - [test][Joy] Remove duplicate Avatar test (#37201) @zignis
30
+ - [test][joy] js test cases converted to ts (#37117) @PunitSoniME
31
+ - [Button][joy] Convert Button test to typescript (#37181) @akash191095
32
+ - [CardContent][CardCover][CardOverflow][Chip][ChipDelete][joy] js text case converted to ts (#37116) @PunitSoniME
33
+ - [Radio][IconButton][Checkbox][Option][joy] Switch to TypeScript unit test (#37137) @DerTimonius
34
+
35
+ ### `@mui/base@5.0.0-beta.0`
36
+
37
+ - [Select][base] Do not call onChange after initial render (#37141) @michaldudak
38
+ - [Select][base] Rename the `optionStringifier` prop (#37118) @michaldudak
39
+ - [typescript][base] Fix types of components callbacks parameters (#37169) @michaldudak
40
+ - [Select], [TablePagination] Use more descriptive parameter names (#37064) @michaldudak
41
+
42
+ ### Docs
43
+
44
+ - [docs] Stray design tweaks to Base UI demos (#37003) @danilo-leal
45
+ - [docs] Move outdated CSS prefixing docs (#36710) @kriskw1999
46
+ - [docs] Improve "Example projects" page design (#37007) @danilo-leal
47
+ - [docs] Redirect NoSsr, Portal and TextareaAutosize to Base UI API page (#37175) @ZeeshanTamboli
48
+ - [docs] Demonstrate `TextField` customization using theme style overrides (#36805) @ZeeshanTamboli
49
+ - [docs] Tweak the "Edit this page" button icon (#37142) @danilo-leal
50
+ - [docs] Update links to the public roadmap (#36995) @mnajdova
51
+ - [docs] Improve Multiselect demo styling (#37120) @michaldudak
52
+ - [Stack] Fix import description @oliviertassinari
53
+
54
+ ### Core
55
+
56
+ - [blog] Fix images using "MUI Base" instead of "Base UI" (#37044) @danilo-leal
57
+ - [core] Add VSCode extensions recommendations (#37166) @michaldudak
58
+ - [test] `e2e-website` related minor fixes (#37204) @ZeeshanTamboli
59
+ - [website] Update the active positions (#37075) @DanailH
60
+ - [website] Add Romain to the About page (#37124) @romgrk
61
+ - [website] Make Toolpad alpha labels consistent (#37125) @gerdadesign
62
+
63
+ All contributors of this release in alphabetical order: @akash191095, @DanailH, @danilo-leal, @DerTimonius, @gerdadesign, @hbjORbj, @kriskw1999, @michaldudak, @mnajdova, @oliviertassinari, @PunitSoniME, @romgrk, @sai6855, @ulrichstark, @uuxxx, @wewakekumar, @ZeeshanTamboli, @zignis
64
+
65
+ ## 5.12.3
66
+
67
+ <!-- generated comparing v5.12.2..master -->
68
+
69
+ _May 2, 2023_
70
+
71
+ A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
72
+
73
+ - all planned breaking changes for Base UI are done. The first beta release should come next week 🎉
74
+ - 🐛 bug fixes and 📚 documentation improvements.
75
+
76
+ ### `@mui/material@5.12.3`
77
+
78
+ - &#8203;<!-- 43 -->[Accordion] Add missing `component` type (#37111) @sai6855
79
+ - &#8203;<!-- 23 -->[ButtonGroup] Should not retain divider color when it is disabled and variant is `text` (#36967) @DavidBoyer11
80
+ - &#8203;<!-- 21 -->[Divider] Fix styles on dividers with text (#35072) @maxdestors
81
+ - &#8203;<!-- 04 -->[TextField] Improve IntelliSense support for props (#36737) @sai6855
82
+ - &#8203;<!-- 03 -->[TextField] Fix running click event on disabled (#36892) @sai6855
83
+
84
+ ### `@mui/joy@5.0.0-alpha.78`
85
+
86
+ - &#8203;<!-- 09 -->[Joy] Miscellaneous fixes and docs improvement (#37026) @siriwatknp
87
+
88
+ ### `@mui/base@5.0.0-alpha.128`
89
+
90
+ #### Breaking changes
91
+
92
+ - The `component` prop is no longer supported because it can be replaced with the slots API. This is how the transformation will look like:
93
+
94
+ ```diff
95
+ <Button
96
+ - component="span"
97
+ + slots={{ root: "span" }}
98
+ />
99
+ ```
100
+
101
+ If using TypeScript, the custom component type should be added as a generic on the `Button` component.
102
+
103
+ ```diff
104
+ -<Button
105
+ +<Button<typeof CustomComponent>
106
+ slots={{ root: CustomComponent }}
107
+ customProp="foo"
108
+ />
109
+ ```
110
+
111
+ There is codemod that you can run in your project to do the transformation:
112
+
113
+ ```sh
114
+ npx @mui/codemod v5.0.0/base-remove-component-prop <path>
115
+ ```
116
+
117
+ The full documentation about the codemod can be found [here](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#base-remove-component-prop).
118
+
119
+ This is the list of PR related to this change:
120
+
121
+ - &#8203;<!-- 40 -->[Button][base] Drop `component` prop (#36677) @mnajdova
122
+ - &#8203;<!-- 42 -->[Badge][base] Drop `component` prop (#37028) @hbjORbj
123
+ - &#8203;<!-- 37 -->[FormControl][base] Drop component prop (#37031) @hbjORbj
124
+ - &#8203;<!-- 35 -->[Input][base] Drop component prop (#37057) @hbjORbj
125
+ - &#8203;<!-- 34 -->[Menu][base] Drop component prop (#37033) @hbjORbj
126
+ - &#8203;<!-- 33 -->[MenuItem][base] Drop component prop (#37032) @hbjORbj
127
+ - &#8203;<!-- 32 -->[Modal][base] Drop component prop (#37058) @hbjORbj
128
+ - &#8203;<!-- 31 -->[Option][base] Drop component prop (#37052) @hbjORbj
129
+ - &#8203;<!-- 30 -->[OptionGroup][base] Drop component prop (#37055) @hbjORbj
130
+ - &#8203;<!-- 31 -->[Popper][base] Drop component prop (#37084) @hbjORbj
131
+ - &#8203;<!-- 29 -->[Select][base] Drop component prop (#37035) @hbjORbj
132
+ - &#8203;<!-- 28 -->[Slider][base] Drop component prop (#37056) @hbjORbj
133
+ - &#8203;<!-- 27 -->[Snackbar][base] Drop component prop (#37041) @nicolas-ot
134
+ - &#8203;<!-- 26 -->[Switch][base] Drop component prop (#37053) @hbjORbj
135
+ - &#8203;<!-- 25 -->[Tab][base] Drop component prop (#36768) @sai6855
136
+ - &#8203;<!-- 24 -->[Tabs][base] Drop component prop (#36770) @sai6855
137
+ - &#8203;<!-- 08 -->[TablePagination][base] Drop component prop (#37059) @sai6855
138
+ - &#8203;<!-- 07 -->[TabPanel][base] Drop component prop (#37054) @sai6855
139
+ - &#8203;<!-- 06 -->[TabsList][base] Drop component prop (#37042) @sai6855
140
+
141
+ - &#8203;<!-- 41 -->[base] Improve API consistency (#36970) @michaldudak
142
+
143
+ Brought consistency to Base UI components and hooks' parameters and return values:
144
+
145
+ 1. Whenever a hook needs a ref, it's now called `<slot_name>Ref`, which matches the `get<slot_name>Props` in the return value.
146
+ 2. All hooks that accept external refs now return merged refs, making combining multiple hooks on one element easier. This was proven necessary in several compound components (like menuItem being both a button and a list item). The type of this value is `React.RefCallback` as using the more general `React.Ref` caused variance issues.
147
+ 3. Type of accepted refs is standardized to `React.Ref<Element>`
148
+ 4. Naming and typing of the forwarded ref in unstyled components were standardized - it's forwardedRef: React.ForwardedRef<Element> (unless a more specific type is needed).
149
+ 5. The shape of the definition of unstyled components was standardized - it's React.forwardRef(function Component(props: Props, forwardedRef: React.Ref<Element>) { ... });. Specifically, the generic parameters of forwardRef were removed as they are specified in function arguments.
150
+
151
+ #### Changes
152
+
153
+ - &#8203;<!-- 36 -->[FormControl][base] Do not use optional fields in useFormControlContext's return value (#37037) @michaldudak
154
+
155
+ ### Docs
156
+
157
+ - &#8203;<!-- 39 -->[base][docs] Add Base UI Quickstart Guide (#36717) @mj12albert
158
+ - &#8203;<!-- 20 -->[docs] Fix Material UI's API linking to Base UI (#37121) @mnajdova
159
+ - &#8203;<!-- 19 -->[docs] Fix pagination in the DataGrid demo (#37114) @cherniavskii
160
+ - &#8203;<!-- 18 -->[docs] Add notification to the release of the new Time Picker UI (#37065) @joserodolfofreitas
161
+ - &#8203;<!-- 17 -->[docs] Specify "Material UI" (not "MUI") where appropriate throughout the docs (#37066) @samuelsycamore
162
+ - &#8203;<!-- 16 -->[docs] Use focus-visible instead of focus for Menu demos (#36847) @michaldudak
163
+ - &#8203;<!-- 15 -->[docs] Fix small regressions API pages (#36972) @oliviertassinari
164
+ - &#8203;<!-- 14 -->[docs] Handle a few docs-feedback (#36977) @oliviertassinari
165
+ - &#8203;<!-- 13 -->[docs] Fix anchor link in customization (#37004) @oliviertassinari
166
+ - &#8203;<!-- 12 -->[docs] Add a note about minimal required version for theme merging to the guides (#36973) @jakub-stastny
167
+ - &#8203;<!-- 11 -->[docs] smooth scrolling added for `back to top` (#37011) @PunitSoniME
168
+ - &#8203;<!-- 10 -->[docs] Remove `useFormControl` return values from demos page (#37036) @ZeeshanTamboli
169
+ - &#8203;<!-- 47 --> [docs][base] Move styles to the bottom of demos code for `SwitchUnstyled` (#36720) @varunmulay22
170
+ - &#8203;<!-- 46 --> [docs][base] Move styles to the bottom of demos code for `InputUnstyled` (#36724) @varunmulay22
171
+ - &#8203;<!-- 45 --> [docs][base] Move styles to the bottom of demos code for `SliderUnstyled` (#36721) @varunmulay22
172
+ - &#8203;<!-- 44 --> [docs][base] Move styles to the bottom of demos code for `Snackbar` (#36719) @varunmulay22
173
+ - &#8203;<!-- 38 -->[docs][base] Move styles to the bottom of demos code for `SelectUnstyled` (#36718) @varunmulay22
174
+ - &#8203;<!-- 05 -->[templates] Image not displayed in blog layout of React template. (#36991) @navedqb
175
+ - &#8203;<!-- 02 -->[website] Take the design role offline @oliviertassinari
176
+ - &#8203;<!-- 01 -->[website] Fix URL convention @oliviertassinari
177
+ - &#8203;<!-- 21 -->[docs] Turn off job banner on docs (#36080) @joserodolfofreitas
178
+
179
+ ### Core
180
+
181
+ - &#8203;<!-- 22 -->[core] Allow type alias as well in hooks API docs generation (#37034) @ZeeshanTamboli
182
+
183
+ All contributors of this release in alphabetical order: @cherniavskii, @DavidBoyer11, @hbjORbj, @jakub-stastny, @joserodolfofreitas, @maxdestors, @michaldudak, @mj12albert, @mnajdova, @navedqb, @nicolas-ot, @oliviertassinari, @PunitSoniME, @sai6855, @samuelsycamore, @siriwatknp, @varunmulay22, @ZeeshanTamboli
184
+
3
185
  ## 5.12.2
4
186
 
5
187
  <!-- generated comparing v5.12.1..master -->
package/Chip/Chip.js CHANGED
@@ -293,7 +293,7 @@ const Chip = /*#__PURE__*/React.forwardRef(function Chip(inProps, ref) {
293
293
  size = 'medium',
294
294
  variant = 'filled',
295
295
  tabIndex,
296
- skipFocusWhenDisabled = false
296
+ skipFocusWhenDisabled = false // TODO v6: Rename to `focusableWhenDisabled`.
297
297
  } = props,
298
298
  other = _objectWithoutPropertiesLoose(props, _excluded);
299
299
  const chipRef = React.useRef(null);
@@ -70,7 +70,6 @@ const DividerRoot = styled('div', {
70
70
  alignSelf: 'stretch',
71
71
  height: 'auto'
72
72
  }), ({
73
- theme,
74
73
  ownerState
75
74
  }) => _extends({}, ownerState.children && {
76
75
  display: 'flex',
@@ -78,12 +77,16 @@ const DividerRoot = styled('div', {
78
77
  textAlign: 'center',
79
78
  border: 0,
80
79
  '&::before, &::after': {
81
- position: 'relative',
82
- width: '100%',
83
- borderTop: `thin solid ${(theme.vars || theme).palette.divider}`,
84
- top: '50%',
85
80
  content: '""',
86
- transform: 'translateY(50%)'
81
+ alignSelf: 'center'
82
+ }
83
+ }), ({
84
+ theme,
85
+ ownerState
86
+ }) => _extends({}, ownerState.children && ownerState.orientation !== 'vertical' && {
87
+ '&::before, &::after': {
88
+ width: '100%',
89
+ borderTop: `thin solid ${(theme.vars || theme).palette.divider}`
87
90
  }
88
91
  }), ({
89
92
  theme,
@@ -92,11 +95,7 @@ const DividerRoot = styled('div', {
92
95
  flexDirection: 'column',
93
96
  '&::before, &::after': {
94
97
  height: '100%',
95
- top: '0%',
96
- left: '50%',
97
- borderTop: 0,
98
- borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`,
99
- transform: 'translateX(0%)'
98
+ borderLeft: `thin solid ${(theme.vars || theme).palette.divider}`
100
99
  }
101
100
  }), ({
102
101
  ownerState
@@ -25,6 +25,10 @@ export interface InputClasses {
25
25
  inputSizeSmall: string;
26
26
  /** Styles applied to the input element if `multiline={true}`. */
27
27
  inputMultiline: string;
28
+ /** Styles applied to the input element if `startAdornment` is provided. */
29
+ inputAdornedStart: string;
30
+ /** Styles applied to the input element if `endAdornment` is provided. */
31
+ inputAdornedEnd: string;
28
32
  /** Styles applied to the input element if `type="search"`. */
29
33
  inputTypeSearch: string;
30
34
  }
@@ -372,7 +372,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
372
372
  if (inputRef.current && event.currentTarget === event.target) {
373
373
  inputRef.current.focus();
374
374
  }
375
- if (onClick) {
375
+ if (onClick && !fcs.disabled) {
376
376
  onClick(event);
377
377
  }
378
378
  };
package/Paper/Paper.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { OverridableStringUnion } from '@mui/types';
4
4
  import { Theme } from '../styles';
5
- import { OverrideProps, OverridableComponent } from '../OverridableComponent';
5
+ import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
6
6
  import { PaperClasses } from './paperClasses';
7
7
 
8
8
  export interface PaperPropsVariantOverrides {}
@@ -54,6 +54,11 @@ export interface PaperTypeMap<P = {}, D extends React.ElementType = 'div'> {
54
54
  */
55
55
  declare const Paper: OverridableComponent<PaperTypeMap>;
56
56
 
57
+ export interface ExtendPaperTypeMap<M extends OverridableTypeMap, Keys extends string = ''> {
58
+ props: M['props'] & Omit<PaperTypeMap['props'], Keys>;
59
+ defaultComponent: M['defaultComponent'];
60
+ }
61
+
57
62
  export type PaperProps<
58
63
  D extends React.ElementType = PaperTypeMap['defaultComponent'],
59
64
  P = {},
@@ -3,6 +3,11 @@ import { SxProps } from '@mui/system';
3
3
  import * as React from 'react';
4
4
  import { Theme } from '../styles';
5
5
  export type PopperProps = Omit<BasePopperProps, 'direction'> & {
6
+ /**
7
+ * The component used for the root node.
8
+ * Either a string to use a HTML element or a component.
9
+ */
10
+ component?: React.ElementType;
6
11
  /**
7
12
  * The components used for each slot inside the Popper.
8
13
  * Either a string to use a HTML element or a component.
@@ -33,7 +38,12 @@ export type PopperProps = Omit<BasePopperProps, 'direction'> & {
33
38
  *
34
39
  * - [Popper API](https://mui.com/material-ui/api/popper/)
35
40
  */
36
- declare const Popper: React.ForwardRefExoticComponent<Omit<BasePopperProps<"div", {}>, "direction"> & {
41
+ declare const Popper: React.ForwardRefExoticComponent<Omit<BasePopperProps<"div">, "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> | undefined;
37
47
  /**
38
48
  * The components used for each slot inside the Popper.
39
49
  * Either a string to use a HTML element or a component.
package/Popper/Popper.js CHANGED
@@ -54,7 +54,6 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
54
54
  const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
55
55
  const otherProps = _extends({
56
56
  anchorEl,
57
- component,
58
57
  container,
59
58
  disablePortal,
60
59
  keepMounted,
@@ -66,6 +65,7 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
66
65
  transition
67
66
  }, other);
68
67
  return /*#__PURE__*/_jsx(PopperRoot, _extends({
68
+ as: component,
69
69
  direction: theme == null ? void 0 : theme.direction,
70
70
  slots: {
71
71
  root: RootComponent
@@ -92,9 +92,10 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
92
92
  */
93
93
  children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
94
94
  /**
95
- * @ignore
95
+ * The component used for the root node.
96
+ * Either a string to use a HTML element or a component.
96
97
  */
97
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
98
+ component: PropTypes.elementType,
98
99
  /**
99
100
  * The components used for each slot inside the Popper.
100
101
  * Either a string to use a HTML element or a component.
@@ -134,7 +134,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
134
134
  readOnly,
135
135
  renderValue,
136
136
  SelectDisplayProps = {},
137
- tabIndex: tabIndexProp,
137
+ tabIndex: tabIndexProp
138
+ // catching `type` from Input which makes no sense for SelectInput
139
+ ,
140
+
138
141
  value: valueProp,
139
142
  variant = 'standard'
140
143
  } = props,
@@ -235,11 +238,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
235
238
 
236
239
  // Support autofill.
237
240
  const handleChange = event => {
238
- const index = childrenArray.map(child => child.props.value).indexOf(event.target.value);
239
- if (index === -1) {
241
+ const child = childrenArray.find(childItem => childItem.props.value === event.target.value);
242
+ if (child === undefined) {
240
243
  return;
241
244
  }
242
- const child = childrenArray[index];
243
245
  setValueState(child.props.value);
244
246
  if (onChange) {
245
247
  onChange(event, child);
package/Slider/Slider.js CHANGED
@@ -509,7 +509,7 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
509
509
  trackOffset,
510
510
  trackLeap
511
511
  } = useSlider(_extends({}, ownerState, {
512
- ref
512
+ rootRef: ref
513
513
  }));
514
514
  ownerState.marked = marks.length > 0 && marks.some(mark => mark.label);
515
515
  ownerState.dragging = dragging;
@@ -123,15 +123,16 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
123
123
  const {
124
124
  getRootProps,
125
125
  onClickAway
126
- } = useSnackbar(_extends({}, ownerState, {
127
- ref
128
- }));
126
+ } = useSnackbar(_extends({}, ownerState));
129
127
  const [exited, setExited] = React.useState(true);
130
128
  const rootProps = useSlotProps({
131
129
  elementType: SnackbarRoot,
132
130
  getSlotProps: getRootProps,
133
131
  externalForwardedProps: other,
134
132
  ownerState,
133
+ additionalProps: {
134
+ ref
135
+ },
135
136
  className: [classes.root, className]
136
137
  });
137
138
  const handleExited = node => {
@@ -145,7 +145,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
145
145
  SwipeAreaProps,
146
146
  swipeAreaWidth = 20,
147
147
  transitionDuration = transitionDurationDefault,
148
- variant = 'temporary'
148
+ variant = 'temporary' // Mobile first.
149
149
  } = props,
150
150
  ModalPropsProp = _objectWithoutPropertiesLoose(props.ModalProps, _excluded),
151
151
  other = _objectWithoutPropertiesLoose(props, _excluded2);