@mui/material 6.1.9 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Avatar/Avatar.js +7 -6
- package/Box/Box.d.ts +3 -1
- package/ButtonBase/ButtonBase.js +21 -22
- package/CHANGELOG.md +82 -0
- package/ClickAwayListener/ClickAwayListener.js +1 -4
- package/FilledInput/FilledInput.js +1 -1
- package/FormHelperText/FormHelperText.js +1 -0
- package/Grid/Grid.js +2 -2
- package/Grid2/Grid2.js +9 -2
- package/Hidden/HiddenJs.js +4 -8
- package/InputAdornment/InputAdornment.js +1 -0
- package/ListItemText/ListItemText.d.ts +36 -1
- package/ListItemText/ListItemText.js +46 -7
- package/Modal/useModal.js +3 -2
- package/Modal/useModal.types.d.ts +5 -1
- package/NoSsr/NoSsr.js +2 -5
- package/OutlinedInput/NotchedOutline.js +1 -0
- package/PigmentGrid/PigmentGrid.js +1 -1
- package/Portal/Portal.js +2 -7
- package/Select/SelectInput.js +1 -0
- package/Slider/SliderValueLabel.d.ts +4 -1
- package/Slider/SliderValueLabel.types.d.ts +4 -1
- package/Slider/useSlider.js +64 -10
- package/Tabs/ScrollbarSize.js +2 -2
- package/Unstable_TrapFocus/FocusTrap.types.d.ts +4 -1
- package/index.js +1 -1
- package/modern/Avatar/Avatar.js +7 -6
- package/modern/ButtonBase/ButtonBase.js +21 -22
- package/modern/ClickAwayListener/ClickAwayListener.js +1 -4
- package/modern/FilledInput/FilledInput.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +1 -0
- package/modern/Grid/Grid.js +2 -2
- package/modern/Grid2/Grid2.js +9 -2
- package/modern/Hidden/HiddenJs.js +4 -8
- package/modern/InputAdornment/InputAdornment.js +1 -0
- package/modern/ListItemText/ListItemText.js +46 -7
- package/modern/Modal/useModal.js +3 -2
- package/modern/NoSsr/NoSsr.js +2 -5
- package/modern/OutlinedInput/NotchedOutline.js +1 -0
- package/modern/PigmentGrid/PigmentGrid.js +1 -1
- package/modern/Portal/Portal.js +2 -7
- package/modern/Select/SelectInput.js +1 -0
- package/modern/Slider/useSlider.js +64 -10
- package/modern/Tabs/ScrollbarSize.js +2 -2
- package/modern/index.js +1 -1
- package/modern/styles/createThemeWithVars.js +2 -2
- package/modern/utils/useSlot.js +1 -10
- package/modern/version/index.js +3 -3
- package/node/Avatar/Avatar.js +7 -6
- package/node/ButtonBase/ButtonBase.js +21 -22
- package/node/ClickAwayListener/ClickAwayListener.js +1 -4
- package/node/FilledInput/FilledInput.js +1 -1
- package/node/FormHelperText/FormHelperText.js +1 -0
- package/node/Grid/Grid.js +2 -2
- package/node/Grid2/Grid2.js +9 -2
- package/node/Hidden/HiddenJs.js +7 -10
- package/node/InputAdornment/InputAdornment.js +1 -0
- package/node/ListItemText/ListItemText.js +46 -7
- package/node/Modal/useModal.js +3 -2
- package/node/NoSsr/NoSsr.js +2 -5
- package/node/OutlinedInput/NotchedOutline.js +1 -0
- package/node/PigmentGrid/PigmentGrid.js +2 -2
- package/node/Portal/Portal.js +2 -7
- package/node/Select/SelectInput.js +1 -0
- package/node/Slider/useSlider.js +64 -10
- package/node/Tabs/ScrollbarSize.js +2 -2
- package/node/index.js +1 -1
- package/node/styles/createThemeWithVars.js +2 -2
- package/node/utils/useSlot.js +1 -10
- package/node/version/index.js +3 -3
- package/package.json +7 -7
- package/styles/createThemeWithVars.js +2 -2
- package/useLazyRipple/useLazyRipple.d.ts +1 -1
- package/utils/memoTheme.d.ts +1 -1
- package/utils/useSlot.d.ts +0 -7
- package/utils/useSlot.js +1 -10
- package/version/index.js +3 -3
|
@@ -5,6 +5,9 @@ import { unstable_ownerDocument as ownerDocument, unstable_useControlled as useC
|
|
|
5
5
|
import extractEventHandlers from '@mui/utils/extractEventHandlers';
|
|
6
6
|
import areArraysEqual from "../utils/areArraysEqual.js";
|
|
7
7
|
const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
|
|
8
|
+
function getNewValue(currentValue, step, direction, min, max) {
|
|
9
|
+
return direction === 1 ? Math.min(currentValue + step, max) : Math.max(currentValue - step, min);
|
|
10
|
+
}
|
|
8
11
|
function asc(a, b) {
|
|
9
12
|
return a - b;
|
|
10
13
|
}
|
|
@@ -280,20 +283,65 @@ export function useSlider(parameters) {
|
|
|
280
283
|
}
|
|
281
284
|
};
|
|
282
285
|
const createHandleHiddenInputKeyDown = otherHandlers => event => {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
if (step !== null) {
|
|
286
|
+
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'PageUp', 'PageDown', 'Home', 'End'].includes(event.key)) {
|
|
287
|
+
event.preventDefault();
|
|
286
288
|
const index = Number(event.currentTarget.getAttribute('data-index'));
|
|
287
289
|
const value = values[index];
|
|
288
290
|
let newValue = null;
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
// Keys actions that change the value by more than the most granular `step`
|
|
292
|
+
// value are only applied if the step not `null`.
|
|
293
|
+
// When step is `null`, the `marks` prop is used instead to define valid values.
|
|
294
|
+
if (step != null) {
|
|
295
|
+
const stepSize = event.shiftKey ? shiftStep : step;
|
|
296
|
+
switch (event.key) {
|
|
297
|
+
case 'ArrowUp':
|
|
298
|
+
newValue = getNewValue(value, stepSize, 1, min, max);
|
|
299
|
+
break;
|
|
300
|
+
case 'ArrowRight':
|
|
301
|
+
newValue = getNewValue(value, stepSize, isRtl ? -1 : 1, min, max);
|
|
302
|
+
break;
|
|
303
|
+
case 'ArrowDown':
|
|
304
|
+
newValue = getNewValue(value, stepSize, -1, min, max);
|
|
305
|
+
break;
|
|
306
|
+
case 'ArrowLeft':
|
|
307
|
+
newValue = getNewValue(value, stepSize, isRtl ? 1 : -1, min, max);
|
|
308
|
+
break;
|
|
309
|
+
case 'PageUp':
|
|
310
|
+
newValue = getNewValue(value, shiftStep, 1, min, max);
|
|
311
|
+
break;
|
|
312
|
+
case 'PageDown':
|
|
313
|
+
newValue = getNewValue(value, shiftStep, -1, min, max);
|
|
314
|
+
break;
|
|
315
|
+
case 'Home':
|
|
316
|
+
newValue = min;
|
|
317
|
+
break;
|
|
318
|
+
case 'End':
|
|
319
|
+
newValue = max;
|
|
320
|
+
break;
|
|
321
|
+
default:
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
} else if (marks) {
|
|
325
|
+
const maxMarksValue = marksValues[marksValues.length - 1];
|
|
326
|
+
const currentMarkIndex = marksValues.indexOf(value);
|
|
327
|
+
const decrementKeys = [isRtl ? 'ArrowRight' : 'ArrowLeft', 'ArrowDown', 'PageDown', 'Home'];
|
|
328
|
+
const incrementKeys = [isRtl ? 'ArrowLeft' : 'ArrowRight', 'ArrowUp', 'PageUp', 'End'];
|
|
329
|
+
if (decrementKeys.includes(event.key)) {
|
|
330
|
+
if (currentMarkIndex === 0) {
|
|
331
|
+
newValue = marksValues[0];
|
|
332
|
+
} else {
|
|
333
|
+
newValue = marksValues[currentMarkIndex - 1];
|
|
334
|
+
}
|
|
335
|
+
} else if (incrementKeys.includes(event.key)) {
|
|
336
|
+
if (currentMarkIndex === marksValues.length - 1) {
|
|
337
|
+
newValue = maxMarksValue;
|
|
338
|
+
} else {
|
|
339
|
+
newValue = marksValues[currentMarkIndex + 1];
|
|
340
|
+
}
|
|
341
|
+
}
|
|
293
342
|
}
|
|
294
|
-
if (newValue
|
|
343
|
+
if (newValue != null) {
|
|
295
344
|
changeValue(event, newValue);
|
|
296
|
-
event.preventDefault();
|
|
297
345
|
}
|
|
298
346
|
}
|
|
299
347
|
otherHandlers?.onKeyDown?.(event);
|
|
@@ -315,6 +363,7 @@ export function useSlider(parameters) {
|
|
|
315
363
|
}
|
|
316
364
|
const createHandleHiddenInputChange = otherHandlers => event => {
|
|
317
365
|
otherHandlers.onChange?.(event);
|
|
366
|
+
// this handles value change by Pointer or Touch events
|
|
318
367
|
// @ts-ignore
|
|
319
368
|
changeValue(event, event.target.valueAsNumber);
|
|
320
369
|
};
|
|
@@ -591,6 +640,10 @@ export function useSlider(parameters) {
|
|
|
591
640
|
pointerEvents: active !== -1 && active !== index ? 'none' : undefined
|
|
592
641
|
};
|
|
593
642
|
};
|
|
643
|
+
let cssWritingMode;
|
|
644
|
+
if (orientation === 'vertical') {
|
|
645
|
+
cssWritingMode = isRtl ? 'vertical-rl' : 'vertical-lr';
|
|
646
|
+
}
|
|
594
647
|
const getHiddenInputProps = (externalProps = {}) => {
|
|
595
648
|
const externalHandlers = extractEventHandlers(externalProps);
|
|
596
649
|
const ownEventHandlers = {
|
|
@@ -622,7 +675,8 @@ export function useSlider(parameters) {
|
|
|
622
675
|
direction: isRtl ? 'rtl' : 'ltr',
|
|
623
676
|
// So that VoiceOver's focus indicator matches the thumb's dimensions
|
|
624
677
|
width: '100%',
|
|
625
|
-
height: '100%'
|
|
678
|
+
height: '100%',
|
|
679
|
+
writingMode: cssWritingMode
|
|
626
680
|
}
|
|
627
681
|
};
|
|
628
682
|
};
|
|
@@ -49,8 +49,8 @@ export default function ScrollbarSize(props) {
|
|
|
49
49
|
}, [onChange]);
|
|
50
50
|
return /*#__PURE__*/_jsx("div", {
|
|
51
51
|
style: styles,
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
...other,
|
|
53
|
+
ref: nodeRef
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
process.env.NODE_ENV !== "production" ? ScrollbarSize.propTypes = {
|
package/modern/index.js
CHANGED
|
@@ -23,7 +23,7 @@ function setColor(obj, key, defaultValue) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
function toRgb(color) {
|
|
26
|
-
if (
|
|
26
|
+
if (typeof color !== 'string' || !color.startsWith('hsl')) {
|
|
27
27
|
return color;
|
|
28
28
|
}
|
|
29
29
|
return hslToRgb(color);
|
|
@@ -315,7 +315,7 @@ export default function createThemeWithVars(options = {}, ...args) {
|
|
|
315
315
|
|
|
316
316
|
// The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.
|
|
317
317
|
|
|
318
|
-
if (colors && typeof colors === 'object') {
|
|
318
|
+
if (color !== 'tonalOffset' && colors && typeof colors === 'object') {
|
|
319
319
|
// Silent the error for custom palettes.
|
|
320
320
|
if (colors.main) {
|
|
321
321
|
setColor(palette[color], 'mainChannel', safeColorChannel(toRgb(colors.main)));
|
package/modern/utils/useSlot.js
CHANGED
|
@@ -31,7 +31,6 @@ name, parameters) {
|
|
|
31
31
|
elementType: initialElementType,
|
|
32
32
|
ownerState,
|
|
33
33
|
externalForwardedProps,
|
|
34
|
-
getSlotOwnerState,
|
|
35
34
|
internalForwardedProps,
|
|
36
35
|
...useSlotPropsParams
|
|
37
36
|
} = parameters;
|
|
@@ -63,11 +62,6 @@ name, parameters) {
|
|
|
63
62
|
externalSlotProps: resolvedComponentsProps
|
|
64
63
|
});
|
|
65
64
|
const ref = useForkRef(internalRef, resolvedComponentsProps?.ref, parameters.ref);
|
|
66
|
-
const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
|
|
67
|
-
const finalOwnerState = {
|
|
68
|
-
...ownerState,
|
|
69
|
-
...slotOwnerState
|
|
70
|
-
};
|
|
71
65
|
const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
|
|
72
66
|
const props = appendOwnerState(elementType, {
|
|
73
67
|
...(name === 'root' && !rootComponent && !slots[name] && internalForwardedProps),
|
|
@@ -77,9 +71,6 @@ name, parameters) {
|
|
|
77
71
|
as: LeafComponent
|
|
78
72
|
}),
|
|
79
73
|
ref
|
|
80
|
-
},
|
|
81
|
-
Object.keys(slotOwnerState).forEach(propName => {
|
|
82
|
-
delete props[propName];
|
|
83
|
-
});
|
|
74
|
+
}, ownerState);
|
|
84
75
|
return [elementType, props];
|
|
85
76
|
}
|
package/modern/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.
|
|
1
|
+
export const version = "6.2.0";
|
|
2
2
|
export const major = Number("6");
|
|
3
|
-
export const minor = Number("
|
|
4
|
-
export const patch = Number("
|
|
3
|
+
export const minor = Number("2");
|
|
4
|
+
export const patch = Number("0");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|
package/node/Avatar/Avatar.js
CHANGED
|
@@ -168,21 +168,22 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
|
|
|
168
168
|
...other
|
|
169
169
|
} = props;
|
|
170
170
|
let children = null;
|
|
171
|
+
const ownerState = {
|
|
172
|
+
...props,
|
|
173
|
+
component,
|
|
174
|
+
variant
|
|
175
|
+
};
|
|
171
176
|
|
|
172
177
|
// Use a hook instead of onError on the img element to support server-side rendering.
|
|
173
178
|
const loaded = useLoaded({
|
|
174
179
|
...imgProps,
|
|
180
|
+
...(typeof slotProps.img === 'function' ? slotProps.img(ownerState) : slotProps.img),
|
|
175
181
|
src,
|
|
176
182
|
srcSet
|
|
177
183
|
});
|
|
178
184
|
const hasImg = src || srcSet;
|
|
179
185
|
const hasImgNotFailing = hasImg && loaded !== 'error';
|
|
180
|
-
|
|
181
|
-
...props,
|
|
182
|
-
colorDefault: !hasImgNotFailing,
|
|
183
|
-
component,
|
|
184
|
-
variant
|
|
185
|
-
};
|
|
186
|
+
ownerState.colorDefault = !hasImgNotFailing;
|
|
186
187
|
// This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
|
|
187
188
|
delete ownerState.ownerState;
|
|
188
189
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -143,34 +143,22 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
143
143
|
ripple.pulsate();
|
|
144
144
|
}
|
|
145
145
|
}, [disableRipple, focusRipple, focusVisible, ripple]);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const ignore = skipRippleAction;
|
|
152
|
-
if (!ignore) {
|
|
153
|
-
ripple[rippleAction](event);
|
|
154
|
-
}
|
|
155
|
-
return true;
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
const handleMouseDown = useRippleHandler('start', onMouseDown);
|
|
159
|
-
const handleContextMenu = useRippleHandler('stop', onContextMenu);
|
|
160
|
-
const handleDragLeave = useRippleHandler('stop', onDragLeave);
|
|
161
|
-
const handleMouseUp = useRippleHandler('stop', onMouseUp);
|
|
162
|
-
const handleMouseLeave = useRippleHandler('stop', event => {
|
|
146
|
+
const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);
|
|
147
|
+
const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);
|
|
148
|
+
const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);
|
|
149
|
+
const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);
|
|
150
|
+
const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {
|
|
163
151
|
if (focusVisible) {
|
|
164
152
|
event.preventDefault();
|
|
165
153
|
}
|
|
166
154
|
if (onMouseLeave) {
|
|
167
155
|
onMouseLeave(event);
|
|
168
156
|
}
|
|
169
|
-
});
|
|
170
|
-
const handleTouchStart = useRippleHandler('start', onTouchStart);
|
|
171
|
-
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
|
172
|
-
const handleTouchMove = useRippleHandler('stop', onTouchMove);
|
|
173
|
-
const handleBlur = useRippleHandler('stop', event => {
|
|
157
|
+
}, disableTouchRipple);
|
|
158
|
+
const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);
|
|
159
|
+
const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);
|
|
160
|
+
const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);
|
|
161
|
+
const handleBlur = useRippleHandler(ripple, 'stop', event => {
|
|
174
162
|
if (!(0, _isFocusVisible.default)(event.target)) {
|
|
175
163
|
setFocusVisible(false);
|
|
176
164
|
}
|
|
@@ -294,6 +282,17 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
294
282
|
}) : null]
|
|
295
283
|
});
|
|
296
284
|
});
|
|
285
|
+
function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
|
|
286
|
+
return (0, _useEventCallback.default)(event => {
|
|
287
|
+
if (eventCallback) {
|
|
288
|
+
eventCallback(event);
|
|
289
|
+
}
|
|
290
|
+
if (!skipRippleAction) {
|
|
291
|
+
ripple[rippleAction](event);
|
|
292
|
+
}
|
|
293
|
+
return true;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
297
296
|
process.env.NODE_ENV !== "production" ? ButtonBase.propTypes /* remove-proptypes */ = {
|
|
298
297
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
299
298
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
@@ -11,7 +11,6 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _utils = require("@mui/utils");
|
|
13
13
|
var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
|
|
16
15
|
function mapEventPropToEvent(eventProp) {
|
|
17
16
|
return eventProp.substring(2).toLowerCase();
|
|
@@ -142,9 +141,7 @@ function ClickAwayListener(props) {
|
|
|
142
141
|
}
|
|
143
142
|
return undefined;
|
|
144
143
|
}, [handleClickAway, mouseEvent]);
|
|
145
|
-
return /*#__PURE__*/(
|
|
146
|
-
children: /*#__PURE__*/React.cloneElement(children, childrenProps)
|
|
147
|
-
});
|
|
144
|
+
return /*#__PURE__*/React.cloneElement(children, childrenProps);
|
|
148
145
|
}
|
|
149
146
|
process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes /* remove-proptypes */ = {
|
|
150
147
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -317,7 +317,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
317
317
|
root: RootSlot,
|
|
318
318
|
input: InputSlot
|
|
319
319
|
},
|
|
320
|
-
|
|
320
|
+
slotProps: componentsProps,
|
|
321
321
|
fullWidth: fullWidth,
|
|
322
322
|
inputComponent: inputComponent,
|
|
323
323
|
multiline: multiline,
|
|
@@ -127,6 +127,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
127
127
|
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
128
128
|
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
129
129
|
className: "notranslate",
|
|
130
|
+
"aria-hidden": true,
|
|
130
131
|
children: "\u200B"
|
|
131
132
|
})) : children
|
|
132
133
|
});
|
package/node/Grid/Grid.js
CHANGED
|
@@ -180,7 +180,7 @@ function generateRowGap({
|
|
|
180
180
|
const themeSpacing = theme.spacing(propValue);
|
|
181
181
|
if (themeSpacing !== '0px') {
|
|
182
182
|
return {
|
|
183
|
-
marginTop:
|
|
183
|
+
marginTop: `calc(-1 * ${themeSpacing})`,
|
|
184
184
|
[`& > .${_gridClasses.default.item}`]: {
|
|
185
185
|
paddingTop: themeSpacing
|
|
186
186
|
}
|
|
@@ -225,7 +225,7 @@ function generateColumnGap({
|
|
|
225
225
|
}, columnSpacingValues, (propValue, breakpoint) => {
|
|
226
226
|
const themeSpacing = theme.spacing(propValue);
|
|
227
227
|
if (themeSpacing !== '0px') {
|
|
228
|
-
const negativeValue =
|
|
228
|
+
const negativeValue = `calc(-1 * ${themeSpacing})`;
|
|
229
229
|
return {
|
|
230
230
|
width: `calc(100% + ${themeSpacing})`,
|
|
231
231
|
marginLeft: negativeValue,
|
package/node/Grid2/Grid2.js
CHANGED
|
@@ -11,6 +11,7 @@ var _Grid = require("@mui/system/Grid");
|
|
|
11
11
|
var _requirePropFactory = _interopRequireDefault(require("../utils/requirePropFactory"));
|
|
12
12
|
var _styles = require("../styles");
|
|
13
13
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
14
|
+
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
16
17
|
* Demos:
|
|
@@ -25,13 +26,19 @@ const Grid2 = (0, _Grid.createGrid)({
|
|
|
25
26
|
createStyledComponent: (0, _styles.styled)('div', {
|
|
26
27
|
name: 'MuiGrid2',
|
|
27
28
|
slot: 'Root',
|
|
28
|
-
overridesResolver: (props, styles) =>
|
|
29
|
+
overridesResolver: (props, styles) => {
|
|
30
|
+
const {
|
|
31
|
+
ownerState
|
|
32
|
+
} = props;
|
|
33
|
+
return [styles.root, ownerState.container && styles.container];
|
|
34
|
+
}
|
|
29
35
|
}),
|
|
30
36
|
componentName: 'MuiGrid2',
|
|
31
37
|
useThemeProps: inProps => (0, _DefaultPropsProvider.useDefaultProps)({
|
|
32
38
|
props: inProps,
|
|
33
39
|
name: 'MuiGrid2'
|
|
34
|
-
})
|
|
40
|
+
}),
|
|
41
|
+
useTheme: _useTheme.default
|
|
35
42
|
});
|
|
36
43
|
process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ = {
|
|
37
44
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
package/node/Hidden/HiddenJs.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
11
|
var _exactProp = _interopRequireDefault(require("@mui/utils/exactProp"));
|
|
13
12
|
var _withWidth = _interopRequireWildcard(require("./withWidth"));
|
|
14
13
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
14
|
/**
|
|
17
15
|
* @ignore - internal component.
|
|
18
|
-
*/
|
|
16
|
+
*/
|
|
17
|
+
function HiddenJs(props) {
|
|
19
18
|
const {
|
|
20
19
|
children,
|
|
21
20
|
only,
|
|
@@ -55,11 +54,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
55
54
|
if (!visible) {
|
|
56
55
|
return null;
|
|
57
56
|
}
|
|
58
|
-
return
|
|
59
|
-
children: children
|
|
60
|
-
});
|
|
57
|
+
return children;
|
|
61
58
|
}
|
|
62
|
-
|
|
59
|
+
HiddenJs.propTypes = {
|
|
63
60
|
/**
|
|
64
61
|
* The content of the component.
|
|
65
62
|
*/
|
|
@@ -123,8 +120,8 @@ process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
|
|
|
123
120
|
*/
|
|
124
121
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
125
122
|
xsUp: _propTypes.default.bool
|
|
126
|
-
}
|
|
123
|
+
};
|
|
127
124
|
if (process.env.NODE_ENV !== 'production') {
|
|
128
|
-
|
|
125
|
+
HiddenJs.propTypes = (0, _exactProp.default)(HiddenJs.propTypes);
|
|
129
126
|
}
|
|
130
127
|
var _default = exports.default = (0, _withWidth.default)()(HiddenJs);
|
|
@@ -135,6 +135,7 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
|
|
|
135
135
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
136
136
|
children: [position === 'start' ? (/* notranslate needed while Google Translate will not fix zero-width space issue */_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
137
137
|
className: "notranslate",
|
|
138
|
+
"aria-hidden": true,
|
|
138
139
|
children: "\u200B"
|
|
139
140
|
}))) : null, children]
|
|
140
141
|
})
|
|
@@ -16,6 +16,7 @@ var _ListContext = _interopRequireDefault(require("../List/ListContext"));
|
|
|
16
16
|
var _zeroStyled = require("../zero-styled");
|
|
17
17
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
18
18
|
var _listItemTextClasses = _interopRequireWildcard(require("./listItemTextClasses"));
|
|
19
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
const useUtilityClasses = ownerState => {
|
|
21
22
|
const {
|
|
@@ -87,6 +88,8 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
|
|
|
87
88
|
primaryTypographyProps,
|
|
88
89
|
secondary: secondaryProp,
|
|
89
90
|
secondaryTypographyProps,
|
|
91
|
+
slots = {},
|
|
92
|
+
slotProps = {},
|
|
90
93
|
...other
|
|
91
94
|
} = props;
|
|
92
95
|
const {
|
|
@@ -103,21 +106,39 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
|
|
|
103
106
|
dense
|
|
104
107
|
};
|
|
105
108
|
const classes = useUtilityClasses(ownerState);
|
|
109
|
+
const externalForwardedProps = {
|
|
110
|
+
slots,
|
|
111
|
+
slotProps: {
|
|
112
|
+
primary: primaryTypographyProps,
|
|
113
|
+
secondary: secondaryTypographyProps,
|
|
114
|
+
...slotProps
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const [PrimarySlot, primarySlotProps] = (0, _useSlot.default)('primary', {
|
|
118
|
+
className: classes.primary,
|
|
119
|
+
elementType: _Typography.default,
|
|
120
|
+
externalForwardedProps,
|
|
121
|
+
ownerState
|
|
122
|
+
});
|
|
123
|
+
const [SecondarySlot, secondarySlotProps] = (0, _useSlot.default)('secondary', {
|
|
124
|
+
className: classes.secondary,
|
|
125
|
+
elementType: _Typography.default,
|
|
126
|
+
externalForwardedProps,
|
|
127
|
+
ownerState
|
|
128
|
+
});
|
|
106
129
|
if (primary != null && primary.type !== _Typography.default && !disableTypography) {
|
|
107
|
-
primary = /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
130
|
+
primary = /*#__PURE__*/(0, _jsxRuntime.jsx)(PrimarySlot, {
|
|
108
131
|
variant: dense ? 'body2' : 'body1',
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
...primaryTypographyProps,
|
|
132
|
+
component: primarySlotProps?.variant ? undefined : 'span',
|
|
133
|
+
...primarySlotProps,
|
|
112
134
|
children: primary
|
|
113
135
|
});
|
|
114
136
|
}
|
|
115
137
|
if (secondary != null && secondary.type !== _Typography.default && !disableTypography) {
|
|
116
|
-
secondary = /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
138
|
+
secondary = /*#__PURE__*/(0, _jsxRuntime.jsx)(SecondarySlot, {
|
|
117
139
|
variant: "body2",
|
|
118
|
-
className: classes.secondary,
|
|
119
140
|
color: "textSecondary",
|
|
120
|
-
...
|
|
141
|
+
...secondarySlotProps,
|
|
121
142
|
children: secondary
|
|
122
143
|
});
|
|
123
144
|
}
|
|
@@ -167,6 +188,7 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
|
|
|
167
188
|
/**
|
|
168
189
|
* These props will be forwarded to the primary typography component
|
|
169
190
|
* (as long as disableTypography is not `true`).
|
|
191
|
+
* @deprecated Use `slotProps.primary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
170
192
|
*/
|
|
171
193
|
primaryTypographyProps: _propTypes.default.object,
|
|
172
194
|
/**
|
|
@@ -176,8 +198,25 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
|
|
|
176
198
|
/**
|
|
177
199
|
* These props will be forwarded to the secondary typography component
|
|
178
200
|
* (as long as disableTypography is not `true`).
|
|
201
|
+
* @deprecated Use `slotProps.secondary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
179
202
|
*/
|
|
180
203
|
secondaryTypographyProps: _propTypes.default.object,
|
|
204
|
+
/**
|
|
205
|
+
* The props used for each slot inside.
|
|
206
|
+
* @default {}
|
|
207
|
+
*/
|
|
208
|
+
slotProps: _propTypes.default.shape({
|
|
209
|
+
primary: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
210
|
+
secondary: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
211
|
+
}),
|
|
212
|
+
/**
|
|
213
|
+
* The components used for each slot inside.
|
|
214
|
+
* @default {}
|
|
215
|
+
*/
|
|
216
|
+
slots: _propTypes.default.shape({
|
|
217
|
+
primary: _propTypes.default.elementType,
|
|
218
|
+
secondary: _propTypes.default.elementType
|
|
219
|
+
}),
|
|
181
220
|
/**
|
|
182
221
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
183
222
|
*/
|
package/node/Modal/useModal.js
CHANGED
|
@@ -17,6 +17,7 @@ function getContainer(container) {
|
|
|
17
17
|
function getHasTransition(children) {
|
|
18
18
|
return children ? children.props.hasOwnProperty('in') : false;
|
|
19
19
|
}
|
|
20
|
+
const noop = () => {};
|
|
20
21
|
|
|
21
22
|
// A modal manager used to track and manage the state of open Modals.
|
|
22
23
|
// Modals don't open on the server so this won't conflict with concurrent requests.
|
|
@@ -188,8 +189,8 @@ function useModal(parameters) {
|
|
|
188
189
|
}
|
|
189
190
|
};
|
|
190
191
|
return {
|
|
191
|
-
onEnter: (0, _utils.unstable_createChainedFunction)(handleEnter, children?.props.onEnter),
|
|
192
|
-
onExited: (0, _utils.unstable_createChainedFunction)(handleExited, children?.props.onExited)
|
|
192
|
+
onEnter: (0, _utils.unstable_createChainedFunction)(handleEnter, children?.props.onEnter ?? noop),
|
|
193
|
+
onExited: (0, _utils.unstable_createChainedFunction)(handleExited, children?.props.onExited ?? noop)
|
|
193
194
|
};
|
|
194
195
|
};
|
|
195
196
|
return {
|
package/node/NoSsr/NoSsr.js
CHANGED
|
@@ -10,7 +10,6 @@ exports.default = void 0;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _utils = require("@mui/utils");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
13
|
/**
|
|
15
14
|
* NoSsr purposely removes components from the subject of Server Side Rendering (SSR).
|
|
16
15
|
*
|
|
@@ -47,10 +46,8 @@ function NoSsr(props) {
|
|
|
47
46
|
}
|
|
48
47
|
}, [defer]);
|
|
49
48
|
|
|
50
|
-
//
|
|
51
|
-
return
|
|
52
|
-
children: mountedState ? children : fallback
|
|
53
|
-
});
|
|
49
|
+
// TODO casting won't be needed at one point https://github.com/DefinitelyTyped/DefinitelyTyped/pull/65135
|
|
50
|
+
return mountedState ? children : fallback;
|
|
54
51
|
}
|
|
55
52
|
process.env.NODE_ENV !== "production" ? NoSsr.propTypes /* remove-proptypes */ = {
|
|
56
53
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -127,6 +127,7 @@ function NotchedOutline(props) {
|
|
|
127
127
|
}) : // notranslate needed while Google Translate will not fix zero-width space issue
|
|
128
128
|
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
129
129
|
className: "notranslate",
|
|
130
|
+
"aria-hidden": true,
|
|
130
131
|
children: "\u200B"
|
|
131
132
|
}))
|
|
132
133
|
})
|
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _Grid = _interopRequireDefault(require("@mui/material-pigment-css/Grid"));
|
|
13
13
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
14
14
|
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
15
|
-
var
|
|
15
|
+
var _Grid2 = require("@mui/system/Grid");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
// @ts-ignore
|
|
18
18
|
|
|
@@ -38,7 +38,7 @@ const useUtilityClasses = ownerState => {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
const slots = {
|
|
41
|
-
root: ['root', container && 'container', ...(0,
|
|
41
|
+
root: ['root', container && 'container', ...(0, _Grid2.unstable_generateDirectionClasses)(direction), ...(0, _Grid2.unstable_generateSizeClassNames)(gridSize), ...(container ? (0, _Grid2.unstable_generateSpacingClassNames)(spacing) : [])]
|
|
42
42
|
};
|
|
43
43
|
return (0, _composeClasses.default)(slots, slot => (0, _generateUtilityClass.default)('MuiGrid2', slot), {});
|
|
44
44
|
};
|
package/node/Portal/Portal.js
CHANGED
|
@@ -11,7 +11,6 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _utils = require("@mui/utils");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
function getContainer(container) {
|
|
16
15
|
return typeof container === 'function' ? container() : container;
|
|
17
16
|
}
|
|
@@ -57,13 +56,9 @@ const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef
|
|
|
57
56
|
};
|
|
58
57
|
return /*#__PURE__*/React.cloneElement(children, newProps);
|
|
59
58
|
}
|
|
60
|
-
return
|
|
61
|
-
children: children
|
|
62
|
-
});
|
|
59
|
+
return children;
|
|
63
60
|
}
|
|
64
|
-
return /*#__PURE__*/(
|
|
65
|
-
children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode
|
|
66
|
-
});
|
|
61
|
+
return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;
|
|
67
62
|
});
|
|
68
63
|
process.env.NODE_ENV !== "production" ? Portal.propTypes /* remove-proptypes */ = {
|
|
69
64
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -469,6 +469,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
469
469
|
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
470
470
|
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
471
471
|
className: "notranslate",
|
|
472
|
+
"aria-hidden": true,
|
|
472
473
|
children: "\u200B"
|
|
473
474
|
})) : display
|
|
474
475
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectNativeInput, {
|