@mui/material 5.15.4 → 5.15.5

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 (53) hide show
  1. package/Accordion/Accordion.d.ts +30 -2
  2. package/Accordion/Accordion.js +39 -6
  3. package/AccordionSummary/accordionSummaryClasses.d.ts +4 -1
  4. package/Alert/Alert.d.ts +4 -2
  5. package/Alert/Alert.js +1 -1
  6. package/Badge/Badge.js +1 -1
  7. package/CHANGELOG.md +98 -0
  8. package/Divider/Divider.d.ts +1 -0
  9. package/Divider/Divider.js +1 -0
  10. package/Divider/dividerClasses.d.ts +6 -2
  11. package/Rating/Rating.js +1 -10
  12. package/SpeedDial/SpeedDial.js +1 -9
  13. package/index.js +1 -1
  14. package/legacy/Accordion/Accordion.js +44 -7
  15. package/legacy/Alert/Alert.js +1 -1
  16. package/legacy/Badge/Badge.js +1 -1
  17. package/legacy/Divider/Divider.js +1 -0
  18. package/legacy/Rating/Rating.js +1 -10
  19. package/legacy/SpeedDial/SpeedDial.js +1 -9
  20. package/legacy/index.js +1 -1
  21. package/legacy/utils/types.js +1 -0
  22. package/legacy/utils/useSlot.js +71 -0
  23. package/legacy/zero-styled/index.js +2 -0
  24. package/modern/Accordion/Accordion.js +39 -6
  25. package/modern/Alert/Alert.js +1 -1
  26. package/modern/Badge/Badge.js +1 -1
  27. package/modern/Divider/Divider.js +1 -0
  28. package/modern/Rating/Rating.js +1 -10
  29. package/modern/SpeedDial/SpeedDial.js +1 -9
  30. package/modern/index.js +1 -1
  31. package/modern/utils/types.js +1 -0
  32. package/modern/utils/useSlot.js +82 -0
  33. package/modern/zero-styled/index.js +2 -0
  34. package/node/Accordion/Accordion.js +39 -6
  35. package/node/Alert/Alert.js +1 -1
  36. package/node/Badge/Badge.js +3 -3
  37. package/node/Divider/Divider.js +1 -0
  38. package/node/Rating/Rating.js +1 -10
  39. package/node/SpeedDial/SpeedDial.js +2 -10
  40. package/node/index.js +1 -1
  41. package/node/utils/types.js +5 -0
  42. package/node/utils/useSlot.js +88 -0
  43. package/node/zero-styled/index.js +13 -0
  44. package/package.json +7 -7
  45. package/umd/material-ui.development.js +600 -499
  46. package/umd/material-ui.production.min.js +4 -4
  47. package/utils/types.d.ts +27 -0
  48. package/utils/types.js +1 -0
  49. package/utils/useSlot.d.ts +84 -0
  50. package/utils/useSlot.js +82 -0
  51. package/zero-styled/index.d.ts +2 -0
  52. package/zero-styled/index.js +2 -0
  53. package/zero-styled/package.json +6 -0
@@ -5,6 +5,31 @@ import { TransitionProps } from '../transitions/transition';
5
5
  import { AccordionClasses } from './accordionClasses';
6
6
  import { OverridableComponent, OverrideProps } from '../OverridableComponent';
7
7
  import { ExtendPaperTypeMap } from '../Paper/Paper';
8
+ import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
9
+
10
+ export interface AccordionSlots {
11
+ /**
12
+ * The component that renders the transition.
13
+ * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
14
+ * @default Collapse
15
+ */
16
+ transition?: React.JSXElementConstructor<
17
+ TransitionProps & { children?: React.ReactElement<any, any> }
18
+ >;
19
+ }
20
+
21
+ export interface AccordionTransitionSlotPropsOverrides {}
22
+
23
+ export type AccordionSlotsAndSlotProps = CreateSlotsAndSlotProps<
24
+ AccordionSlots,
25
+ {
26
+ transition: SlotProps<
27
+ React.ElementType<TransitionProps>,
28
+ AccordionTransitionSlotPropsOverrides,
29
+ AccordionOwnerState
30
+ >;
31
+ }
32
+ >;
8
33
 
9
34
  export type AccordionTypeMap<
10
35
  AdditionalProps = {},
@@ -54,7 +79,7 @@ export type AccordionTypeMap<
54
79
  /**
55
80
  * The component used for the transition.
56
81
  * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
57
- * @default Collapse
82
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7.
58
83
  */
59
84
  TransitionComponent?: React.JSXElementConstructor<
60
85
  TransitionProps & { children?: React.ReactElement<any, any> }
@@ -62,9 +87,10 @@ export type AccordionTypeMap<
62
87
  /**
63
88
  * Props applied to the transition element.
64
89
  * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
90
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7.
65
91
  */
66
92
  TransitionProps?: TransitionProps;
67
- };
93
+ } & AccordionSlotsAndSlotProps;
68
94
  defaultComponent: RootComponent;
69
95
  },
70
96
  'onChange' | 'classes'
@@ -90,4 +116,6 @@ export type AccordionProps<
90
116
  component?: React.ElementType;
91
117
  };
92
118
 
119
+ export interface AccordionOwnerState extends AccordionProps {}
120
+
93
121
  export default Accordion;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
- const _excluded = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "TransitionComponent", "TransitionProps"];
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';
8
8
  import PropTypes from 'prop-types';
@@ -15,6 +15,7 @@ import Collapse from '../Collapse';
15
15
  import Paper from '../Paper';
16
16
  import AccordionContext from './AccordionContext';
17
17
  import useControlled from '../utils/useControlled';
18
+ import useSlot from '../utils/useSlot';
18
19
  import accordionClasses, { getAccordionUtilityClass } from './accordionClasses';
19
20
  import { jsx as _jsx } from "react/jsx-runtime";
20
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -127,8 +128,10 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
127
128
  expanded: expandedProp,
128
129
  onChange,
129
130
  square = false,
130
- TransitionComponent = Collapse,
131
- TransitionProps
131
+ slots = {},
132
+ slotProps = {},
133
+ TransitionComponent: TransitionComponentProp,
134
+ TransitionProps: TransitionPropsProp
132
135
  } = props,
133
136
  other = _objectWithoutPropertiesLoose(props, _excluded);
134
137
  const [expanded, setExpandedState] = useControlled({
@@ -157,6 +160,21 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
157
160
  expanded
158
161
  });
159
162
  const classes = useUtilityClasses(ownerState);
163
+ const backwardCompatibleSlots = _extends({
164
+ transition: TransitionComponentProp
165
+ }, slots);
166
+ const backwardCompatibleSlotProps = _extends({
167
+ transition: TransitionPropsProp
168
+ }, slotProps);
169
+ const [TransitionSlot, transitionProps] = useSlot('transition', {
170
+ elementType: Collapse,
171
+ externalForwardedProps: {
172
+ slots: backwardCompatibleSlots,
173
+ slotProps: backwardCompatibleSlotProps
174
+ },
175
+ ownerState
176
+ });
177
+ delete transitionProps.ownerState;
160
178
  return /*#__PURE__*/_jsxs(AccordionRoot, _extends({
161
179
  className: clsx(classes.root, className),
162
180
  ref: ref,
@@ -166,10 +184,10 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
166
184
  children: [/*#__PURE__*/_jsx(AccordionContext.Provider, {
167
185
  value: contextValue,
168
186
  children: summary
169
- }), /*#__PURE__*/_jsx(TransitionComponent, _extends({
187
+ }), /*#__PURE__*/_jsx(TransitionSlot, _extends({
170
188
  in: expanded,
171
189
  timeout: "auto"
172
- }, TransitionProps, {
190
+ }, transitionProps, {
173
191
  children: /*#__PURE__*/_jsx("div", {
174
192
  "aria-labelledby": summary.props.id,
175
193
  id: summary.props['aria-controls'],
@@ -233,6 +251,20 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
233
251
  * @param {boolean} expanded The `expanded` state of the accordion.
234
252
  */
235
253
  onChange: PropTypes.func,
254
+ /**
255
+ * The props used for each slot inside.
256
+ * @default {}
257
+ */
258
+ slotProps: PropTypes.shape({
259
+ transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
260
+ }),
261
+ /**
262
+ * The components used for each slot inside.
263
+ * @default {}
264
+ */
265
+ slots: PropTypes.shape({
266
+ transition: PropTypes.elementType
267
+ }),
236
268
  /**
237
269
  * If `true`, rounded corners are disabled.
238
270
  * @default false
@@ -245,12 +277,13 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
245
277
  /**
246
278
  * The component used for the transition.
247
279
  * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
248
- * @default Collapse
280
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7.
249
281
  */
250
282
  TransitionComponent: PropTypes.elementType,
251
283
  /**
252
284
  * Props applied to the transition element.
253
285
  * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
286
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7.
254
287
  */
255
288
  TransitionProps: PropTypes.object
256
289
  } : void 0;
@@ -9,7 +9,10 @@ export interface AccordionSummaryClasses {
9
9
  disabled: string;
10
10
  /** Styles applied to the root element unless `disableGutters={true}`. */
11
11
  gutters: string;
12
- /** Styles applied to the children wrapper element unless `disableGutters={true}`. */
12
+ /**
13
+ * Styles applied to the children wrapper element unless `disableGutters={true}`.
14
+ * @deprecated Combine the [.MuiAccordionSummary-gutters](/material-ui/api/accordion-summary/#AccordionSummary-classes-gutters) and [.MuiAccordionSummary-content](/material-ui/api/accordion-summary/#AccordionSummary-classes-content) classes instead.
15
+ */
13
16
  contentGutters: string;
14
17
  /** Styles applied to the children wrapper element. */
15
18
  content: string;
package/Alert/Alert.d.ts CHANGED
@@ -62,7 +62,7 @@ export interface AlertProps extends StandardProps<PaperProps, 'variant'> {
62
62
  * The severity of the alert. This defines the color and icon used.
63
63
  * @default 'success'
64
64
  */
65
- severity?: AlertColor;
65
+ severity?: OverridableStringUnion<AlertColor, AlertPropsColorOverrides>;
66
66
  /**
67
67
  * Override the icon displayed before the children.
68
68
  * Unless provided, the icon is mapped to the value of the `severity` prop.
@@ -80,7 +80,9 @@ export interface AlertProps extends StandardProps<PaperProps, 'variant'> {
80
80
  * If you wish to change this mapping, you can provide your own.
81
81
  * Alternatively, you can use the `icon` prop to override the icon displayed.
82
82
  */
83
- iconMapping?: Partial<Record<AlertColor, React.ReactNode>>;
83
+ iconMapping?: Partial<
84
+ Record<OverridableStringUnion<AlertColor, AlertPropsColorOverrides>, React.ReactNode>
85
+ >;
84
86
  /**
85
87
  * Callback fired when the component requests to be closed.
86
88
  * When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.
package/Alert/Alert.js CHANGED
@@ -289,7 +289,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
289
289
  * The severity of the alert. This defines the color and icon used.
290
290
  * @default 'success'
291
291
  */
292
- severity: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
292
+ severity: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),
293
293
  /**
294
294
  * The extra props for the slot components.
295
295
  * You can override the existing props or add new ones.
package/Badge/Badge.js CHANGED
@@ -10,7 +10,7 @@ import { usePreviousProps } from '@mui/utils';
10
10
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
11
11
  import { useBadge } from '@mui/base/useBadge';
12
12
  import { useSlotProps } from '@mui/base';
13
- import styled from '../styles/styled';
13
+ import { styled } from '../zero-styled';
14
14
  import useThemeProps from '../styles/useThemeProps';
15
15
  import capitalize from '../utils/capitalize';
16
16
  import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
package/CHANGELOG.md CHANGED
@@ -1,5 +1,103 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v5.15.5
4
+
5
+ <!-- generated comparing v5.15.4..master -->
6
+
7
+ _Jan 17, 2024_
8
+
9
+ A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - Base UI's CSS class prefix is now `base-` (#40205) @michaldudak
12
+ - Bug fixes, and a lot of improvements to code and docs infra
13
+
14
+ ### `@mui/material@5.15.5`
15
+
16
+ - &#8203;<!-- 42 -->[Accordion] Deprecate \*Props props and classes for v6 (#40418) @DiegoAndai
17
+ - &#8203;<!-- 41 -->[Alert] Update TypeScript types to allow color override types to be added to `iconMapping` and `severity` props (#40551) @2metres
18
+ - &#8203;<!-- 27 -->[Dialog] Remove deprecated onBackdropClick from Dialog tests (#40505) @sai6855
19
+ - &#8203;<!-- 26 -->[Divider] Deprecate props and classes for v6 (#40563) @sai6855
20
+
21
+ ### `@mui/material-next@6.0.0-alpha.118`
22
+
23
+ - &#8203;<!-- 36 -->[ButtonGroup] Apply MD3 style to `ButtonGroup` (#40124) @lhilgert9
24
+
25
+ ### `@mui/base@5.0.0-beta.32`
26
+
27
+ #### Breaking changes
28
+
29
+ - &#8203;<!-- 40 -->Change the CSS class prefix to `base-` (#40205) @michaldudak
30
+
31
+ The class prefix of Base UI components have been changed from `Mui-` to `base-`. This only affects codebases that uses class names verbatim, i.e. not exposed by JS objects such as `buttonClasses`, but as plain strings or in CSS stylesheets (`.MuiButton.root`)
32
+
33
+ To adapt your code to the new pattern:
34
+
35
+ - replace all occurrences of the regex `.Mui([A-Z][A-Za-z]*)-` with `.base-$1-` (so `MuiButton-root` becomes `base-Button-root`, etc.),
36
+ - replace all occurrences of the regex `.Mui-([a-z]*)` with `.base--$1` (so `Mui-disabled` becomes `base--disabled`, etc.).
37
+
38
+ #### Changes
39
+
40
+ - &#8203;<!-- 39 -->[Select] Fix screen-reader CSS to avoid body scrollbar (#40599) @brijeshb42
41
+ - &#8203;<!-- 38 -->[Switch] Add border-box to demos (#40638) @zanivan
42
+
43
+ ### `@mui/joy@5.0.0-beta.23`
44
+
45
+ - &#8203;<!-- 11 -->[ModalDialog] Fix ModalDialog layout prop override (#40512) @maakcode
46
+ - &#8203;<!-- 10 -->[RadioGroup] Allow zero number as a value (#40344) @aacevski
47
+
48
+ ### `@mui/codemod@5.15.5`
49
+
50
+ - &#8203;<!-- 31 -->Allow `json` files to be transformed (#40536) @ZeeshanTamboli
51
+
52
+ ### `@mui/lab@5.0.0-alpha.161`
53
+
54
+ - &#8203;<!-- 09 -->Update `@mui/material` peer dependency version (#40528) @ZeeshanTamboli
55
+
56
+ ### `@mui/material-nextjs@5.15.5`
57
+
58
+ - &#8203;<!-- 08 -->Fix release script (#40519) @petrovmiroslav
59
+ - &#8203;<!-- 07 -->Support Nonces in the App Router Provider (#40269) @josh-feldman
60
+ - &#8203;<!-- 06 -->Polish @mui/material-nextjs (#40473) @oliviertassinari
61
+
62
+ ### `@mui/system@5.15.5`
63
+
64
+ - &#8203;<!-- 05 -->Fix import path for @mui/system in vite apps (#40490) @brijeshb42
65
+ - &#8203;<!-- 02 -->Fix css vars generation and simplify the code (#40530) @siriwatknp
66
+ - &#8203;<!-- 01 -->Identify zero runtime styled path (#40555) @brijeshb42
67
+
68
+ ### Docs
69
+
70
+ - &#8203;<!-- 35 -->[joy-ui][Card] Fix text alignment in horizontal aligned card demo (#40562) @ZeeshanTamboli
71
+ - &#8203;<!-- 25 -->Improve instructions about peer dependencies (#40621) @danilo-leal
72
+ - &#8203;<!-- 24 -->Solve page description length @oliviertassinari
73
+ - &#8203;<!-- 23 -->Fix MUI Treasury links (#40561) @siriwatknp
74
+ - &#8203;<!-- 17 -->[material-ui] Update <ListItem button/> to ListItemButton in demos (#40564) @sai6855
75
+ - &#8203;<!-- 16 -->[material-ui] Revise the Snackbar page (#39298) @danilo-leal
76
+ - &#8203;<!-- 15 -->[material-ui] Sharpen Material 3 copy on demo pages (#40546) @samuelsycamore
77
+ - &#8203;<!-- 14 -->[material-ui] Fix typo on Next.js integration guide (#40538) @zanivan
78
+ - &#8203;<!-- 13 -->[material-ui][Snackbar] Remove unused `State` interface from Consecutive Snackbars demo (#40410)
79
+ @zinoroman
80
+ - &#8203;<!-- 12 -->[website] Resolve broken links reported by `docs:link-check` (#40547) @samuelsycamore
81
+
82
+ ### Core
83
+
84
+ - &#8203;<!-- 37 -->[blog] Fix 404 link to MUI Treasury @oliviertassinari
85
+ - &#8203;<!-- 34 -->[code-infra] Add `run` command to deploy docs (#40513) @siriwatknp
86
+ - &#8203;<!-- 32 -->[core] Update the lockfile (#40628) @michaldudak
87
+ - &#8203;<!-- 31 -->[core] Remove dead code and follow standard @oliviertassinari
88
+ - &#8203;<!-- 30 -->[core] Simplify server detection (#40471) @oliviertassinari
89
+ - &#8203;<!-- 29 -->[core] Sync playwright cache between MUI X and Material UI (#40475) @oliviertassinari
90
+ - &#8203;<!-- 28 -->[dependencies] Bump tough-cookie (#40437) @michaldudak
91
+ - &#8203;<!-- 22 -->[docs-infra] Enforce brand name rules (#40525) @oliviertassinari
92
+ - &#8203;<!-- 21 -->[docs-infra] Minimize ad layout shift on mobile (#40582) @oliviertassinari
93
+ - &#8203;<!-- 20 -->[docs-infra] Improve API page deprecation info (#40440) @DiegoAndai
94
+ - &#8203;<!-- 19 -->[docs-infra] Remove old tocs banners (#40537) @oliviertassinari
95
+ - &#8203;<!-- 18 -->[docs-infra] Remove dead code aria-label sponsors (#40526) @oliviertassinari
96
+ - &#8203;<!-- 04 -->[utils] Centralize clamp implementation in utils (#40267) @Kamino0
97
+ - &#8203;<!-- 03 -->[website] Polish the Base UI page demos (#40504) @danilo-leal
98
+
99
+ All contributors of this release in alphabetical order: @2metres, @aacevski, @brijeshb42, @danilo-leal, @DiegoAndai, @josh-feldman, @Kamino0, @lhilgert9, @maakcode, @michaldudak, @oliviertassinari, @petrovmiroslav, @sai6855, @samuelsycamore, @siriwatknp, @zanivan, @ZeeshanTamboli, @zinoroman
100
+
3
101
  ## 5.15.4
4
102
 
5
103
  <!-- generated comparing v5.15.3..master -->
@@ -30,6 +30,7 @@ export interface DividerOwnProps {
30
30
  /**
31
31
  * If `true`, the divider will have a lighter color.
32
32
  * @default false
33
+ * @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead.
33
34
  */
34
35
  light?: boolean;
35
36
  /**
@@ -221,6 +221,7 @@ process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */
221
221
  /**
222
222
  * If `true`, the divider will have a lighter color.
223
223
  * @default false
224
+ * @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead.
224
225
  */
225
226
  light: PropTypes.bool,
226
227
  /**
@@ -7,7 +7,9 @@ export interface DividerClasses {
7
7
  inset: string;
8
8
  /** Styles applied to the root element if `variant="fullWidth"`. */
9
9
  fullWidth: string;
10
- /** Styles applied to the root element if `light={true}`. */
10
+ /** Styles applied to the root element if `light={true}`.
11
+ * @deprecated
12
+ */
11
13
  light: string;
12
14
  /** Styles applied to the root element if `variant="middle"`. */
13
15
  middle: string;
@@ -17,7 +19,9 @@ export interface DividerClasses {
17
19
  flexItem: string;
18
20
  /** Styles applied to the root element if divider have text. */
19
21
  withChildren: string;
20
- /** Styles applied to the root element if divider have text and `orientation="vertical"`. */
22
+ /** Styles applied to the root element if divider have text and `orientation="vertical"`.
23
+ * @deprecated Combine the [.MuiDivider-withChildren](/material-ui/api/divider/#divider-classes-withChildren) and [.MuiDivider-vertical](/material-ui/api/divider/#divider-classes-vertical) classes instead.
24
+ */
21
25
  withChildrenVertical: string;
22
26
  /** Styles applied to the root element if `textAlign="right" orientation="horizontal"`. */
23
27
  textAlignRight: string;
package/Rating/Rating.js CHANGED
@@ -7,7 +7,7 @@ const _excluded = ["value"],
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
10
- import { chainPropTypes, visuallyHidden } from '@mui/utils';
10
+ import { chainPropTypes, visuallyHidden, clamp } from '@mui/utils';
11
11
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
12
12
  import useTheme from '../styles/useTheme';
13
13
  import { capitalize, useForkRef, useIsFocusVisible, useControlled, unstable_useId as useId } from '../utils';
@@ -18,15 +18,6 @@ import styled, { slotShouldForwardProp } from '../styles/styled';
18
18
  import ratingClasses, { getRatingUtilityClass } from './ratingClasses';
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
- function clamp(value, min, max) {
22
- if (value < min) {
23
- return min;
24
- }
25
- if (value > max) {
26
- return max;
27
- }
28
- return value;
29
- }
30
21
  function getDecimalPrecision(num) {
31
22
  const decimalPart = num.toString().split('.')[1];
32
23
  return decimalPart ? decimalPart.length : 0;
@@ -10,6 +10,7 @@ import { isFragment } from 'react-is';
10
10
  import PropTypes from 'prop-types';
11
11
  import clsx from 'clsx';
12
12
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
13
+ import { clamp } from '@mui/utils';
13
14
  import styled from '../styles/styled';
14
15
  import useThemeProps from '../styles/useThemeProps';
15
16
  import useTheme from '../styles/useTheme';
@@ -44,15 +45,6 @@ function getOrientation(direction) {
44
45
  }
45
46
  return undefined;
46
47
  }
47
- function clamp(value, min, max) {
48
- if (value < min) {
49
- return min;
50
- }
51
- if (value > max) {
52
- return max;
53
- }
54
- return value;
55
- }
56
48
  const dialRadius = 32;
57
49
  const spacingActions = 16;
58
50
  const SpeedDialRoot = styled('div', {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.15.4
2
+ * @mui/material v5.15.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -17,6 +17,7 @@ import Collapse from '../Collapse';
17
17
  import Paper from '../Paper';
18
18
  import AccordionContext from './AccordionContext';
19
19
  import useControlled from '../utils/useControlled';
20
+ import useSlot from '../utils/useSlot';
20
21
  import accordionClasses, { getAccordionUtilityClass } from './accordionClasses';
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
22
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -122,10 +123,13 @@ var Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
122
123
  onChange = props.onChange,
123
124
  _props$square = props.square,
124
125
  square = _props$square === void 0 ? false : _props$square,
125
- _props$TransitionComp = props.TransitionComponent,
126
- TransitionComponent = _props$TransitionComp === void 0 ? Collapse : _props$TransitionComp,
127
- TransitionProps = props.TransitionProps,
128
- other = _objectWithoutProperties(props, ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "TransitionComponent", "TransitionProps"]);
126
+ _props$slots = props.slots,
127
+ slots = _props$slots === void 0 ? {} : _props$slots,
128
+ _props$slotProps = props.slotProps,
129
+ slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
130
+ TransitionComponentProp = props.TransitionComponent,
131
+ TransitionPropsProp = props.TransitionProps,
132
+ other = _objectWithoutProperties(props, ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"]);
129
133
  var _useControlled = useControlled({
130
134
  controlled: expandedProp,
131
135
  default: defaultExpanded,
@@ -160,6 +164,24 @@ var Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
160
164
  expanded: expanded
161
165
  });
162
166
  var classes = useUtilityClasses(ownerState);
167
+ var backwardCompatibleSlots = _extends({
168
+ transition: TransitionComponentProp
169
+ }, slots);
170
+ var backwardCompatibleSlotProps = _extends({
171
+ transition: TransitionPropsProp
172
+ }, slotProps);
173
+ var _useSlot = useSlot('transition', {
174
+ elementType: Collapse,
175
+ externalForwardedProps: {
176
+ slots: backwardCompatibleSlots,
177
+ slotProps: backwardCompatibleSlotProps
178
+ },
179
+ ownerState: ownerState
180
+ }),
181
+ _useSlot2 = _slicedToArray(_useSlot, 2),
182
+ TransitionSlot = _useSlot2[0],
183
+ transitionProps = _useSlot2[1];
184
+ delete transitionProps.ownerState;
163
185
  return /*#__PURE__*/_jsxs(AccordionRoot, _extends({
164
186
  className: clsx(classes.root, className),
165
187
  ref: ref,
@@ -169,10 +191,10 @@ var Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
169
191
  children: [/*#__PURE__*/_jsx(AccordionContext.Provider, {
170
192
  value: contextValue,
171
193
  children: summary
172
- }), /*#__PURE__*/_jsx(TransitionComponent, _extends({
194
+ }), /*#__PURE__*/_jsx(TransitionSlot, _extends({
173
195
  in: expanded,
174
196
  timeout: "auto"
175
- }, TransitionProps, {
197
+ }, transitionProps, {
176
198
  children: /*#__PURE__*/_jsx("div", {
177
199
  "aria-labelledby": summary.props.id,
178
200
  id: summary.props['aria-controls'],
@@ -236,6 +258,20 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
236
258
  * @param {boolean} expanded The `expanded` state of the accordion.
237
259
  */
238
260
  onChange: PropTypes.func,
261
+ /**
262
+ * The props used for each slot inside.
263
+ * @default {}
264
+ */
265
+ slotProps: PropTypes.shape({
266
+ transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
267
+ }),
268
+ /**
269
+ * The components used for each slot inside.
270
+ * @default {}
271
+ */
272
+ slots: PropTypes.shape({
273
+ transition: PropTypes.elementType
274
+ }),
239
275
  /**
240
276
  * If `true`, rounded corners are disabled.
241
277
  * @default false
@@ -248,12 +284,13 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
248
284
  /**
249
285
  * The component used for the transition.
250
286
  * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
251
- * @default Collapse
287
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7.
252
288
  */
253
289
  TransitionComponent: PropTypes.elementType,
254
290
  /**
255
291
  * Props applied to the transition element.
256
292
  * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
293
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7.
257
294
  */
258
295
  TransitionProps: PropTypes.object
259
296
  } : void 0;
@@ -295,7 +295,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
295
295
  * The severity of the alert. This defines the color and icon used.
296
296
  * @default 'success'
297
297
  */
298
- severity: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
298
+ severity: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),
299
299
  /**
300
300
  * The extra props for the slot components.
301
301
  * You can override the existing props or add new ones.
@@ -11,7 +11,7 @@ import { usePreviousProps } from '@mui/utils';
11
11
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
12
12
  import { useBadge } from '@mui/base/useBadge';
13
13
  import { useSlotProps } from '@mui/base';
14
- import styled from '../styles/styled';
14
+ import { styled } from '../zero-styled';
15
15
  import useThemeProps from '../styles/useThemeProps';
16
16
  import capitalize from '../utils/capitalize';
17
17
  import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
@@ -226,6 +226,7 @@ process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */
226
226
  /**
227
227
  * If `true`, the divider will have a lighter color.
228
228
  * @default false
229
+ * @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead.
229
230
  */
230
231
  light: PropTypes.bool,
231
232
  /**
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
10
- import { chainPropTypes, visuallyHidden } from '@mui/utils';
10
+ import { chainPropTypes, visuallyHidden, clamp } from '@mui/utils';
11
11
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
12
12
  import useTheme from '../styles/useTheme';
13
13
  import { capitalize, useForkRef, useIsFocusVisible, useControlled, unstable_useId as useId } from '../utils';
@@ -18,15 +18,6 @@ import styled, { slotShouldForwardProp } from '../styles/styled';
18
18
  import ratingClasses, { getRatingUtilityClass } from './ratingClasses';
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
- function clamp(value, min, max) {
22
- if (value < min) {
23
- return min;
24
- }
25
- if (value > max) {
26
- return max;
27
- }
28
- return value;
29
- }
30
21
  function getDecimalPrecision(num) {
31
22
  var decimalPart = num.toString().split('.')[1];
32
23
  return decimalPart ? decimalPart.length : 0;
@@ -9,6 +9,7 @@ import { isFragment } from 'react-is';
9
9
  import PropTypes from 'prop-types';
10
10
  import clsx from 'clsx';
11
11
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
12
+ import { clamp } from '@mui/utils';
12
13
  import styled from '../styles/styled';
13
14
  import useThemeProps from '../styles/useThemeProps';
14
15
  import useTheme from '../styles/useTheme';
@@ -41,15 +42,6 @@ function getOrientation(direction) {
41
42
  }
42
43
  return undefined;
43
44
  }
44
- function clamp(value, min, max) {
45
- if (value < min) {
46
- return min;
47
- }
48
- if (value > max) {
49
- return max;
50
- }
51
- return value;
52
- }
53
45
  var dialRadius = 32;
54
46
  var spacingActions = 16;
55
47
  var SpeedDialRoot = styled('div', {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.15.4
2
+ * @mui/material v5.15.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1 @@
1
+ export {};