@mui/material 5.12.0 → 5.12.2

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 (68) hide show
  1. package/Autocomplete/Autocomplete.js +2 -2
  2. package/Badge/Badge.d.ts +3 -6
  3. package/Button/Button.js +4 -2
  4. package/CHANGELOG.md +142 -0
  5. package/FilledInput/filledInputClasses.d.ts +2 -0
  6. package/FormControl/FormControl.js +1 -1
  7. package/FormControlLabel/FormControlLabel.d.ts +4 -0
  8. package/FormControlLabel/FormControlLabel.js +34 -14
  9. package/FormControlLabel/formControlLabelClasses.d.ts +4 -0
  10. package/FormControlLabel/formControlLabelClasses.js +1 -1
  11. package/Modal/Modal.d.ts +6 -3
  12. package/Modal/Modal.js +11 -3
  13. package/Modal/index.d.ts +1 -1
  14. package/Modal/index.js +1 -1
  15. package/OutlinedInput/outlinedInputClasses.d.ts +2 -0
  16. package/OverridableComponent.d.ts +1 -1
  17. package/Popper/Popper.d.ts +5 -5
  18. package/Popper/Popper.js +28 -4
  19. package/Popper/index.d.ts +1 -1
  20. package/Stack/Stack.d.ts +1 -1
  21. package/Stack/Stack.js +1 -1
  22. package/Tabs/ScrollbarSize.js +2 -2
  23. package/index.js +1 -1
  24. package/legacy/Autocomplete/Autocomplete.js +2 -2
  25. package/legacy/Button/Button.js +4 -2
  26. package/legacy/FormControl/FormControl.js +1 -1
  27. package/legacy/FormControlLabel/FormControlLabel.js +35 -14
  28. package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
  29. package/legacy/Modal/Modal.js +11 -3
  30. package/legacy/Modal/index.js +1 -1
  31. package/legacy/Popper/Popper.js +29 -5
  32. package/legacy/Stack/Stack.js +1 -1
  33. package/legacy/Tabs/ScrollbarSize.js +2 -2
  34. package/legacy/index.js +1 -1
  35. package/legacy/styles/ThemeProvider.js +8 -1
  36. package/legacy/styles/experimental_extendTheme.js +5 -1
  37. package/modern/Autocomplete/Autocomplete.js +2 -2
  38. package/modern/Button/Button.js +100 -96
  39. package/modern/FormControl/FormControl.js +1 -1
  40. package/modern/FormControlLabel/FormControlLabel.js +33 -13
  41. package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
  42. package/modern/Modal/Modal.js +11 -3
  43. package/modern/Modal/index.js +1 -1
  44. package/modern/Popper/Popper.js +28 -4
  45. package/modern/Stack/Stack.js +1 -1
  46. package/modern/Tabs/ScrollbarSize.js +2 -2
  47. package/modern/index.js +1 -1
  48. package/modern/styles/ThemeProvider.js +8 -1
  49. package/modern/styles/experimental_extendTheme.js +5 -1
  50. package/node/Autocomplete/Autocomplete.js +2 -2
  51. package/node/Button/Button.js +4 -2
  52. package/node/FormControl/FormControl.js +1 -1
  53. package/node/FormControlLabel/FormControlLabel.js +35 -15
  54. package/node/FormControlLabel/formControlLabelClasses.js +1 -1
  55. package/node/Modal/Modal.js +13 -5
  56. package/node/Modal/index.js +15 -18
  57. package/node/Popper/Popper.js +28 -4
  58. package/node/Stack/Stack.js +1 -1
  59. package/node/Tabs/ScrollbarSize.js +1 -1
  60. package/node/index.js +1 -1
  61. package/node/styles/ThemeProvider.js +8 -1
  62. package/node/styles/experimental_extendTheme.js +5 -1
  63. package/package.json +4 -4
  64. package/styles/ThemeProvider.js +8 -1
  65. package/styles/experimental_extendTheme.d.ts +7 -0
  66. package/styles/experimental_extendTheme.js +5 -1
  67. package/umd/material-ui.development.js +170 -82
  68. package/umd/material-ui.production.min.js +21 -21
@@ -138,7 +138,7 @@ const AutocompleteRoot = styled('div', {
138
138
  paddingRight: 52 + 4 + 9
139
139
  },
140
140
  [`& .${autocompleteClasses.input}`]: {
141
- padding: '7.5px 4px 7.5px 6px'
141
+ padding: '7.5px 4px 7.5px 5px'
142
142
  },
143
143
  [`& .${autocompleteClasses.endAdornment}`]: {
144
144
  right: 9
@@ -151,7 +151,7 @@ const AutocompleteRoot = styled('div', {
151
151
  paddingBottom: 6,
152
152
  paddingLeft: 6,
153
153
  [`& .${autocompleteClasses.input}`]: {
154
- padding: '2.5px 4px 2.5px 6px'
154
+ padding: '2.5px 4px 2.5px 8px'
155
155
  }
156
156
  },
157
157
  [`& .${filledInputClasses.root}`]: {
package/Badge/Badge.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { OverridableStringUnion } from '@mui/types';
4
- import { BadgeUnstyledTypeMap, ExtendBadgeUnstyledTypeMap } from '@mui/base/BadgeUnstyled';
4
+ import { BadgeTypeMap as BaseBadgeTypeMap, ExtendBadgeTypeMap } from '@mui/base/Badge';
5
5
  import { Theme } from '../styles';
6
6
  import { OverridableComponent, OverrideProps } from '../OverridableComponent';
7
7
  import { BadgeClasses } from './badgeClasses';
@@ -15,10 +15,7 @@ export interface BadgeOrigin {
15
15
  horizontal: 'left' | 'right';
16
16
  }
17
17
 
18
- export type BadgeTypeMap<
19
- D extends React.ElementType = 'span',
20
- P = {},
21
- > = ExtendBadgeUnstyledTypeMap<{
18
+ export type BadgeTypeMap<D extends React.ElementType = 'span', P = {}> = ExtendBadgeTypeMap<{
22
19
  props: P & {
23
20
  /**
24
21
  * The anchor of the badge.
@@ -55,7 +52,7 @@ export type BadgeTypeMap<
55
52
  *
56
53
  * @default {}
57
54
  */
58
- componentsProps?: BadgeUnstyledTypeMap['props']['slotProps'];
55
+ componentsProps?: BaseBadgeTypeMap['props']['slotProps'];
59
56
  /**
60
57
  * The components used for each slot inside.
61
58
  *
package/Button/Button.js CHANGED
@@ -61,6 +61,8 @@ const ButtonRoot = styled(ButtonBase, {
61
61
  ownerState
62
62
  }) => {
63
63
  var _theme$palette$getCon, _theme$palette;
64
+ const inheritContainedBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey[300] : theme.palette.grey[800];
65
+ const inheritContainedHoverBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey.A100 : theme.palette.grey[700];
64
66
  return _extends({}, theme.typography.button, {
65
67
  minWidth: 64,
66
68
  padding: '6px 16px',
@@ -89,7 +91,7 @@ const ButtonRoot = styled(ButtonBase, {
89
91
  backgroundColor: 'transparent'
90
92
  }
91
93
  }, ownerState.variant === 'contained' && {
92
- backgroundColor: (theme.vars || theme).palette.grey.A100,
94
+ backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedHoverBg : inheritContainedHoverBackgroundColor,
93
95
  boxShadow: (theme.vars || theme).shadows[4],
94
96
  // Reset on touch devices, it doesn't add specificity
95
97
  '@media (hover: none)': {
@@ -132,7 +134,7 @@ const ButtonRoot = styled(ButtonBase, {
132
134
  color: theme.vars ?
133
135
  // this is safe because grey does not change between default light/dark mode
134
136
  theme.vars.palette.text.primary : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, theme.palette.grey[300]),
135
- backgroundColor: (theme.vars || theme).palette.grey[300],
137
+ backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,
136
138
  boxShadow: (theme.vars || theme).shadows[2]
137
139
  }, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
138
140
  color: (theme.vars || theme).palette[ownerState.color].contrastText,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,147 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.12.2
4
+
5
+ <!-- generated comparing v5.12.1..master -->
6
+
7
+ _Apr 25, 2023_
8
+
9
+ A big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - ⚠️ **[BREAKING CHANGE]** The `Unstyled` suffix has been removed from Base UI component names, including names of types and other related identifiers – a codemod script is provided to assist with the change.
12
+ - 🐛 bug fixes and 📚 documentation improvements.
13
+
14
+ ### `@mui/material@5.12.2`
15
+
16
+ - &#8203;<!-- 10 -->[FormControl] Fix `filled` when value is set through `inputProps` (#36741) @sai6855
17
+ - &#8203;<!-- 07 -->[Slider] `onChange` handler should be called only when value has changed (#36706) @gitstart
18
+ - &#8203;<!-- 06 -->[Table] Fix `Sorting & Selecting` tables (#36898) @oliviertassinari
19
+
20
+ ### `@mui/base@5.0.0-alpha.127`
21
+
22
+ #### Breaking changes
23
+
24
+ - &#8203;<!-- 27 -->[base] Remove unstyled suffix from Base components + Codemod script (#36873) @hbjORbj
25
+
26
+ The `Unstyled` suffix has been removed from all Base UI component names, including names of types and other related identifiers.
27
+
28
+ You can use this [codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/src/v5.0.0/base-remove-unstyled-suffix.js) to help with the migration:
29
+
30
+ ```sh
31
+ npx @mui/codemod v5.0.0/base-remove-unstyled-suffix <path>
32
+ ```
33
+
34
+ #### Changes
35
+
36
+ - &#8203;<!-- 26 -->[codemod][base] Improve the removal of `component` prop codemod script (#36952) @hbjORbj
37
+ - &#8203;<!-- 25 -->[codemod][base] Write a migration script for removal of `component` prop from components (#36831) @hbjORbj
38
+ - &#8203;<!-- 24 -->[Base][useButton] Allow useButton params to be completely optional (#36922) @mj12albert
39
+
40
+ ### `@mui/joy@5.0.0-alpha.77`
41
+
42
+ - &#8203;<!-- 23 -->[Joy][Chip] Chip button not showing up in Firefox browser (#36930) @TakhyunKim
43
+ - &#8203;<!-- 09 -->[Joy] Add `invertedColors` to Menu and Alert (#36975) @siriwatknp
44
+ - &#8203;<!-- 08 -->[joy][Select] Set focus visible on select options when navigating with arrow keys (#36689) @gitstart
45
+
46
+ ### Docs
47
+
48
+ - &#8203;<!-- 21 -->[docs] Fix console error introduced by #36408 (#36980) @alexfauquette
49
+ - &#8203;<!-- 20 -->[docs] Add stray Joy UI documentation improvements (#36921) @danilo-leal
50
+ - &#8203;<!-- 19 -->[docs] Add Joy profile dashboard template (#36931) @siriwatknp
51
+ - &#8203;<!-- 18 -->[docs] Fix 404 links (#36969) @oliviertassinari
52
+ - &#8203;<!-- 17 -->[docs] Clarify when bundle size optimization is needed (#36823) @oliviertassinari
53
+ - &#8203;<!-- 16 -->[docs] Fix Chakra UI theme scoping typo (#36950) @mj12albert
54
+ - &#8203;<!-- 15 -->[docs] Add snackbar example using sonner (#36926) @PupoSDC
55
+ - &#8203;<!-- 14 -->[docs] Adjust the Material Icons page design and formatting (#36937) @danilo-leal
56
+ - &#8203;<!-- 13 -->[docs] Allows to customize menu with any icon (#36408) @alexfauquette
57
+ - &#8203;<!-- 12 -->[docs] Add info about passing ref to input element (#36913) @tomaskebrle
58
+ - &#8203;<!-- 11 -->[docs][material] Tabs API section cleanup (#36942) @mnajdova
59
+
60
+ ### Core
61
+
62
+ - &#8203;<!-- 22 -->[core] Fix CI failure on `master` (#37016) @hbjORbj
63
+ - &#8203;<!-- 05 -->[typescript] Add the missing explicit component return types (#36924) @michaldudak
64
+ - &#8203;<!-- 04 -->[website] Update main data grid demo on X landing page (#37001) @cherniavskii
65
+ - &#8203;<!-- 03 -->[website] Design role updates (#36997) @danilo-leal
66
+ - &#8203;<!-- 02 -->[website] X component section improvements (#36598) @danilo-leal
67
+ - &#8203;<!-- 01 -->[website] Developer Advocate role filled @oliviertassinari
68
+
69
+ All contributors of this release in alphabetical order: @alexfauquette, @cherniavskii, @danilo-leal, @gitstart, @hbjORbj, @michaldudak, @mj12albert, @mnajdova, @oliviertassinari, @PupoSDC, @sai6855, @siriwatknp, @TakhyunKim, @tomaskebrle
70
+
71
+ ## 5.12.1
72
+
73
+ <!-- generated comparing v5.12.0..master -->
74
+
75
+ _Apr 17, 2023_
76
+
77
+ A big thanks to the 16 contributors who made this release possible. This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
78
+
79
+ ### `@mui/material@5.12.1`
80
+
81
+ - &#8203;<!-- 24 -->[Autocomplete] Fix autocomplete left padding (#36649) @mj12albert
82
+ - &#8203;<!-- 17 -->[Button] Fix contained with inherit prop not adapting on dark mode (#34508) @jesrodri
83
+ - &#8203;<!-- 07 -->[FormControlLabel] Add `required` prop (#34207) @emlai
84
+ - &#8203;<!-- 04 -->[Tabs] Fix null reference in ScrollbarSize after unmounting (#36485) @rkdrnf
85
+ - &#8203;<!-- 03 -->[TextField] Fix type error when using `inputTypeSearch` class for `outlined` and `filled` inputs (#36740) @sai6855
86
+ - &#8203;<!-- 02 -->[ThemeProvider] Fix theme proptypes (#36852) @siriwatknp
87
+
88
+ ### `@mui/system@5.12.1`
89
+
90
+ #### Breaking changes
91
+
92
+ - &#8203;<!-- 06 -->[Grid2] Replace context with `cloneElement` (#36399) @siriwatknp
93
+
94
+ `Grid2` now uses `React.cloneElement` instead of React context for passing the spacing and columns to the next container. The change is close to how CSS flexbox behaves.
95
+
96
+ #### Changes
97
+
98
+ - &#8203;<!-- 14 -->[CssVarsProvider] Always generate new `css` object (#36853) @siriwatknp
99
+
100
+ ### `@mui/base@5.0.0-alpha.126`
101
+
102
+ #### Breaking changes
103
+
104
+ - &#8203;<!-- 23 -->[base] Refactor the compound components building blocks (#36400) @michaldudak
105
+ Components affected by the changes are:
106
+ - Menu
107
+ - `MenuUnstyledContext` is replaced by `MenuProvider`. The value to pass to the provider is returned by the `useMenu` hook.
108
+ - MenuUnstyled's `onClose` prop is replaced by `onOpenChange`. It has the `open` parameter and is called when a menu is opened or closed
109
+ - Select
110
+ - `SelectUnstyledContext` is replaced by `SelectProvider`. The value to pass to the provider is returned by the `useSelect` hook.
111
+ - `SelectUnstyled`'s popup is permanently mounted.
112
+ - The `defaultOpen` prop was added to the SelectUnstyled. The open/close state can now be controlled or uncontrolled, as a `value`.
113
+ - Tabs
114
+ - `TabsContext` is replaced by `TabsProvider`. The value to pass to the provider is returned by the `useTabs` hook.
115
+ - To deselect all tabs, pass in `null` to Tabs' `value` prop, instead of `false`. This is consistent with how Select works.
116
+ - The `value` prop is still technically not mandatory on TabUnstyled and TabPanel, but when omitted, the contents of the selected tab panel will not be rendered during SSR.
117
+
118
+ ### `@mui/joy@5.0.0-alpha.76`
119
+
120
+ - &#8203;<!-- 05 -->[Table][Joy] Replace uses of css selector `*-child` to `*-of-type` (#36839) @keyvanm
121
+
122
+ ### Docs
123
+
124
+ - &#8203;<!-- 25 --> [docs][base] Move styles to the bottom of demos code for `BadgeUnstyled` (#36723) @varunmulay22
125
+ - &#8203;<!-- 22 -->[docs][base] Mention that the hook does not accept any parameters in the `Parameters` section of the API docs (#36773) @ZeeshanTamboli
126
+ - &#8203;<!-- 21 -->[docs][base] Move styles to the bottom of demos code for `ModalUnstyled` (#36580) @gitstart
127
+ - &#8203;<!-- 20 -->[docs][base] Move styles to the bottom of demos code for `Tabs` (#36577) @gitstart
128
+ - &#8203;<!-- 19 -->[docs][base] Move styles to the bottom of demos code for `Popper` (#36578) @gitstart
129
+ - &#8203;<!-- 18 -->[docs][base] Move styles to the bottom of demos code for `TablePagination` (#36593) @gitstart
130
+ - &#8203;<!-- 13 -->[docs] Remove the incorrect info about useButton's ref parameter (#36883) @michaldudak
131
+ - &#8203;<!-- 12 -->[docs] Sync <Stack> between projects (#36785) @oliviertassinari
132
+ - &#8203;<!-- 11 -->[docs] Add guides to overriding component structure in Base UI and Joy UI docs (#34990) @samuelsycamore
133
+ - &#8203;<!-- 10 -->[docs] Content changed from 'row' to 'orientation=horizontal' (#36858) @navedqb
134
+ - &#8203;<!-- 09 -->[docs][Joy] `component`, `slots`, `slotProps` must be visible in Prop table in API docs (#36666) @hbjORbj
135
+ - &#8203;<!-- 08 -->[docs][Select] Fix duplicate ID in small size Select demo (#36792) @sai6855
136
+
137
+ ### Core
138
+
139
+ - &#8203;<!-- 16 -->[core] Use glob to find the test files in parseTest (#36305) @flaviendelangle
140
+ - &#8203;<!-- 15 -->[core] Fix minor SEO issues @oliviertassinari
141
+ - &#8203;<!-- 01 -->[website] Fix visual bug appbar (#36875) @oliviertassinari
142
+
143
+ All contributors of this release in alphabetical order: @emlai, @flaviendelangle, @gitstart, @hbjORbj, @jesrodri, @keyvanm, @michaldudak, @mj12albert, @navedqb, @oliviertassinari, @rkdrnf, @sai6855, @samuelsycamore, @siriwatknp, @varunmulay22, @ZeeshanTamboli
144
+
3
145
  ## 5.12.0
4
146
 
5
147
  <!-- generated comparing v5.11.16..master -->
@@ -33,6 +33,8 @@ export interface FilledInputClasses {
33
33
  inputAdornedStart: string;
34
34
  /** Styles applied to the input element if `endAdornment` is provided. */
35
35
  inputAdornedEnd: string;
36
+ /** Styles applied to the input element if `type="search"`. */
37
+ inputTypeSearch: string;
36
38
  }
37
39
  export type FilledInputClassKey = keyof FilledInputClasses;
38
40
  export declare function getFilledInputUtilityClass(slot: string): string;
@@ -138,7 +138,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
138
138
  if (!isMuiElement(child, ['Input', 'Select'])) {
139
139
  return;
140
140
  }
141
- if (isFilled(child.props, true)) {
141
+ if (isFilled(child.props, true) || isFilled(child.props.inputProps, true)) {
142
142
  initialFilled = true;
143
143
  }
144
144
  });
@@ -59,6 +59,10 @@ export interface FormControlLabelProps
59
59
  * You can pull out the new checked state by accessing `event.target.checked` (boolean).
60
60
  */
61
61
  onChange?: (event: React.SyntheticEvent, checked: boolean) => void;
62
+ /**
63
+ * If `true`, the label will indicate that the `input` is required.
64
+ */
65
+ required?: boolean;
62
66
  /**
63
67
  * The props used for each slot inside.
64
68
  * @default {}
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "slotProps", "value"];
3
+ const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -20,11 +20,13 @@ const useUtilityClasses = ownerState => {
20
20
  classes,
21
21
  disabled,
22
22
  labelPlacement,
23
- error
23
+ error,
24
+ required
24
25
  } = ownerState;
25
26
  const slots = {
26
- root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`, error && 'error'],
27
- label: ['label', disabled && 'disabled']
27
+ root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`, error && 'error', required && 'required'],
28
+ label: ['label', disabled && 'disabled'],
29
+ asterisk: ['asterisk', error && 'error']
28
30
  };
29
31
  return composeClasses(slots, getFormControlLabelUtilityClasses, classes);
30
32
  };
@@ -73,13 +75,24 @@ export const FormControlLabelRoot = styled('label', {
73
75
  }
74
76
  }
75
77
  }));
78
+ const AsteriskComponent = styled('span', {
79
+ name: 'MuiFormControlLabel',
80
+ slot: 'Asterisk',
81
+ overridesResolver: (props, styles) => styles.asterisk
82
+ })(({
83
+ theme
84
+ }) => ({
85
+ [`&.${formControlLabelClasses.error}`]: {
86
+ color: (theme.vars || theme).palette.error.main
87
+ }
88
+ }));
76
89
 
77
90
  /**
78
91
  * Drop-in replacement of the `Radio`, `Switch` and `Checkbox` component.
79
92
  * Use this component if you want to display an extra label.
80
93
  */
81
94
  const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(inProps, ref) {
82
- var _slotProps$typography;
95
+ var _ref, _slotProps$typography;
83
96
  const props = useThemeProps({
84
97
  props: inProps,
85
98
  name: 'MuiFormControlLabel'
@@ -92,19 +105,16 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
92
105
  disableTypography,
93
106
  label: labelProp,
94
107
  labelPlacement = 'end',
108
+ required: requiredProp,
95
109
  slotProps = {}
96
110
  } = props,
97
111
  other = _objectWithoutPropertiesLoose(props, _excluded);
98
112
  const muiFormControl = useFormControl();
99
- let disabled = disabledProp;
100
- if (typeof disabled === 'undefined' && typeof control.props.disabled !== 'undefined') {
101
- disabled = control.props.disabled;
102
- }
103
- if (typeof disabled === 'undefined' && muiFormControl) {
104
- disabled = muiFormControl.disabled;
105
- }
113
+ const disabled = (_ref = disabledProp != null ? disabledProp : control.props.disabled) != null ? _ref : muiFormControl == null ? void 0 : muiFormControl.disabled;
114
+ const required = requiredProp != null ? requiredProp : control.props.required;
106
115
  const controlProps = {
107
- disabled
116
+ disabled,
117
+ required
108
118
  };
109
119
  ['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(key => {
110
120
  if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {
@@ -119,6 +129,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
119
129
  const ownerState = _extends({}, props, {
120
130
  disabled,
121
131
  labelPlacement,
132
+ required,
122
133
  error: fcs.error
123
134
  });
124
135
  const classes = useUtilityClasses(ownerState);
@@ -137,7 +148,12 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
137
148
  ownerState: ownerState,
138
149
  ref: ref
139
150
  }, other, {
140
- children: [/*#__PURE__*/React.cloneElement(control, controlProps), label]
151
+ children: [/*#__PURE__*/React.cloneElement(control, controlProps), label, required && /*#__PURE__*/_jsxs(AsteriskComponent, {
152
+ ownerState: ownerState,
153
+ "aria-hidden": true,
154
+ className: classes.asterisk,
155
+ children: ["\u2009", '*']
156
+ })]
141
157
  }));
142
158
  });
143
159
  process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-proptypes */ = {
@@ -200,6 +216,10 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
200
216
  * You can pull out the new checked state by accessing `event.target.checked` (boolean).
201
217
  */
202
218
  onChange: PropTypes.func,
219
+ /**
220
+ * If `true`, the label will indicate that the `input` is required.
221
+ */
222
+ required: PropTypes.bool,
203
223
  /**
204
224
  * The props used for each slot inside.
205
225
  * @default {}
@@ -13,6 +13,10 @@ export interface FormControlLabelClasses {
13
13
  label: string;
14
14
  /** State class applied to the root element if `error={true}`. */
15
15
  error: string;
16
+ /** State class applied to the root element if `required={true}`. */
17
+ required: string;
18
+ /** Styles applied to the asterisk element. */
19
+ asterisk: string;
16
20
  }
17
21
  export type FormControlLabelClassKey = keyof FormControlLabelClasses;
18
22
  export declare function getFormControlLabelUtilityClasses(slot: string): string;
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
3
3
  export function getFormControlLabelUtilityClasses(slot) {
4
4
  return generateUtilityClass('MuiFormControlLabel', slot);
5
5
  }
6
- const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
6
+ const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error', 'required', 'asterisk']);
7
7
  export default formControlLabelClasses;
package/Modal/Modal.d.ts CHANGED
@@ -2,7 +2,10 @@ import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { OverrideProps } from '@mui/types';
4
4
  import { SlotComponentProps } from '@mui/base';
5
- import { ModalUnstyledTypeMap, ModalUnstyledClasses } from '@mui/base/ModalUnstyled';
5
+ import {
6
+ ModalTypeMap as BaseModalTypeMap,
7
+ ModalClasses as BaseModalClasses,
8
+ } from '@mui/base/Modal';
6
9
  import { Theme } from '../styles';
7
10
  import Backdrop, { BackdropProps } from '../Backdrop';
8
11
  import { OverridableComponent } from '../OverridableComponent';
@@ -38,7 +41,7 @@ export interface ModalTypeMap<D extends React.ElementType = 'div', P = {}> {
38
41
  /**
39
42
  * Override or extend the styles applied to the component.
40
43
  */
41
- classes?: Partial<ModalUnstyledClasses>;
44
+ classes?: Partial<BaseModalClasses>;
42
45
  /**
43
46
  * @ignore
44
47
  */
@@ -88,7 +91,7 @@ export interface ModalTypeMap<D extends React.ElementType = 'div', P = {}> {
88
91
  * The system prop that allows defining system overrides as well as additional CSS styles.
89
92
  */
90
93
  sx?: SxProps<Theme>;
91
- } & Omit<ModalUnstyledTypeMap['props'], 'slotProps'>;
94
+ } & Omit<BaseModalTypeMap['props'], 'slotProps'>;
92
95
  defaultComponent: D;
93
96
  }
94
97
 
package/Modal/Modal.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
3
+ const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
- import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/ModalUnstyled';
7
+ import ModalUnstyled, { modalClasses as modalUnstyledClasses } from '@mui/base/Modal';
8
8
  import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
9
9
  import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
10
10
  import styled from '../styles/styled';
@@ -70,6 +70,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
70
70
  className,
71
71
  closeAfterTransition = false,
72
72
  children,
73
+ container,
73
74
  component,
74
75
  components = {},
75
76
  componentsProps = {},
@@ -81,6 +82,9 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
81
82
  disableScrollLock = false,
82
83
  hideBackdrop = false,
83
84
  keepMounted = false,
85
+ onBackdropClick,
86
+ onClose,
87
+ open,
84
88
  slotProps,
85
89
  slots,
86
90
  // eslint-disable-next-line react/prop-types
@@ -89,6 +93,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
89
93
  other = _objectWithoutPropertiesLoose(props, _excluded);
90
94
  const [exited, setExited] = React.useState(true);
91
95
  const commonProps = {
96
+ container,
92
97
  closeAfterTransition,
93
98
  disableAutoFocus,
94
99
  disableEnforceFocus,
@@ -97,7 +102,10 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
97
102
  disableRestoreFocus,
98
103
  disableScrollLock,
99
104
  hideBackdrop,
100
- keepMounted
105
+ keepMounted,
106
+ onBackdropClick,
107
+ onClose,
108
+ open
101
109
  };
102
110
  const ownerState = _extends({}, props, commonProps, {
103
111
  exited
package/Modal/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from '@mui/base/ModalUnstyled'; // exporting ModalManager
1
+ export { ModalManager } from '@mui/base/Modal'; // exporting ModalManager
2
2
 
3
3
  export { default } from './Modal';
4
4
  export * from './Modal';
package/Modal/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from '@mui/base/ModalUnstyled';
1
+ export { ModalManager } from '@mui/base/Modal';
2
2
  export { default } from './Modal';
3
3
  export * from './Modal';
@@ -29,6 +29,8 @@ export interface OutlinedInputClasses {
29
29
  inputAdornedStart: string;
30
30
  /** Styles applied to the input element if `endAdornment` is provided. */
31
31
  inputAdornedEnd: string;
32
+ /** Styles applied to the input element if `type="search"`. */
33
+ inputTypeSearch: string;
32
34
  }
33
35
  export type OutlinedInputClassKey = keyof OutlinedInputClasses;
34
36
  export declare function getOutlinedInputUtilityClass(slot: string): string;
@@ -11,7 +11,7 @@ export interface OverridableComponent<M extends OverridableTypeMap> {
11
11
  // If you make any changes to this interface, please make sure to update the
12
12
  // `OverridableComponent` type in `mui-types/index.d.ts` as well.
13
13
  // Also, there are types in Base UI that have a similar shape to this interface
14
- // (e.g. SelectUnstyledType, OptionUnstyledType, etc.).
14
+ // (e.g. SelectType, OptionType, etc.).
15
15
  <C extends React.ElementType>(
16
16
  props: {
17
17
  /**
@@ -1,8 +1,8 @@
1
- import { PopperUnstyledProps } from '@mui/base/PopperUnstyled';
1
+ 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<PopperUnstyledProps, 'direction'> & {
5
+ export type PopperProps = Omit<BasePopperProps, 'direction'> & {
6
6
  /**
7
7
  * The components used for each slot inside the Popper.
8
8
  * Either a string to use a HTML element or a component.
@@ -15,7 +15,7 @@ export type PopperProps = Omit<PopperUnstyledProps, 'direction'> & {
15
15
  * The props used for each slot inside the Popper.
16
16
  * @default {}
17
17
  */
18
- componentsProps?: PopperUnstyledProps['slotProps'];
18
+ componentsProps?: BasePopperProps['slotProps'];
19
19
  /**
20
20
  * The system prop that allows defining system overrides as well as additional CSS styles.
21
21
  */
@@ -33,7 +33,7 @@ export type PopperProps = Omit<PopperUnstyledProps, 'direction'> & {
33
33
  *
34
34
  * - [Popper API](https://mui.com/material-ui/api/popper/)
35
35
  */
36
- declare const Popper: React.ForwardRefExoticComponent<Omit<PopperUnstyledProps<"div", {}>, "direction"> & {
36
+ declare const Popper: React.ForwardRefExoticComponent<Omit<BasePopperProps<"div", {}>, "direction"> & {
37
37
  /**
38
38
  * The components used for each slot inside the Popper.
39
39
  * Either a string to use a HTML element or a component.
@@ -46,7 +46,7 @@ declare const Popper: React.ForwardRefExoticComponent<Omit<PopperUnstyledProps<"
46
46
  * The props used for each slot inside the Popper.
47
47
  * @default {}
48
48
  */
49
- componentsProps?: PopperUnstyledProps['slotProps'];
49
+ componentsProps?: BasePopperProps['slotProps'];
50
50
  /**
51
51
  * The system prop that allows defining system overrides as well as additional CSS styles.
52
52
  */
package/Popper/Popper.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["components", "componentsProps", "slots", "slotProps"];
4
- import PopperUnstyled from '@mui/base/PopperUnstyled';
3
+ const _excluded = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
4
+ import BasePopper from '@mui/base/Popper';
5
5
  import { useThemeWithoutDefault as useTheme } from '@mui/system';
6
6
  import { HTMLElementType, refType } from '@mui/utils';
7
7
  import PropTypes from 'prop-types';
8
8
  import * as React from 'react';
9
9
  import { styled, useThemeProps } from '../styles';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const PopperRoot = styled(PopperUnstyled, {
11
+ const PopperRoot = styled(BasePopper, {
12
12
  name: 'MuiPopper',
13
13
  slot: 'Root',
14
14
  overridesResolver: (props, styles) => styles.root
@@ -34,20 +34,44 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
34
34
  name: 'MuiPopper'
35
35
  });
36
36
  const {
37
+ anchorEl,
38
+ component,
37
39
  components,
38
40
  componentsProps,
41
+ container,
42
+ disablePortal,
43
+ keepMounted,
44
+ modifiers,
45
+ open,
46
+ placement,
47
+ popperOptions,
48
+ popperRef,
49
+ transition,
39
50
  slots,
40
51
  slotProps
41
52
  } = props,
42
53
  other = _objectWithoutPropertiesLoose(props, _excluded);
43
54
  const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;
55
+ const otherProps = _extends({
56
+ anchorEl,
57
+ component,
58
+ container,
59
+ disablePortal,
60
+ keepMounted,
61
+ modifiers,
62
+ open,
63
+ placement,
64
+ popperOptions,
65
+ popperRef,
66
+ transition
67
+ }, other);
44
68
  return /*#__PURE__*/_jsx(PopperRoot, _extends({
45
69
  direction: theme == null ? void 0 : theme.direction,
46
70
  slots: {
47
71
  root: RootComponent
48
72
  },
49
73
  slotProps: slotProps != null ? slotProps : componentsProps
50
- }, other, {
74
+ }, otherProps, {
51
75
  ref: ref
52
76
  }));
53
77
  });
package/Popper/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { default } from './Popper';
2
2
  export * from './Popper';
3
- export { PopperPlacementType } from '@mui/base/PopperUnstyled';
3
+ export { PopperPlacementType } from '@mui/base/Popper';
package/Stack/Stack.d.ts CHANGED
@@ -28,7 +28,7 @@ export interface StackTypeMap<P = {}, D extends React.ElementType = 'div'> {
28
28
  /**
29
29
  * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
30
30
  *
31
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
31
+ * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
32
32
  * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
33
33
  *
34
34
  * To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
package/Stack/Stack.js CHANGED
@@ -49,7 +49,7 @@ process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ =
49
49
  /**
50
50
  * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
51
51
  *
52
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack#limitations),
52
+ * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
53
53
  * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
54
54
  *
55
55
  * To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
@@ -4,7 +4,7 @@ const _excluded = ["onChange"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import debounce from '../utils/debounce';
7
- import { ownerWindow } from '../utils';
7
+ import { ownerWindow, unstable_useEnhancedEffect as useEnhancedEffect } from '../utils';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  const styles = {
10
10
  width: 99,
@@ -29,7 +29,7 @@ export default function ScrollbarSize(props) {
29
29
  const setMeasurements = () => {
30
30
  scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight;
31
31
  };
32
- React.useEffect(() => {
32
+ useEnhancedEffect(() => {
33
33
  const handleResize = debounce(() => {
34
34
  const prevHeight = scrollbarHeight.current;
35
35
  setMeasurements();