@mui/material 7.0.0-alpha.2 → 7.0.0-beta.1
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/CHANGELOG.md +57 -0
- package/Dialog/Dialog.d.ts +0 -5
- package/Dialog/Dialog.js +0 -9
- package/Grid/Grid.d.ts +51 -100
- package/Grid/Grid.js +68 -515
- package/Grid/gridClasses.d.ts +0 -38
- package/Grid/gridClasses.js +1 -1
- package/Grid/index.js +12 -2
- package/GridLegacy/GridLegacy.d.ts +160 -0
- package/GridLegacy/GridLegacy.js +601 -0
- package/{Grid/GridContext.js → GridLegacy/GridLegacyContext.js} +3 -3
- package/GridLegacy/gridLegacyClasses.d.ts +48 -0
- package/{Grid2/grid2Classes.js → GridLegacy/gridLegacyClasses.js} +5 -5
- package/GridLegacy/index.d.ts +4 -0
- package/GridLegacy/index.js +35 -0
- package/Menu/Menu.d.ts +68 -1
- package/Menu/Menu.js +52 -17
- package/Modal/Modal.d.ts +0 -5
- package/Modal/Modal.js +0 -9
- package/PigmentGrid/PigmentGrid.d.ts +1 -1
- package/PigmentGrid/PigmentGrid.js +2 -2
- package/PigmentGrid/index.d.ts +1 -1
- package/PigmentGrid/index.js +4 -4
- package/Rating/Rating.d.ts +52 -1
- package/Rating/Rating.js +132 -46
- package/Select/SelectInput.js +8 -8
- package/StepButton/StepButton.d.ts +0 -5
- package/esm/Dialog/Dialog.d.ts +0 -5
- package/esm/Dialog/Dialog.js +0 -9
- package/esm/Grid/Grid.d.ts +51 -100
- package/esm/Grid/Grid.js +68 -508
- package/esm/Grid/gridClasses.d.ts +0 -38
- package/esm/Grid/gridClasses.js +1 -1
- package/esm/Grid/index.js +1 -0
- package/esm/GridLegacy/GridLegacy.d.ts +160 -0
- package/esm/GridLegacy/GridLegacy.js +588 -0
- package/esm/GridLegacy/GridLegacyContext.js +12 -0
- package/esm/GridLegacy/gridLegacyClasses.d.ts +48 -0
- package/esm/{Grid2/grid2Classes.js → GridLegacy/gridLegacyClasses.js} +4 -4
- package/esm/GridLegacy/index.d.ts +4 -0
- package/esm/GridLegacy/index.js +3 -0
- package/esm/Menu/Menu.d.ts +68 -1
- package/esm/Menu/Menu.js +52 -17
- package/esm/Modal/Modal.d.ts +0 -5
- package/esm/Modal/Modal.js +0 -9
- package/esm/PigmentGrid/PigmentGrid.d.ts +1 -1
- package/esm/PigmentGrid/PigmentGrid.js +2 -2
- package/esm/PigmentGrid/index.d.ts +1 -1
- package/esm/PigmentGrid/index.js +1 -1
- package/esm/Rating/Rating.d.ts +52 -1
- package/esm/Rating/Rating.js +131 -45
- package/esm/Select/SelectInput.js +8 -8
- package/esm/StepButton/StepButton.d.ts +0 -5
- package/esm/index.d.ts +3 -8
- package/esm/index.js +3 -3
- package/esm/styles/components.d.ts +5 -5
- package/esm/styles/createTheme.d.ts +0 -1
- package/esm/styles/createTheme.js +0 -1
- package/esm/styles/createThemeNoVars.d.ts +0 -6
- package/esm/styles/createThemeNoVars.js +7 -12
- package/esm/styles/index.d.ts +1 -5
- package/esm/styles/index.js +1 -2
- package/esm/styles/overrides.d.ts +2 -2
- package/esm/styles/props.d.ts +2 -2
- package/esm/utils/createSvgIcon.d.ts +1 -1
- package/esm/utils/createSvgIcon.js +1 -1
- package/esm/version/index.js +2 -2
- package/index.d.ts +3 -8
- package/index.js +9 -9
- package/modern/Dialog/Dialog.d.ts +0 -5
- package/modern/Dialog/Dialog.js +0 -9
- package/modern/Grid/Grid.d.ts +51 -100
- package/modern/Grid/Grid.js +68 -508
- package/modern/Grid/gridClasses.d.ts +0 -38
- package/modern/Grid/gridClasses.js +1 -1
- package/modern/Grid/index.js +1 -0
- package/modern/GridLegacy/GridLegacy.d.ts +160 -0
- package/modern/GridLegacy/GridLegacy.js +588 -0
- package/modern/GridLegacy/GridLegacyContext.js +12 -0
- package/modern/GridLegacy/gridLegacyClasses.d.ts +48 -0
- package/modern/{Grid2/grid2Classes.js → GridLegacy/gridLegacyClasses.js} +4 -4
- package/modern/GridLegacy/index.d.ts +4 -0
- package/modern/GridLegacy/index.js +3 -0
- package/modern/Menu/Menu.d.ts +68 -1
- package/modern/Menu/Menu.js +52 -17
- package/modern/Modal/Modal.d.ts +0 -5
- package/modern/Modal/Modal.js +0 -9
- package/modern/PigmentGrid/PigmentGrid.d.ts +1 -1
- package/modern/PigmentGrid/PigmentGrid.js +2 -2
- package/modern/PigmentGrid/index.d.ts +1 -1
- package/modern/PigmentGrid/index.js +1 -1
- package/modern/Rating/Rating.d.ts +52 -1
- package/modern/Rating/Rating.js +131 -45
- package/modern/Select/SelectInput.js +8 -8
- package/modern/StepButton/StepButton.d.ts +0 -5
- package/modern/index.d.ts +3 -8
- package/modern/index.js +3 -3
- package/modern/styles/components.d.ts +5 -5
- package/modern/styles/createTheme.d.ts +0 -1
- package/modern/styles/createTheme.js +0 -1
- package/modern/styles/createThemeNoVars.d.ts +0 -6
- package/modern/styles/createThemeNoVars.js +7 -12
- package/modern/styles/index.d.ts +1 -5
- package/modern/styles/index.js +1 -2
- package/modern/styles/overrides.d.ts +2 -2
- package/modern/styles/props.d.ts +2 -2
- package/modern/utils/createSvgIcon.d.ts +1 -1
- package/modern/utils/createSvgIcon.js +1 -1
- package/modern/version/index.js +2 -2
- package/package.json +4 -4
- package/styles/components.d.ts +5 -5
- package/styles/createTheme.d.ts +0 -1
- package/styles/createTheme.js +1 -8
- package/styles/createThemeNoVars.d.ts +0 -6
- package/styles/createThemeNoVars.js +7 -13
- package/styles/index.d.ts +1 -5
- package/styles/index.js +1 -15
- package/styles/overrides.d.ts +2 -2
- package/styles/props.d.ts +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/createSvgIcon.d.ts +1 -1
- package/utils/createSvgIcon.js +1 -1
- package/version/index.js +2 -2
- package/Grid2/Grid2.d.ts +0 -111
- package/Grid2/Grid2.js +0 -144
- package/Grid2/grid2Classes.d.ts +0 -10
- package/Grid2/index.d.ts +0 -4
- package/Grid2/index.js +0 -45
- package/StyledEngineProvider/index.d.ts +0 -4
- package/StyledEngineProvider/index.js +0 -12
- package/esm/Grid/GridContext.js +0 -12
- package/esm/Grid2/Grid2.d.ts +0 -111
- package/esm/Grid2/Grid2.js +0 -138
- package/esm/Grid2/grid2Classes.d.ts +0 -10
- package/esm/Grid2/index.d.ts +0 -4
- package/esm/Grid2/index.js +0 -4
- package/esm/StyledEngineProvider/index.d.ts +0 -4
- package/esm/StyledEngineProvider/index.js +0 -1
- package/modern/Grid/GridContext.js +0 -12
- package/modern/Grid2/Grid2.d.ts +0 -111
- package/modern/Grid2/Grid2.js +0 -138
- package/modern/Grid2/grid2Classes.d.ts +0 -10
- package/modern/Grid2/index.d.ts +0 -4
- package/modern/Grid2/index.js +0 -4
- package/modern/StyledEngineProvider/index.d.ts +0 -4
- package/modern/StyledEngineProvider/index.js +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
gridLegacyClasses: true
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "default", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _GridLegacy.default;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "gridLegacyClasses", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _gridLegacyClasses.default;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var _GridLegacy = _interopRequireDefault(require("./GridLegacy"));
|
|
24
|
+
var _gridLegacyClasses = _interopRequireWildcard(require("./gridLegacyClasses"));
|
|
25
|
+
Object.keys(_gridLegacyClasses).forEach(function (key) {
|
|
26
|
+
if (key === "default" || key === "__esModule") return;
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
28
|
+
if (key in exports && exports[key] === _gridLegacyClasses[key]) return;
|
|
29
|
+
Object.defineProperty(exports, key, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () {
|
|
32
|
+
return _gridLegacyClasses[key];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
package/Menu/Menu.d.ts
CHANGED
|
@@ -4,10 +4,74 @@ import { InternalStandardProps as StandardProps } from "../index.js";
|
|
|
4
4
|
import { PaperProps } from "../Paper/index.js";
|
|
5
5
|
import { PopoverProps } from "../Popover/index.js";
|
|
6
6
|
import { MenuListProps } from "../MenuList/index.js";
|
|
7
|
+
import { ModalProps } from "../Modal/index.js";
|
|
8
|
+
import { BackdropProps } from "../Backdrop/index.js";
|
|
7
9
|
import { Theme } from "../styles/index.js";
|
|
8
10
|
import { TransitionProps } from "../transitions/transition.js";
|
|
9
11
|
import { MenuClasses } from "./menuClasses.js";
|
|
10
|
-
|
|
12
|
+
import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from "../utils/types.js";
|
|
13
|
+
export interface MenuRootSlotPropsOverrides {}
|
|
14
|
+
export interface MenuPaperSlotPropsOverrides {}
|
|
15
|
+
export interface MenuTransitionSlotPropsOverrides {}
|
|
16
|
+
export interface MenuListSlotPropsOverrides {}
|
|
17
|
+
export interface MenuBackdropSlotPropsOverrides {}
|
|
18
|
+
export interface MenuSlots {
|
|
19
|
+
/**
|
|
20
|
+
* The component used for the popper.
|
|
21
|
+
* @default Modal
|
|
22
|
+
*/
|
|
23
|
+
root: React.ElementType;
|
|
24
|
+
/**
|
|
25
|
+
* The component used for the paper.
|
|
26
|
+
* @default Paper
|
|
27
|
+
*/
|
|
28
|
+
paper: React.ElementType;
|
|
29
|
+
/**
|
|
30
|
+
* The component used for the list.
|
|
31
|
+
* @default MenuList
|
|
32
|
+
*/
|
|
33
|
+
list: React.ElementType;
|
|
34
|
+
/**
|
|
35
|
+
* The component used for the transition slot.
|
|
36
|
+
* @default Grow
|
|
37
|
+
*/
|
|
38
|
+
transition: React.ElementType;
|
|
39
|
+
/**
|
|
40
|
+
* The component used for the backdrop slot.
|
|
41
|
+
* @default Backdrop
|
|
42
|
+
*/
|
|
43
|
+
backdrop: React.ElementType;
|
|
44
|
+
}
|
|
45
|
+
export type MenuSlotsAndSlotProps = CreateSlotsAndSlotProps<MenuSlots, {
|
|
46
|
+
/**
|
|
47
|
+
* Props forwarded to the root slot.
|
|
48
|
+
* By default, the avaible props are based on the [Popover](https://mui.com/material-ui/api/popover/#props) component.
|
|
49
|
+
*/
|
|
50
|
+
root: SlotProps<React.ElementType<ModalProps>, MenuRootSlotPropsOverrides, MenuOwnerState>;
|
|
51
|
+
/**
|
|
52
|
+
* Props forwarded to the paper slot.
|
|
53
|
+
* By default, the avaible props are based on the [Paper](https://mui.com/material-ui/api/paper/#props) component.
|
|
54
|
+
*/
|
|
55
|
+
paper: SlotProps<React.ElementType<PaperProps>, MenuPaperSlotPropsOverrides, MenuOwnerState>;
|
|
56
|
+
/**
|
|
57
|
+
* Props forwarded to the list slot.
|
|
58
|
+
* By default, the avaible props are based on the [MenuList](https://mui.com/material-ui/api/menu-list/#props) component.
|
|
59
|
+
*/
|
|
60
|
+
list: SlotProps<React.ElementType<MenuListProps>, MenuListSlotPropsOverrides, MenuOwnerState>;
|
|
61
|
+
/**
|
|
62
|
+
* Props forwarded to the transition slot.
|
|
63
|
+
* By default, the avaible props are based on the [Grow](https://mui.com/material-ui/api/grow/#props) component.
|
|
64
|
+
*/
|
|
65
|
+
transition: SlotComponentProps<
|
|
66
|
+
// use SlotComponentProps because transition slot does not support `component` and `sx` prop
|
|
67
|
+
React.ElementType, TransitionProps & MenuTransitionSlotPropsOverrides, MenuOwnerState>;
|
|
68
|
+
/**
|
|
69
|
+
* Props forwarded to the backdrop slot.
|
|
70
|
+
* By default, the avaible props are based on the [Backdrop](https://mui.com/material-ui/api/backdrop/#props) component.
|
|
71
|
+
*/
|
|
72
|
+
backdrop: SlotProps<React.ElementType<BackdropProps>, MenuBackdropSlotPropsOverrides, MenuOwnerState>;
|
|
73
|
+
}>;
|
|
74
|
+
export interface MenuProps extends StandardProps<Omit<PopoverProps, 'slots' | 'slotProps'>>, MenuSlotsAndSlotProps {
|
|
11
75
|
/**
|
|
12
76
|
* An HTML element, or a function that returns one.
|
|
13
77
|
* It's used to set the position of the menu.
|
|
@@ -39,6 +103,7 @@ export interface MenuProps extends StandardProps<PopoverProps> {
|
|
|
39
103
|
disableAutoFocusItem?: boolean;
|
|
40
104
|
/**
|
|
41
105
|
* Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
|
|
106
|
+
* @deprecated use the `slotProps.list` 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
107
|
* @default {}
|
|
43
108
|
*/
|
|
44
109
|
MenuListProps?: Partial<MenuListProps>;
|
|
@@ -69,6 +134,7 @@ export interface MenuProps extends StandardProps<PopoverProps> {
|
|
|
69
134
|
/**
|
|
70
135
|
* Props applied to the transition element.
|
|
71
136
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
137
|
+
* @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.
|
|
72
138
|
* @default {}
|
|
73
139
|
*/
|
|
74
140
|
TransitionProps?: TransitionProps;
|
|
@@ -78,6 +144,7 @@ export interface MenuProps extends StandardProps<PopoverProps> {
|
|
|
78
144
|
*/
|
|
79
145
|
variant?: 'menu' | 'selectedMenu';
|
|
80
146
|
}
|
|
147
|
+
export interface MenuOwnerState extends Omit<MenuProps, 'slots' | 'slotProps'> {}
|
|
81
148
|
export declare const MenuPaper: React.FC<PaperProps>;
|
|
82
149
|
|
|
83
150
|
/**
|
package/Menu/Menu.js
CHANGED
|
@@ -21,6 +21,7 @@ var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShoul
|
|
|
21
21
|
var _zeroStyled = require("../zero-styled");
|
|
22
22
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
23
23
|
var _menuClasses = require("./menuClasses");
|
|
24
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const RTL_ORIGIN = {
|
|
26
27
|
vertical: 'top',
|
|
@@ -152,20 +153,43 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
});
|
|
155
|
-
const
|
|
156
|
-
|
|
156
|
+
const externalForwardedProps = {
|
|
157
|
+
slots,
|
|
158
|
+
slotProps: {
|
|
159
|
+
list: MenuListProps,
|
|
160
|
+
transition: TransitionProps,
|
|
161
|
+
paper: PaperProps,
|
|
162
|
+
...slotProps
|
|
163
|
+
}
|
|
164
|
+
};
|
|
157
165
|
const rootSlotProps = (0, _useSlotProps.default)({
|
|
158
166
|
elementType: slots.root,
|
|
159
167
|
externalSlotProps: slotProps.root,
|
|
160
168
|
ownerState,
|
|
161
169
|
className: [classes.root, className]
|
|
162
170
|
});
|
|
163
|
-
const paperSlotProps = (0,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
const [PaperSlot, paperSlotProps] = (0, _useSlot.default)('paper', {
|
|
172
|
+
className: classes.paper,
|
|
173
|
+
elementType: MenuPaper,
|
|
174
|
+
externalForwardedProps,
|
|
175
|
+
shouldForwardComponentProp: true,
|
|
176
|
+
ownerState
|
|
177
|
+
});
|
|
178
|
+
const [ListSlot, listSlotProps] = (0, _useSlot.default)('list', {
|
|
179
|
+
className: (0, _clsx.default)(classes.list, MenuListProps.className),
|
|
180
|
+
elementType: MenuMenuList,
|
|
181
|
+
shouldForwardComponentProp: true,
|
|
182
|
+
externalForwardedProps,
|
|
183
|
+
getSlotProps: handlers => ({
|
|
184
|
+
...handlers,
|
|
185
|
+
onKeyDown: event => {
|
|
186
|
+
handleListKeyDown(event);
|
|
187
|
+
handlers.onKeyDown?.(event);
|
|
188
|
+
}
|
|
189
|
+
}),
|
|
190
|
+
ownerState
|
|
168
191
|
});
|
|
192
|
+
const resolvedTransitionProps = typeof externalForwardedProps.slotProps.transition === 'function' ? externalForwardedProps.slotProps.transition(ownerState) : externalForwardedProps.slotProps.transition;
|
|
169
193
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MenuRoot, {
|
|
170
194
|
onClose: onClose,
|
|
171
195
|
anchorOrigin: {
|
|
@@ -174,31 +198,38 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
174
198
|
},
|
|
175
199
|
transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
|
|
176
200
|
slots: {
|
|
201
|
+
root: slots.root,
|
|
177
202
|
paper: PaperSlot,
|
|
178
|
-
|
|
203
|
+
backdrop: slots.backdrop,
|
|
204
|
+
...(slots.transition && {
|
|
205
|
+
// TODO: pass `slots.transition` directly once `TransitionComponent` is removed from Popover
|
|
206
|
+
transition: slots.transition
|
|
207
|
+
})
|
|
179
208
|
},
|
|
180
209
|
slotProps: {
|
|
181
210
|
root: rootSlotProps,
|
|
182
|
-
paper: paperSlotProps
|
|
211
|
+
paper: paperSlotProps,
|
|
212
|
+
backdrop: typeof slotProps.backdrop === 'function' ? slotProps.backdrop(ownerState) : slotProps.backdrop,
|
|
213
|
+
transition: {
|
|
214
|
+
...resolvedTransitionProps,
|
|
215
|
+
onEntering: (...args) => {
|
|
216
|
+
handleEntering(...args);
|
|
217
|
+
resolvedTransitionProps?.onEntering?.(...args);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
183
220
|
},
|
|
184
221
|
open: open,
|
|
185
222
|
ref: ref,
|
|
186
223
|
transitionDuration: transitionDuration,
|
|
187
|
-
TransitionProps: {
|
|
188
|
-
onEntering: handleEntering,
|
|
189
|
-
...TransitionProps
|
|
190
|
-
},
|
|
191
224
|
ownerState: ownerState,
|
|
192
225
|
...other,
|
|
193
226
|
classes: PopoverClasses,
|
|
194
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
195
|
-
onKeyDown: handleListKeyDown,
|
|
227
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ListSlot, {
|
|
196
228
|
actions: menuListActionsRef,
|
|
197
229
|
autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem),
|
|
198
230
|
autoFocusItem: autoFocusItem,
|
|
199
231
|
variant: variant,
|
|
200
|
-
...
|
|
201
|
-
className: (0, _clsx.default)(classes.list, MenuListProps.className),
|
|
232
|
+
...listSlotProps,
|
|
202
233
|
children: children
|
|
203
234
|
})
|
|
204
235
|
});
|
|
@@ -243,6 +274,7 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
243
274
|
disableAutoFocusItem: _propTypes.default.bool,
|
|
244
275
|
/**
|
|
245
276
|
* Props applied to the [`MenuList`](https://mui.com/material-ui/api/menu-list/) element.
|
|
277
|
+
* @deprecated use the `slotProps.list` 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.
|
|
246
278
|
* @default {}
|
|
247
279
|
*/
|
|
248
280
|
MenuListProps: _propTypes.default.object,
|
|
@@ -271,6 +303,7 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
271
303
|
*/
|
|
272
304
|
slotProps: _propTypes.default.shape({
|
|
273
305
|
backdrop: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
306
|
+
list: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
274
307
|
paper: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
275
308
|
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
276
309
|
transition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
@@ -281,6 +314,7 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
281
314
|
*/
|
|
282
315
|
slots: _propTypes.default.shape({
|
|
283
316
|
backdrop: _propTypes.default.elementType,
|
|
317
|
+
list: _propTypes.default.elementType,
|
|
284
318
|
paper: _propTypes.default.elementType,
|
|
285
319
|
root: _propTypes.default.elementType,
|
|
286
320
|
transition: _propTypes.default.elementType
|
|
@@ -301,6 +335,7 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
301
335
|
/**
|
|
302
336
|
* Props applied to the transition element.
|
|
303
337
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
338
|
+
* @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.
|
|
304
339
|
* @default {}
|
|
305
340
|
*/
|
|
306
341
|
TransitionProps: _propTypes.default.object,
|
package/Modal/Modal.d.ts
CHANGED
|
@@ -145,11 +145,6 @@ export interface ModalOwnProps {
|
|
|
145
145
|
* @default false
|
|
146
146
|
*/
|
|
147
147
|
keepMounted?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Callback fired when the backdrop is clicked.
|
|
150
|
-
* @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
|
|
151
|
-
*/
|
|
152
|
-
onBackdropClick?: React.ReactEventHandler<{}>;
|
|
153
148
|
/**
|
|
154
149
|
* Callback fired when the component requests to be closed.
|
|
155
150
|
* The `reason` parameter can optionally be used to control the response to `onClose`.
|
package/Modal/Modal.js
CHANGED
|
@@ -109,7 +109,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
109
109
|
disableScrollLock = false,
|
|
110
110
|
hideBackdrop = false,
|
|
111
111
|
keepMounted = false,
|
|
112
|
-
onBackdropClick,
|
|
113
112
|
onClose,
|
|
114
113
|
onTransitionEnter,
|
|
115
114
|
onTransitionExited,
|
|
@@ -196,9 +195,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
196
195
|
return getBackdropProps({
|
|
197
196
|
...otherHandlers,
|
|
198
197
|
onClick: event => {
|
|
199
|
-
if (onBackdropClick) {
|
|
200
|
-
onBackdropClick(event);
|
|
201
|
-
}
|
|
202
198
|
if (otherHandlers?.onClick) {
|
|
203
199
|
otherHandlers.onClick(event);
|
|
204
200
|
}
|
|
@@ -362,11 +358,6 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
|
|
|
362
358
|
* @default false
|
|
363
359
|
*/
|
|
364
360
|
keepMounted: _propTypes.default.bool,
|
|
365
|
-
/**
|
|
366
|
-
* Callback fired when the backdrop is clicked.
|
|
367
|
-
* @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
|
|
368
|
-
*/
|
|
369
|
-
onBackdropClick: _propTypes.default.func,
|
|
370
361
|
/**
|
|
371
362
|
* Callback fired when the component requests to be closed.
|
|
372
363
|
* The `reason` parameter can optionally be used to control the response to `onClose`.
|
|
@@ -40,13 +40,13 @@ const useUtilityClasses = ownerState => {
|
|
|
40
40
|
const slots = {
|
|
41
41
|
root: ['root', container && 'container', ...(0, _Grid2.unstable_generateDirectionClasses)(direction), ...(0, _Grid2.unstable_generateSizeClassNames)(gridSize), ...(container ? (0, _Grid2.unstable_generateSpacingClassNames)(spacing) : [])]
|
|
42
42
|
};
|
|
43
|
-
return (0, _composeClasses.default)(slots, slot => (0, _generateUtilityClass.default)('
|
|
43
|
+
return (0, _composeClasses.default)(slots, slot => (0, _generateUtilityClass.default)('MuiGrid', slot), {});
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
*
|
|
47
47
|
* Demos:
|
|
48
48
|
*
|
|
49
|
-
* - [Grid
|
|
49
|
+
* - [Grid](https://next.mui.com/material-ui/react-grid/)
|
|
50
50
|
*
|
|
51
51
|
* API:
|
|
52
52
|
*
|
package/PigmentGrid/index.d.ts
CHANGED
package/PigmentGrid/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
var _exportNames = {
|
|
9
|
-
|
|
9
|
+
gridClasses: true
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "default", {
|
|
12
12
|
enumerable: true,
|
|
@@ -14,10 +14,10 @@ Object.defineProperty(exports, "default", {
|
|
|
14
14
|
return _PigmentGrid.default;
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "gridClasses", {
|
|
18
18
|
enumerable: true,
|
|
19
19
|
get: function () {
|
|
20
|
-
return
|
|
20
|
+
return _gridClasses.default;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
var _PigmentGrid = _interopRequireWildcard(require("./PigmentGrid"));
|
|
@@ -32,4 +32,4 @@ Object.keys(_PigmentGrid).forEach(function (key) {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
|
-
var
|
|
35
|
+
var _gridClasses = _interopRequireDefault(require("../Grid/gridClasses"));
|
package/Rating/Rating.d.ts
CHANGED
|
@@ -4,11 +4,60 @@ import { OverridableStringUnion } from '@mui/types';
|
|
|
4
4
|
import { Theme } from "../index.js";
|
|
5
5
|
import { RatingClasses } from "./ratingClasses.js";
|
|
6
6
|
import { OverridableComponent, OverrideProps } from "../OverridableComponent/index.js";
|
|
7
|
+
import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.js";
|
|
7
8
|
export interface IconContainerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
8
9
|
value: number;
|
|
9
10
|
}
|
|
10
11
|
export interface RatingPropsSizeOverrides {}
|
|
11
|
-
export interface
|
|
12
|
+
export interface RatingRootSlotPropsOverrides {}
|
|
13
|
+
export interface RatingLabelSlotPropsOverrides {}
|
|
14
|
+
export interface RatingIconSlotPropsOverrides {}
|
|
15
|
+
export interface RatingDecimalSlotPropsOverrides {}
|
|
16
|
+
export interface RatingSlots {
|
|
17
|
+
/**
|
|
18
|
+
* The component used for the root slot.
|
|
19
|
+
* @default 'span'
|
|
20
|
+
*/
|
|
21
|
+
root: React.ElementType;
|
|
22
|
+
/**
|
|
23
|
+
* The component used for the label slot.
|
|
24
|
+
* @default 'label'
|
|
25
|
+
*/
|
|
26
|
+
label: React.ElementType;
|
|
27
|
+
/**
|
|
28
|
+
* The component used for the icon slot.
|
|
29
|
+
* @default 'span'
|
|
30
|
+
*/
|
|
31
|
+
icon: React.ElementType;
|
|
32
|
+
/**
|
|
33
|
+
* The component used fo r the decimal slot.
|
|
34
|
+
* @default 'span'
|
|
35
|
+
*/
|
|
36
|
+
decimal: React.ElementType;
|
|
37
|
+
}
|
|
38
|
+
export type RatingSlotsAndSlotProps = CreateSlotsAndSlotProps<RatingSlots, {
|
|
39
|
+
/**
|
|
40
|
+
* Props forwarded to the root slot.
|
|
41
|
+
* By default, the avaible props are based on the span element.
|
|
42
|
+
*/
|
|
43
|
+
root: SlotProps<'span', RatingRootSlotPropsOverrides, RatingOwnerState>;
|
|
44
|
+
/**
|
|
45
|
+
* Props forwarded to the label slot.
|
|
46
|
+
* By default, the avaible props are based on the label element.
|
|
47
|
+
*/
|
|
48
|
+
label: SlotProps<'label', RatingLabelSlotPropsOverrides, RatingOwnerState>;
|
|
49
|
+
/**
|
|
50
|
+
* Props forwarded to the icon slot.
|
|
51
|
+
* By default, the avaible props are based on the span element.
|
|
52
|
+
*/
|
|
53
|
+
icon: SlotProps<'span', RatingIconSlotPropsOverrides, RatingOwnerState>;
|
|
54
|
+
/**
|
|
55
|
+
* Props forwarded to the decimal slot.
|
|
56
|
+
* By default, the avaible props are based on the span element.
|
|
57
|
+
*/
|
|
58
|
+
decimal: SlotProps<'span', RatingDecimalSlotPropsOverrides, RatingOwnerState>;
|
|
59
|
+
}>;
|
|
60
|
+
export interface RatingOwnProps extends RatingSlotsAndSlotProps {
|
|
12
61
|
/**
|
|
13
62
|
* Override or extend the styles applied to the component.
|
|
14
63
|
*/
|
|
@@ -57,6 +106,7 @@ export interface RatingOwnProps {
|
|
|
57
106
|
icon?: React.ReactNode;
|
|
58
107
|
/**
|
|
59
108
|
* The component containing the icon.
|
|
109
|
+
* @deprecated Use `slotProps.icon.component` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
60
110
|
* @default function IconContainer(props) {
|
|
61
111
|
* const { value, ...other } = props;
|
|
62
112
|
* return <span {...other} />;
|
|
@@ -110,6 +160,7 @@ export interface RatingOwnProps {
|
|
|
110
160
|
*/
|
|
111
161
|
value?: number | null;
|
|
112
162
|
}
|
|
163
|
+
export interface RatingOwnerState extends Omit<RatingProps, 'slots' | 'slotProps'> {}
|
|
113
164
|
export type RatingTypeMap<AdditionalProps = {}, RootComponent extends React.ElementType = 'span'> = {
|
|
114
165
|
props: AdditionalProps & RatingOwnProps;
|
|
115
166
|
defaultComponent: RootComponent;
|