@mui/material 6.1.6 → 6.1.8
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.
- package/Accordion/Accordion.d.ts +2 -0
- package/Accordion/Accordion.js +2 -0
- package/Autocomplete/Autocomplete.d.ts +5 -0
- package/Autocomplete/Autocomplete.js +6 -1
- package/Avatar/Avatar.d.ts +1 -0
- package/Avatar/Avatar.js +1 -0
- package/Backdrop/Backdrop.d.ts +1 -0
- package/Backdrop/Backdrop.js +1 -0
- package/CHANGELOG.md +111 -4
- package/Grid/Grid.js +2 -2
- package/Grid2/grid2Classes.js +1 -1
- package/Rating/Rating.d.ts +21 -4
- package/Rating/Rating.js +12 -0
- package/SpeedDial/SpeedDial.d.ts +2 -0
- package/SpeedDial/SpeedDial.js +2 -0
- package/StepIcon/StepIcon.d.ts +5 -2
- package/StepLabel/StepLabel.d.ts +2 -0
- package/StepLabel/StepLabel.js +2 -0
- package/Tooltip/Tooltip.d.ts +69 -36
- package/Tooltip/Tooltip.js +84 -58
- package/index.js +1 -1
- package/modern/Accordion/Accordion.js +2 -0
- package/modern/Autocomplete/Autocomplete.js +6 -1
- package/modern/Avatar/Avatar.js +1 -0
- package/modern/Backdrop/Backdrop.js +1 -0
- package/modern/Grid/Grid.js +2 -2
- package/modern/Grid2/grid2Classes.js +1 -1
- package/modern/Rating/Rating.js +12 -0
- package/modern/SpeedDial/SpeedDial.js +2 -0
- package/modern/StepLabel/StepLabel.js +2 -0
- package/modern/Tooltip/Tooltip.js +84 -58
- package/modern/index.js +1 -1
- package/modern/useMediaQuery/index.js +6 -1
- package/modern/version/index.js +2 -2
- package/node/Accordion/Accordion.js +2 -0
- package/node/Autocomplete/Autocomplete.js +6 -1
- package/node/Avatar/Avatar.js +1 -0
- package/node/Backdrop/Backdrop.js +1 -0
- package/node/Grid/Grid.js +2 -2
- package/node/Grid2/grid2Classes.js +1 -1
- package/node/Rating/Rating.js +12 -0
- package/node/SpeedDial/SpeedDial.js +2 -0
- package/node/StepLabel/StepLabel.js +2 -0
- package/node/Tooltip/Tooltip.js +84 -58
- package/node/index.js +1 -1
- package/node/useMediaQuery/index.js +6 -6
- package/node/version/index.js +2 -2
- package/package.json +5 -5
- package/useMediaQuery/index.d.ts +11 -1
- package/useMediaQuery/index.js +6 -1
- package/version/index.js +2 -2
package/Tooltip/Tooltip.d.ts
CHANGED
|
@@ -2,12 +2,71 @@ import * as React from 'react';
|
|
|
2
2
|
import { MUIStyledCommonProps, SxProps } from '@mui/system';
|
|
3
3
|
import { PopperProps } from '@mui/material/Popper';
|
|
4
4
|
import { InternalStandardProps as StandardProps, Theme } from '..';
|
|
5
|
+
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
|
|
5
6
|
import { TransitionProps } from '../transitions/transition';
|
|
6
7
|
import { TooltipClasses } from './tooltipClasses';
|
|
7
8
|
|
|
8
9
|
export interface TooltipComponentsPropsOverrides {}
|
|
9
10
|
|
|
10
|
-
export interface
|
|
11
|
+
export interface TooltipPopperSlotPropsOverrides {}
|
|
12
|
+
|
|
13
|
+
export interface TooltipTransitionSlotPropsOverrides {}
|
|
14
|
+
|
|
15
|
+
export interface TooltipTooltipSlotPropsOverrides {}
|
|
16
|
+
|
|
17
|
+
export interface TooltipArrowSlotPropsOverrides {}
|
|
18
|
+
|
|
19
|
+
export interface TooltipSlots {
|
|
20
|
+
/**
|
|
21
|
+
* The component used for the popper.
|
|
22
|
+
* @default Popper
|
|
23
|
+
*/
|
|
24
|
+
popper: React.ElementType<PopperProps>;
|
|
25
|
+
/**
|
|
26
|
+
* The component used for the transition.
|
|
27
|
+
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
28
|
+
* @default Grow
|
|
29
|
+
*/
|
|
30
|
+
transition: React.ElementType;
|
|
31
|
+
/**
|
|
32
|
+
* The component used for the tooltip.
|
|
33
|
+
*/
|
|
34
|
+
tooltip: React.ElementType;
|
|
35
|
+
/**
|
|
36
|
+
* The component used for the arrow.
|
|
37
|
+
*/
|
|
38
|
+
arrow: React.ElementType;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type TooltipSlotsAndSlotProps = CreateSlotsAndSlotProps<
|
|
42
|
+
TooltipSlots,
|
|
43
|
+
{
|
|
44
|
+
popper: SlotProps<
|
|
45
|
+
React.ElementType<PopperProps>,
|
|
46
|
+
TooltipPopperSlotPropsOverrides,
|
|
47
|
+
TooltipOwnerState
|
|
48
|
+
>;
|
|
49
|
+
transition: SlotProps<
|
|
50
|
+
React.ElementType<TransitionProps>,
|
|
51
|
+
TooltipTransitionSlotPropsOverrides,
|
|
52
|
+
TooltipOwnerState
|
|
53
|
+
>;
|
|
54
|
+
tooltip: SlotProps<
|
|
55
|
+
React.ElementType<React.HTMLProps<HTMLDivElement>>,
|
|
56
|
+
TooltipTooltipSlotPropsOverrides,
|
|
57
|
+
TooltipOwnerState
|
|
58
|
+
>;
|
|
59
|
+
arrow: SlotProps<
|
|
60
|
+
React.ElementType<React.HTMLProps<HTMLSpanElement>>,
|
|
61
|
+
TooltipArrowSlotPropsOverrides,
|
|
62
|
+
TooltipOwnerState
|
|
63
|
+
>;
|
|
64
|
+
}
|
|
65
|
+
>;
|
|
66
|
+
|
|
67
|
+
export interface TooltipProps
|
|
68
|
+
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, 'title'>,
|
|
69
|
+
TooltipSlotsAndSlotProps {
|
|
11
70
|
/**
|
|
12
71
|
* If `true`, adds an arrow to the tooltip.
|
|
13
72
|
* @default false
|
|
@@ -24,7 +83,7 @@ export interface TooltipProps extends StandardProps<React.HTMLAttributes<HTMLDiv
|
|
|
24
83
|
/**
|
|
25
84
|
* The components used for each slot inside.
|
|
26
85
|
*
|
|
27
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
86
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
28
87
|
*
|
|
29
88
|
* @default {}
|
|
30
89
|
*/
|
|
@@ -38,7 +97,7 @@ export interface TooltipProps extends StandardProps<React.HTMLAttributes<HTMLDiv
|
|
|
38
97
|
* The extra props for the slot components.
|
|
39
98
|
* You can override the existing props or add new ones.
|
|
40
99
|
*
|
|
41
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
100
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
42
101
|
*
|
|
43
102
|
* @default {}
|
|
44
103
|
*/
|
|
@@ -151,45 +210,15 @@ export interface TooltipProps extends StandardProps<React.HTMLAttributes<HTMLDiv
|
|
|
151
210
|
| 'top';
|
|
152
211
|
/**
|
|
153
212
|
* The component used for the popper.
|
|
154
|
-
* @
|
|
213
|
+
* @deprecated use the `slots.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
155
214
|
*/
|
|
156
215
|
PopperComponent?: React.JSXElementConstructor<PopperProps>;
|
|
157
216
|
/**
|
|
158
217
|
* Props applied to the [`Popper`](https://mui.com/material-ui/api/popper/) element.
|
|
218
|
+
* @deprecated use the `slotProps.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
159
219
|
* @default {}
|
|
160
220
|
*/
|
|
161
221
|
PopperProps?: Partial<PopperProps>;
|
|
162
|
-
/**
|
|
163
|
-
* The extra props for the slot components.
|
|
164
|
-
* You can override the existing props or add new ones.
|
|
165
|
-
*
|
|
166
|
-
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
167
|
-
*
|
|
168
|
-
* @default {}
|
|
169
|
-
*/
|
|
170
|
-
slotProps?: {
|
|
171
|
-
popper?: Partial<PopperProps> & TooltipComponentsPropsOverrides;
|
|
172
|
-
transition?: TransitionProps & TooltipComponentsPropsOverrides;
|
|
173
|
-
tooltip?: React.HTMLProps<HTMLDivElement> &
|
|
174
|
-
MUIStyledCommonProps<Theme> &
|
|
175
|
-
TooltipComponentsPropsOverrides;
|
|
176
|
-
arrow?: React.HTMLProps<HTMLSpanElement> &
|
|
177
|
-
MUIStyledCommonProps<Theme> &
|
|
178
|
-
TooltipComponentsPropsOverrides;
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* The components used for each slot inside.
|
|
182
|
-
*
|
|
183
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
184
|
-
*
|
|
185
|
-
* @default {}
|
|
186
|
-
*/
|
|
187
|
-
slots?: {
|
|
188
|
-
popper?: React.ElementType<PopperProps>;
|
|
189
|
-
transition?: React.ElementType;
|
|
190
|
-
tooltip?: React.ElementType;
|
|
191
|
-
arrow?: React.ElementType;
|
|
192
|
-
};
|
|
193
222
|
/**
|
|
194
223
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
195
224
|
*/
|
|
@@ -201,7 +230,7 @@ export interface TooltipProps extends StandardProps<React.HTMLAttributes<HTMLDiv
|
|
|
201
230
|
/**
|
|
202
231
|
* The component used for the transition.
|
|
203
232
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
204
|
-
* @
|
|
233
|
+
* @deprecated use the `slots.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
205
234
|
*/
|
|
206
235
|
TransitionComponent?: React.JSXElementConstructor<
|
|
207
236
|
TransitionProps & { children: React.ReactElement<unknown, any> }
|
|
@@ -209,10 +238,14 @@ export interface TooltipProps extends StandardProps<React.HTMLAttributes<HTMLDiv
|
|
|
209
238
|
/**
|
|
210
239
|
* Props applied to the transition element.
|
|
211
240
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
241
|
+
* @deprecated use the `slotProps.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
242
|
+
* @default {}
|
|
212
243
|
*/
|
|
213
244
|
TransitionProps?: TransitionProps;
|
|
214
245
|
}
|
|
215
246
|
|
|
247
|
+
export interface TooltipOwnerState extends TooltipProps {}
|
|
248
|
+
|
|
216
249
|
/**
|
|
217
250
|
*
|
|
218
251
|
* Demos:
|
package/Tooltip/Tooltip.js
CHANGED
|
@@ -9,7 +9,6 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
9
9
|
import { alpha } from '@mui/system/colorManipulator';
|
|
10
10
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
11
11
|
import isFocusVisible from '@mui/utils/isFocusVisible';
|
|
12
|
-
import appendOwnerState from '@mui/utils/appendOwnerState';
|
|
13
12
|
import getReactElementRef from '@mui/utils/getReactElementRef';
|
|
14
13
|
import { styled, useTheme } from "../zero-styled/index.js";
|
|
15
14
|
import memoTheme from "../utils/memoTheme.js";
|
|
@@ -21,6 +20,7 @@ import useEventCallback from "../utils/useEventCallback.js";
|
|
|
21
20
|
import useForkRef from "../utils/useForkRef.js";
|
|
22
21
|
import useId from "../utils/useId.js";
|
|
23
22
|
import useControlled from "../utils/useControlled.js";
|
|
23
|
+
import useSlot from "../utils/useSlot.js";
|
|
24
24
|
import tooltipClasses, { getTooltipUtilityClass } from "./tooltipClasses.js";
|
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
function round(value) {
|
|
@@ -342,7 +342,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
342
342
|
slotProps = {},
|
|
343
343
|
slots = {},
|
|
344
344
|
title,
|
|
345
|
-
TransitionComponent: TransitionComponentProp
|
|
345
|
+
TransitionComponent: TransitionComponentProp,
|
|
346
346
|
TransitionProps,
|
|
347
347
|
...other
|
|
348
348
|
} = props;
|
|
@@ -592,6 +592,16 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
592
592
|
console.error(['MUI: You have provided a `title` prop to the child of <Tooltip />.', `Remove this title prop \`${children.props.title}\` or the Tooltip component.`].join('\n'));
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
+
const ownerState = {
|
|
596
|
+
...props,
|
|
597
|
+
isRtl,
|
|
598
|
+
arrow,
|
|
599
|
+
disableInteractive,
|
|
600
|
+
placement,
|
|
601
|
+
PopperComponentProp,
|
|
602
|
+
touch: ignoreNonTouchEvents.current
|
|
603
|
+
};
|
|
604
|
+
const resolvedPopperProps = typeof slotProps.popper === 'function' ? slotProps.popper(ownerState) : slotProps.popper;
|
|
595
605
|
const popperOptions = React.useMemo(() => {
|
|
596
606
|
let tooltipModifiers = [{
|
|
597
607
|
name: 'arrow',
|
|
@@ -604,44 +614,65 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
604
614
|
if (PopperProps.popperOptions?.modifiers) {
|
|
605
615
|
tooltipModifiers = tooltipModifiers.concat(PopperProps.popperOptions.modifiers);
|
|
606
616
|
}
|
|
617
|
+
if (resolvedPopperProps?.popperOptions?.modifiers) {
|
|
618
|
+
tooltipModifiers = tooltipModifiers.concat(resolvedPopperProps.popperOptions.modifiers);
|
|
619
|
+
}
|
|
607
620
|
return {
|
|
608
621
|
...PopperProps.popperOptions,
|
|
622
|
+
...resolvedPopperProps?.popperOptions,
|
|
609
623
|
modifiers: tooltipModifiers
|
|
610
624
|
};
|
|
611
|
-
}, [arrowRef, PopperProps]);
|
|
612
|
-
const ownerState = {
|
|
613
|
-
...props,
|
|
614
|
-
isRtl,
|
|
615
|
-
arrow,
|
|
616
|
-
disableInteractive,
|
|
617
|
-
placement,
|
|
618
|
-
PopperComponentProp,
|
|
619
|
-
touch: ignoreNonTouchEvents.current
|
|
620
|
-
};
|
|
625
|
+
}, [arrowRef, PopperProps.popperOptions, resolvedPopperProps?.popperOptions]);
|
|
621
626
|
const classes = useUtilityClasses(ownerState);
|
|
622
|
-
const
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
627
|
+
const resolvedTransitionProps = typeof slotProps.transition === 'function' ? slotProps.transition(ownerState) : slotProps.transition;
|
|
628
|
+
const externalForwardedProps = {
|
|
629
|
+
slots: {
|
|
630
|
+
popper: components.Popper,
|
|
631
|
+
transition: components.Transition ?? TransitionComponentProp,
|
|
632
|
+
tooltip: components.Tooltip,
|
|
633
|
+
arrow: components.Arrow,
|
|
634
|
+
...slots
|
|
635
|
+
},
|
|
636
|
+
slotProps: {
|
|
637
|
+
arrow: slotProps.arrow ?? componentsProps.arrow,
|
|
638
|
+
popper: {
|
|
639
|
+
...PopperProps,
|
|
640
|
+
...(resolvedPopperProps ?? componentsProps.popper)
|
|
641
|
+
},
|
|
642
|
+
// resolvedPopperProps can be spread because it's already an object
|
|
643
|
+
tooltip: slotProps.tooltip ?? componentsProps.tooltip,
|
|
644
|
+
transition: {
|
|
645
|
+
...TransitionProps,
|
|
646
|
+
...(resolvedTransitionProps ?? componentsProps.transition)
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
const [PopperSlot, popperSlotProps] = useSlot('popper', {
|
|
651
|
+
elementType: TooltipPopper,
|
|
652
|
+
externalForwardedProps,
|
|
653
|
+
ownerState,
|
|
654
|
+
className: clsx(classes.popper, PopperProps?.className)
|
|
655
|
+
});
|
|
656
|
+
const [TransitionSlot, transitionSlotProps] = useSlot('transition', {
|
|
657
|
+
elementType: Grow,
|
|
658
|
+
externalForwardedProps,
|
|
659
|
+
ownerState
|
|
660
|
+
});
|
|
661
|
+
const [TooltipSlot, tooltipSlotProps] = useSlot('tooltip', {
|
|
662
|
+
elementType: TooltipTooltip,
|
|
663
|
+
className: classes.tooltip,
|
|
664
|
+
externalForwardedProps,
|
|
665
|
+
ownerState
|
|
666
|
+
});
|
|
667
|
+
const [ArrowSlot, arrowSlotProps] = useSlot('arrow', {
|
|
668
|
+
elementType: TooltipArrow,
|
|
669
|
+
className: classes.arrow,
|
|
670
|
+
externalForwardedProps,
|
|
671
|
+
ownerState,
|
|
672
|
+
ref: setArrowRef
|
|
673
|
+
});
|
|
643
674
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
644
|
-
children: [/*#__PURE__*/React.cloneElement(children, childrenProps), /*#__PURE__*/_jsx(
|
|
675
|
+
children: [/*#__PURE__*/React.cloneElement(children, childrenProps), /*#__PURE__*/_jsx(PopperSlot, {
|
|
645
676
|
as: PopperComponentProp ?? Popper,
|
|
646
677
|
placement: placement,
|
|
647
678
|
anchorEl: followCursor ? {
|
|
@@ -659,19 +690,18 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
659
690
|
id: id,
|
|
660
691
|
transition: true,
|
|
661
692
|
...interactiveWrapperListeners,
|
|
662
|
-
...
|
|
693
|
+
...popperSlotProps,
|
|
663
694
|
popperOptions: popperOptions,
|
|
664
695
|
children: ({
|
|
665
696
|
TransitionProps: TransitionPropsInner
|
|
666
|
-
}) => /*#__PURE__*/_jsx(
|
|
697
|
+
}) => /*#__PURE__*/_jsx(TransitionSlot, {
|
|
667
698
|
timeout: theme.transitions.duration.shorter,
|
|
668
699
|
...TransitionPropsInner,
|
|
669
|
-
...
|
|
670
|
-
children: /*#__PURE__*/_jsxs(
|
|
671
|
-
...
|
|
672
|
-
children: [title, arrow ? /*#__PURE__*/_jsx(
|
|
673
|
-
...
|
|
674
|
-
ref: setArrowRef
|
|
700
|
+
...transitionSlotProps,
|
|
701
|
+
children: /*#__PURE__*/_jsxs(TooltipSlot, {
|
|
702
|
+
...tooltipSlotProps,
|
|
703
|
+
children: [title, arrow ? /*#__PURE__*/_jsx(ArrowSlot, {
|
|
704
|
+
...arrowSlotProps
|
|
675
705
|
}) : null]
|
|
676
706
|
})
|
|
677
707
|
})
|
|
@@ -703,7 +733,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
|
|
|
703
733
|
/**
|
|
704
734
|
* The components used for each slot inside.
|
|
705
735
|
*
|
|
706
|
-
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [
|
|
736
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
707
737
|
*
|
|
708
738
|
* @default {}
|
|
709
739
|
*/
|
|
@@ -717,7 +747,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
|
|
|
717
747
|
* The extra props for the slot components.
|
|
718
748
|
* You can override the existing props or add new ones.
|
|
719
749
|
*
|
|
720
|
-
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [
|
|
750
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
721
751
|
*
|
|
722
752
|
* @default {}
|
|
723
753
|
*/
|
|
@@ -814,33 +844,27 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
|
|
|
814
844
|
placement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
815
845
|
/**
|
|
816
846
|
* The component used for the popper.
|
|
817
|
-
* @
|
|
847
|
+
* @deprecated use the `slots.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
818
848
|
*/
|
|
819
849
|
PopperComponent: PropTypes.elementType,
|
|
820
850
|
/**
|
|
821
851
|
* Props applied to the [`Popper`](https://mui.com/material-ui/api/popper/) element.
|
|
852
|
+
* @deprecated use the `slotProps.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
822
853
|
* @default {}
|
|
823
854
|
*/
|
|
824
855
|
PopperProps: PropTypes.object,
|
|
825
856
|
/**
|
|
826
|
-
* The
|
|
827
|
-
* You can override the existing props or add new ones.
|
|
828
|
-
*
|
|
829
|
-
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
830
|
-
*
|
|
857
|
+
* The props used for each slot inside.
|
|
831
858
|
* @default {}
|
|
832
859
|
*/
|
|
833
860
|
slotProps: PropTypes.shape({
|
|
834
|
-
arrow: PropTypes.object,
|
|
835
|
-
popper: PropTypes.object,
|
|
836
|
-
tooltip: PropTypes.object,
|
|
837
|
-
transition: PropTypes.object
|
|
861
|
+
arrow: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
862
|
+
popper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
863
|
+
tooltip: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
864
|
+
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
838
865
|
}),
|
|
839
866
|
/**
|
|
840
867
|
* The components used for each slot inside.
|
|
841
|
-
*
|
|
842
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
843
|
-
*
|
|
844
868
|
* @default {}
|
|
845
869
|
*/
|
|
846
870
|
slots: PropTypes.shape({
|
|
@@ -860,12 +884,14 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
|
|
|
860
884
|
/**
|
|
861
885
|
* The component used for the transition.
|
|
862
886
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
863
|
-
* @
|
|
887
|
+
* @deprecated use the `slots.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
864
888
|
*/
|
|
865
889
|
TransitionComponent: PropTypes.elementType,
|
|
866
890
|
/**
|
|
867
891
|
* Props applied to the transition element.
|
|
868
892
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
893
|
+
* @deprecated use the `slotProps.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
894
|
+
* @default {}
|
|
869
895
|
*/
|
|
870
896
|
TransitionProps: PropTypes.object
|
|
871
897
|
} : void 0;
|
package/index.js
CHANGED
|
@@ -303,11 +303,13 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
|
|
|
303
303
|
/**
|
|
304
304
|
* The component used for the transition.
|
|
305
305
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
306
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
306
307
|
*/
|
|
307
308
|
TransitionComponent: PropTypes.elementType,
|
|
308
309
|
/**
|
|
309
310
|
* Props applied to the transition element.
|
|
310
311
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
312
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
311
313
|
*/
|
|
312
314
|
TransitionProps: PropTypes.object
|
|
313
315
|
} : void 0;
|
|
@@ -323,7 +323,7 @@ const AutocompleteNoOptions = styled('div', {
|
|
|
323
323
|
color: (theme.vars || theme).palette.text.secondary,
|
|
324
324
|
padding: '14px 16px'
|
|
325
325
|
})));
|
|
326
|
-
const AutocompleteListbox = styled('
|
|
326
|
+
const AutocompleteListbox = styled('ul', {
|
|
327
327
|
name: 'MuiAutocomplete',
|
|
328
328
|
slot: 'Listbox',
|
|
329
329
|
overridesResolver: (props, styles) => styles.listbox
|
|
@@ -792,6 +792,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
792
792
|
blurOnSelect: PropTypes.oneOfType([PropTypes.oneOf(['mouse', 'touch']), PropTypes.bool]),
|
|
793
793
|
/**
|
|
794
794
|
* Props applied to the [`Chip`](https://mui.com/material-ui/api/chip/) element.
|
|
795
|
+
* @deprecated Use `slotProps.chip` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
795
796
|
*/
|
|
796
797
|
ChipProps: PropTypes.object,
|
|
797
798
|
/**
|
|
@@ -994,10 +995,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
994
995
|
/**
|
|
995
996
|
* The component used to render the listbox.
|
|
996
997
|
* @default 'ul'
|
|
998
|
+
* @deprecated Use `slotProps.listbox.component` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
997
999
|
*/
|
|
998
1000
|
ListboxComponent: PropTypes.elementType,
|
|
999
1001
|
/**
|
|
1000
1002
|
* Props applied to the Listbox element.
|
|
1003
|
+
* @deprecated Use `slotProps.listbox` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1001
1004
|
*/
|
|
1002
1005
|
ListboxProps: PropTypes.object,
|
|
1003
1006
|
/**
|
|
@@ -1092,11 +1095,13 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
1092
1095
|
/**
|
|
1093
1096
|
* The component used to render the body of the popup.
|
|
1094
1097
|
* @default Paper
|
|
1098
|
+
* @deprecated Use `slots.paper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1095
1099
|
*/
|
|
1096
1100
|
PaperComponent: PropTypes.elementType,
|
|
1097
1101
|
/**
|
|
1098
1102
|
* The component used to position the popup.
|
|
1099
1103
|
* @default Popper
|
|
1104
|
+
* @deprecated Use `slots.popper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
1100
1105
|
*/
|
|
1101
1106
|
PopperComponent: PropTypes.elementType,
|
|
1102
1107
|
/**
|
package/modern/Avatar/Avatar.js
CHANGED
|
@@ -255,6 +255,7 @@ process.env.NODE_ENV !== "production" ? Avatar.propTypes /* remove-proptypes */
|
|
|
255
255
|
/**
|
|
256
256
|
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
|
|
257
257
|
* It can be used to listen for the loading error event.
|
|
258
|
+
* @deprecated Use `slotProps.img` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
258
259
|
*/
|
|
259
260
|
imgProps: PropTypes.object,
|
|
260
261
|
/**
|
|
@@ -197,6 +197,7 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
|
|
|
197
197
|
* The component used for the transition.
|
|
198
198
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
199
199
|
* @default Fade
|
|
200
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
200
201
|
*/
|
|
201
202
|
TransitionComponent: PropTypes.elementType,
|
|
202
203
|
/**
|
package/modern/Grid/Grid.js
CHANGED
|
@@ -167,7 +167,7 @@ export function generateRowGap({
|
|
|
167
167
|
const themeSpacing = theme.spacing(propValue);
|
|
168
168
|
if (themeSpacing !== '0px') {
|
|
169
169
|
return {
|
|
170
|
-
marginTop:
|
|
170
|
+
marginTop: `-${themeSpacing}`,
|
|
171
171
|
[`& > .${gridClasses.item}`]: {
|
|
172
172
|
paddingTop: themeSpacing
|
|
173
173
|
}
|
|
@@ -212,7 +212,7 @@ export function generateColumnGap({
|
|
|
212
212
|
}, columnSpacingValues, (propValue, breakpoint) => {
|
|
213
213
|
const themeSpacing = theme.spacing(propValue);
|
|
214
214
|
if (themeSpacing !== '0px') {
|
|
215
|
-
const negativeValue =
|
|
215
|
+
const negativeValue = `-${themeSpacing}`;
|
|
216
216
|
return {
|
|
217
217
|
width: `calc(100% + ${themeSpacing})`,
|
|
218
218
|
marginLeft: negativeValue,
|
|
@@ -7,7 +7,7 @@ const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
|
7
7
|
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
|
8
8
|
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
|
9
9
|
const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
10
|
-
const grid2Classes = generateUtilityClasses('MuiGrid2', ['root', 'container',
|
|
10
|
+
const grid2Classes = generateUtilityClasses('MuiGrid2', ['root', 'container',
|
|
11
11
|
// spacings
|
|
12
12
|
...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
|
|
13
13
|
// direction values
|
package/modern/Rating/Rating.js
CHANGED
|
@@ -317,6 +317,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
317
317
|
props: inProps
|
|
318
318
|
});
|
|
319
319
|
const {
|
|
320
|
+
component = 'span',
|
|
320
321
|
className,
|
|
321
322
|
defaultValue = null,
|
|
322
323
|
disabled = false,
|
|
@@ -457,6 +458,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
457
458
|
const [emptyValueFocused, setEmptyValueFocused] = React.useState(false);
|
|
458
459
|
const ownerState = {
|
|
459
460
|
...props,
|
|
461
|
+
component,
|
|
460
462
|
defaultValue,
|
|
461
463
|
disabled,
|
|
462
464
|
emptyIcon,
|
|
@@ -473,6 +475,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
473
475
|
};
|
|
474
476
|
const classes = useUtilityClasses(ownerState);
|
|
475
477
|
return /*#__PURE__*/_jsxs(RatingRoot, {
|
|
478
|
+
as: component,
|
|
476
479
|
ref: handleRef,
|
|
477
480
|
onMouseMove: handleMouseMove,
|
|
478
481
|
onMouseLeave: handleMouseLeave,
|
|
@@ -558,6 +561,10 @@ process.env.NODE_ENV !== "production" ? Rating.propTypes /* remove-proptypes */
|
|
|
558
561
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
559
562
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
560
563
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
564
|
+
/**
|
|
565
|
+
* @ignore
|
|
566
|
+
*/
|
|
567
|
+
children: PropTypes.node,
|
|
561
568
|
/**
|
|
562
569
|
* Override or extend the styles applied to the component.
|
|
563
570
|
*/
|
|
@@ -566,6 +573,11 @@ process.env.NODE_ENV !== "production" ? Rating.propTypes /* remove-proptypes */
|
|
|
566
573
|
* @ignore
|
|
567
574
|
*/
|
|
568
575
|
className: PropTypes.string,
|
|
576
|
+
/**
|
|
577
|
+
* The component used for the root node.
|
|
578
|
+
* Either a string to use a HTML element or a component.
|
|
579
|
+
*/
|
|
580
|
+
component: PropTypes.elementType,
|
|
569
581
|
/**
|
|
570
582
|
* The default value. Use when the component is not controlled.
|
|
571
583
|
* @default null
|
|
@@ -524,6 +524,7 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes /* remove-proptypes
|
|
|
524
524
|
* The component used for the transition.
|
|
525
525
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
526
526
|
* @default Zoom
|
|
527
|
+
* * @deprecated Use `slots.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
|
|
527
528
|
*/
|
|
528
529
|
TransitionComponent: PropTypes.elementType,
|
|
529
530
|
/**
|
|
@@ -542,6 +543,7 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes /* remove-proptypes
|
|
|
542
543
|
/**
|
|
543
544
|
* Props applied to the transition element.
|
|
544
545
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
546
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
|
|
545
547
|
*/
|
|
546
548
|
TransitionProps: PropTypes.object
|
|
547
549
|
} : void 0;
|
|
@@ -254,10 +254,12 @@ process.env.NODE_ENV !== "production" ? StepLabel.propTypes /* remove-proptypes
|
|
|
254
254
|
}),
|
|
255
255
|
/**
|
|
256
256
|
* The component to render in place of the [`StepIcon`](https://mui.com/material-ui/api/step-icon/).
|
|
257
|
+
* @deprecated Use `slots.stepIcon` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
257
258
|
*/
|
|
258
259
|
StepIconComponent: PropTypes.elementType,
|
|
259
260
|
/**
|
|
260
261
|
* Props applied to the [`StepIcon`](https://mui.com/material-ui/api/step-icon/) element.
|
|
262
|
+
* @deprecated Use `slotProps.stepIcon` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
261
263
|
*/
|
|
262
264
|
StepIconProps: PropTypes.object,
|
|
263
265
|
/**
|