@mui/material 6.1.10 → 6.2.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/Autocomplete/Autocomplete.js +6 -6
- package/AvatarGroup/AvatarGroup.js +5 -4
- package/Box/Box.d.ts +3 -1
- package/CHANGELOG.md +72 -2
- package/CardHeader/CardHeader.js +7 -5
- package/FormControl/FormControl.js +5 -8
- package/FormLabel/FormLabel.js +5 -8
- package/Grid/Grid.js +2 -2
- package/ListItemText/ListItemText.d.ts +36 -1
- package/ListItemText/ListItemText.js +46 -7
- package/PigmentGrid/PigmentGrid.js +1 -1
- package/Select/SelectInput.js +8 -0
- package/Slider/useSlider.js +64 -10
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +1 -0
- package/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +6 -6
- package/modern/AvatarGroup/AvatarGroup.js +5 -4
- package/modern/CardHeader/CardHeader.js +7 -5
- package/modern/FormControl/FormControl.js +5 -8
- package/modern/FormLabel/FormLabel.js +5 -8
- package/modern/Grid/Grid.js +2 -2
- package/modern/ListItemText/ListItemText.js +46 -7
- package/modern/PigmentGrid/PigmentGrid.js +1 -1
- package/modern/Select/SelectInput.js +8 -0
- package/modern/Slider/useSlider.js +64 -10
- package/modern/TextField/TextField.js +1 -0
- package/modern/index.js +1 -1
- package/modern/usePagination/usePagination.js +1 -1
- package/modern/version/index.js +3 -3
- package/node/Autocomplete/Autocomplete.js +6 -6
- package/node/AvatarGroup/AvatarGroup.js +5 -4
- package/node/CardHeader/CardHeader.js +7 -5
- package/node/FormControl/FormControl.js +5 -8
- package/node/FormLabel/FormLabel.js +5 -8
- package/node/Grid/Grid.js +2 -2
- package/node/ListItemText/ListItemText.js +46 -7
- package/node/PigmentGrid/PigmentGrid.js +2 -2
- package/node/Select/SelectInput.js +8 -0
- package/node/Slider/useSlider.js +64 -10
- package/node/TextField/TextField.js +1 -0
- package/node/index.js +1 -1
- package/node/usePagination/usePagination.js +1 -1
- package/node/version/index.js +3 -3
- package/package.json +8 -8
- package/styles/useThemeProps.d.ts +27 -0
- package/useLazyRipple/useLazyRipple.d.ts +1 -1
- package/usePagination/usePagination.js +1 -1
- package/utils/memoTheme.d.ts +1 -1
- package/version/index.js +3 -3
package/node/Slider/useSlider.js
CHANGED
|
@@ -14,6 +14,9 @@ var _utils = require("@mui/utils");
|
|
|
14
14
|
var _extractEventHandlers = _interopRequireDefault(require("@mui/utils/extractEventHandlers"));
|
|
15
15
|
var _areArraysEqual = _interopRequireDefault(require("../utils/areArraysEqual"));
|
|
16
16
|
const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
|
|
17
|
+
function getNewValue(currentValue, step, direction, min, max) {
|
|
18
|
+
return direction === 1 ? Math.min(currentValue + step, max) : Math.max(currentValue - step, min);
|
|
19
|
+
}
|
|
17
20
|
function asc(a, b) {
|
|
18
21
|
return a - b;
|
|
19
22
|
}
|
|
@@ -290,20 +293,65 @@ function useSlider(parameters) {
|
|
|
290
293
|
}
|
|
291
294
|
};
|
|
292
295
|
const createHandleHiddenInputKeyDown = otherHandlers => event => {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (step !== null) {
|
|
296
|
+
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'PageUp', 'PageDown', 'Home', 'End'].includes(event.key)) {
|
|
297
|
+
event.preventDefault();
|
|
296
298
|
const index = Number(event.currentTarget.getAttribute('data-index'));
|
|
297
299
|
const value = values[index];
|
|
298
300
|
let newValue = null;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
// Keys actions that change the value by more than the most granular `step`
|
|
302
|
+
// value are only applied if the step not `null`.
|
|
303
|
+
// When step is `null`, the `marks` prop is used instead to define valid values.
|
|
304
|
+
if (step != null) {
|
|
305
|
+
const stepSize = event.shiftKey ? shiftStep : step;
|
|
306
|
+
switch (event.key) {
|
|
307
|
+
case 'ArrowUp':
|
|
308
|
+
newValue = getNewValue(value, stepSize, 1, min, max);
|
|
309
|
+
break;
|
|
310
|
+
case 'ArrowRight':
|
|
311
|
+
newValue = getNewValue(value, stepSize, isRtl ? -1 : 1, min, max);
|
|
312
|
+
break;
|
|
313
|
+
case 'ArrowDown':
|
|
314
|
+
newValue = getNewValue(value, stepSize, -1, min, max);
|
|
315
|
+
break;
|
|
316
|
+
case 'ArrowLeft':
|
|
317
|
+
newValue = getNewValue(value, stepSize, isRtl ? 1 : -1, min, max);
|
|
318
|
+
break;
|
|
319
|
+
case 'PageUp':
|
|
320
|
+
newValue = getNewValue(value, shiftStep, 1, min, max);
|
|
321
|
+
break;
|
|
322
|
+
case 'PageDown':
|
|
323
|
+
newValue = getNewValue(value, shiftStep, -1, min, max);
|
|
324
|
+
break;
|
|
325
|
+
case 'Home':
|
|
326
|
+
newValue = min;
|
|
327
|
+
break;
|
|
328
|
+
case 'End':
|
|
329
|
+
newValue = max;
|
|
330
|
+
break;
|
|
331
|
+
default:
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
} else if (marks) {
|
|
335
|
+
const maxMarksValue = marksValues[marksValues.length - 1];
|
|
336
|
+
const currentMarkIndex = marksValues.indexOf(value);
|
|
337
|
+
const decrementKeys = [isRtl ? 'ArrowRight' : 'ArrowLeft', 'ArrowDown', 'PageDown', 'Home'];
|
|
338
|
+
const incrementKeys = [isRtl ? 'ArrowLeft' : 'ArrowRight', 'ArrowUp', 'PageUp', 'End'];
|
|
339
|
+
if (decrementKeys.includes(event.key)) {
|
|
340
|
+
if (currentMarkIndex === 0) {
|
|
341
|
+
newValue = marksValues[0];
|
|
342
|
+
} else {
|
|
343
|
+
newValue = marksValues[currentMarkIndex - 1];
|
|
344
|
+
}
|
|
345
|
+
} else if (incrementKeys.includes(event.key)) {
|
|
346
|
+
if (currentMarkIndex === marksValues.length - 1) {
|
|
347
|
+
newValue = maxMarksValue;
|
|
348
|
+
} else {
|
|
349
|
+
newValue = marksValues[currentMarkIndex + 1];
|
|
350
|
+
}
|
|
351
|
+
}
|
|
303
352
|
}
|
|
304
|
-
if (newValue
|
|
353
|
+
if (newValue != null) {
|
|
305
354
|
changeValue(event, newValue);
|
|
306
|
-
event.preventDefault();
|
|
307
355
|
}
|
|
308
356
|
}
|
|
309
357
|
otherHandlers?.onKeyDown?.(event);
|
|
@@ -325,6 +373,7 @@ function useSlider(parameters) {
|
|
|
325
373
|
}
|
|
326
374
|
const createHandleHiddenInputChange = otherHandlers => event => {
|
|
327
375
|
otherHandlers.onChange?.(event);
|
|
376
|
+
// this handles value change by Pointer or Touch events
|
|
328
377
|
// @ts-ignore
|
|
329
378
|
changeValue(event, event.target.valueAsNumber);
|
|
330
379
|
};
|
|
@@ -601,6 +650,10 @@ function useSlider(parameters) {
|
|
|
601
650
|
pointerEvents: active !== -1 && active !== index ? 'none' : undefined
|
|
602
651
|
};
|
|
603
652
|
};
|
|
653
|
+
let cssWritingMode;
|
|
654
|
+
if (orientation === 'vertical') {
|
|
655
|
+
cssWritingMode = isRtl ? 'vertical-rl' : 'vertical-lr';
|
|
656
|
+
}
|
|
604
657
|
const getHiddenInputProps = (externalProps = {}) => {
|
|
605
658
|
const externalHandlers = (0, _extractEventHandlers.default)(externalProps);
|
|
606
659
|
const ownEventHandlers = {
|
|
@@ -632,7 +685,8 @@ function useSlider(parameters) {
|
|
|
632
685
|
direction: isRtl ? 'rtl' : 'ltr',
|
|
633
686
|
// So that VoiceOver's focus indicator matches the thumb's dimensions
|
|
634
687
|
width: '100%',
|
|
635
|
-
height: '100%'
|
|
688
|
+
height: '100%',
|
|
689
|
+
writingMode: cssWritingMode
|
|
636
690
|
}
|
|
637
691
|
};
|
|
638
692
|
};
|
|
@@ -407,6 +407,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
407
407
|
SelectProps: _propTypes.default.object,
|
|
408
408
|
/**
|
|
409
409
|
* The size of the component.
|
|
410
|
+
* @default 'medium'
|
|
410
411
|
*/
|
|
411
412
|
size: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['medium', 'small']), _propTypes.default.string]),
|
|
412
413
|
/**
|
package/node/index.js
CHANGED
|
@@ -101,7 +101,7 @@ function usePagination(props = {}) {
|
|
|
101
101
|
page: item,
|
|
102
102
|
selected: item === page,
|
|
103
103
|
disabled,
|
|
104
|
-
'aria-current': item === page ? '
|
|
104
|
+
'aria-current': item === page ? 'page' : undefined
|
|
105
105
|
} : {
|
|
106
106
|
onClick: event => {
|
|
107
107
|
handleClick(event, buttonPage(item));
|
package/node/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "6.1
|
|
7
|
+
const version = exports.version = "6.2.1";
|
|
8
8
|
const major = exports.major = Number("6");
|
|
9
|
-
const minor = exports.minor = Number("
|
|
10
|
-
const patch = exports.patch = Number("
|
|
9
|
+
const minor = exports.minor = Number("2");
|
|
10
|
+
const patch = exports.patch = Number("1");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "6.1
|
|
3
|
+
"version": "6.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.26.0",
|
|
31
31
|
"@popperjs/core": "^2.11.8",
|
|
32
|
-
"@types/react-transition-group": "^4.4.
|
|
32
|
+
"@types/react-transition-group": "^4.4.12",
|
|
33
33
|
"clsx": "^2.1.1",
|
|
34
34
|
"csstype": "^3.1.3",
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
|
-
"react-is": "^
|
|
36
|
+
"react-is": "^19.0.0",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/
|
|
39
|
-
"@mui/
|
|
40
|
-
"@mui/
|
|
41
|
-
"@mui/
|
|
38
|
+
"@mui/core-downloads-tracker": "^6.2.1",
|
|
39
|
+
"@mui/utils": "^6.2.1",
|
|
40
|
+
"@mui/types": "^7.2.20",
|
|
41
|
+
"@mui/system": "^6.2.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
-
"@mui/material-pigment-css": "^6.1
|
|
49
|
+
"@mui/material-pigment-css": "^6.2.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@types/react": {
|
|
@@ -11,6 +11,33 @@ export type ThemedProps<Theme, Name extends keyof any> = Theme extends {
|
|
|
11
11
|
? Props
|
|
12
12
|
: {};
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Merges input `props` with the `defaultProps` for a component that were defined in the theme.
|
|
16
|
+
*
|
|
17
|
+
* The `defaultProps` are defined in the theme under `theme.components[componentName].defaultProps`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const createTheme = () => ({
|
|
23
|
+
* components: {
|
|
24
|
+
* MuiStat: {
|
|
25
|
+
* defaultProps: {
|
|
26
|
+
* variant: 'outlined',
|
|
27
|
+
* },
|
|
28
|
+
* },
|
|
29
|
+
* },
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* function Stat(props) {
|
|
33
|
+
* const themeProps = useThemeProps({ props, name: 'MuiStat' });
|
|
34
|
+
* return <div {...themeProps} />;
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param params.props The input props
|
|
39
|
+
* @param params.name The name of the component as defined in the theme
|
|
40
|
+
*/
|
|
14
41
|
export default function useThemeProps<
|
|
15
42
|
Theme extends ThemeWithProps,
|
|
16
43
|
Props,
|
|
@@ -10,7 +10,7 @@ type ControlledPromise<T = unknown> = Promise<T> & {
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class LazyRipple {
|
|
12
12
|
/** React ref to the ripple instance */
|
|
13
|
-
ref: React.
|
|
13
|
+
ref: React.RefObject<TouchRippleActions | null>;
|
|
14
14
|
/** If the ripple component should be mounted */
|
|
15
15
|
shouldMount: boolean;
|
|
16
16
|
/** Promise that resolves when the ripple component is mounted */
|
|
@@ -95,7 +95,7 @@ export default function usePagination(props = {}) {
|
|
|
95
95
|
page: item,
|
|
96
96
|
selected: item === page,
|
|
97
97
|
disabled,
|
|
98
|
-
'aria-current': item === page ? '
|
|
98
|
+
'aria-current': item === page ? 'page' : undefined
|
|
99
99
|
} : {
|
|
100
100
|
onClick: event => {
|
|
101
101
|
handleClick(event, buttonPage(item));
|
package/utils/memoTheme.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ declare const memoTheme: (styleFn: (props: {
|
|
|
3
3
|
theme: Theme;
|
|
4
4
|
}) => import("@mui/styled-engine").CSSInterpolation) => (props: {
|
|
5
5
|
theme: Theme;
|
|
6
|
-
}) => string | number | boolean | import("@mui/styled-engine").
|
|
6
|
+
}) => string | number | boolean | import("@mui/styled-engine").CSSObject | import("@mui/styled-engine").ComponentSelector | import("@mui/styled-engine").Keyframes | import("@mui/styled-engine").SerializedStyles | import("@mui/styled-engine").ArrayCSSInterpolation | null;
|
|
7
7
|
export default memoTheme;
|
package/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.1
|
|
1
|
+
export const version = "6.2.1";
|
|
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("1");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|