@mui/material 9.0.0 → 9.1.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/Accordion/Accordion.d.mts +2 -2
- package/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.js +3 -2
- package/Accordion/Accordion.mjs +3 -2
- package/AccordionSummary/AccordionSummary.js +27 -29
- package/AccordionSummary/AccordionSummary.mjs +27 -29
- package/Autocomplete/Autocomplete.js +73 -17
- package/Autocomplete/Autocomplete.mjs +73 -17
- package/Avatar/Avatar.js +4 -0
- package/Avatar/Avatar.mjs +4 -0
- package/Backdrop/Backdrop.d.mts +2 -2
- package/Backdrop/Backdrop.d.ts +2 -2
- package/Badge/Badge.js +31 -24
- package/Badge/Badge.mjs +31 -24
- package/BottomNavigationAction/BottomNavigationAction.js +6 -2
- package/BottomNavigationAction/BottomNavigationAction.mjs +6 -2
- package/Button/Button.js +19 -6
- package/Button/Button.mjs +19 -6
- package/ButtonBase/ButtonBase.d.mts +7 -0
- package/ButtonBase/ButtonBase.d.ts +7 -0
- package/ButtonBase/ButtonBase.js +5 -2
- package/ButtonBase/ButtonBase.mjs +5 -2
- package/ButtonBase/Ripple.js +21 -11
- package/ButtonBase/Ripple.mjs +21 -11
- package/ButtonBase/TouchRipple.js +252 -116
- package/ButtonBase/TouchRipple.mjs +253 -117
- package/CHANGELOG.md +216 -1245
- package/CardActionArea/CardActionArea.js +2 -1
- package/CardActionArea/CardActionArea.mjs +2 -1
- package/Checkbox/Checkbox.js +2 -1
- package/Checkbox/Checkbox.mjs +2 -1
- package/Chip/Chip.js +2 -1
- package/Chip/Chip.mjs +2 -1
- package/CircularProgress/CircularProgress.d.mts +12 -2
- package/CircularProgress/CircularProgress.d.ts +12 -2
- package/CircularProgress/CircularProgress.js +115 -58
- package/CircularProgress/CircularProgress.mjs +114 -58
- package/ClickAwayListener/ClickAwayListener.js +3 -6
- package/ClickAwayListener/ClickAwayListener.mjs +3 -6
- package/Collapse/Collapse.d.mts +15 -3
- package/Collapse/Collapse.d.ts +15 -3
- package/Collapse/Collapse.js +44 -31
- package/Collapse/Collapse.mjs +43 -30
- package/Dialog/Dialog.d.mts +2 -2
- package/Dialog/Dialog.d.ts +2 -2
- package/Dialog/Dialog.js +13 -6
- package/Dialog/Dialog.mjs +13 -6
- package/Drawer/Drawer.d.mts +2 -2
- package/Drawer/Drawer.d.ts +2 -2
- package/Drawer/Drawer.js +18 -4
- package/Drawer/Drawer.mjs +18 -4
- package/Fab/Fab.js +9 -2
- package/Fab/Fab.mjs +9 -2
- package/Fade/Fade.d.mts +15 -2
- package/Fade/Fade.d.ts +15 -2
- package/Fade/Fade.js +46 -19
- package/Fade/Fade.mjs +45 -18
- package/FilledInput/FilledInput.d.mts +4 -0
- package/FilledInput/FilledInput.d.ts +4 -0
- package/FilledInput/FilledInput.js +22 -23
- package/FilledInput/FilledInput.mjs +22 -23
- package/FormControl/useFormControl.d.mts +12 -2
- package/FormControl/useFormControl.d.ts +12 -2
- package/FormControl/useFormControl.js +13 -0
- package/FormControl/useFormControl.mjs +12 -0
- package/FormControlLabel/FormControlLabel.js +5 -8
- package/FormControlLabel/FormControlLabel.mjs +5 -8
- package/FormGroup/FormGroup.js +2 -5
- package/FormGroup/FormGroup.mjs +2 -5
- package/FormHelperText/FormHelperText.js +2 -5
- package/FormHelperText/FormHelperText.mjs +2 -5
- package/FormLabel/FormLabel.js +2 -5
- package/FormLabel/FormLabel.mjs +2 -5
- package/Grow/Grow.d.mts +15 -2
- package/Grow/Grow.d.ts +15 -2
- package/Grow/Grow.js +45 -28
- package/Grow/Grow.mjs +44 -27
- package/IconButton/IconButton.js +3 -9
- package/IconButton/IconButton.mjs +3 -9
- package/Input/Input.d.mts +4 -0
- package/Input/Input.d.ts +4 -0
- package/Input/Input.js +9 -2
- package/Input/Input.mjs +9 -2
- package/InputBase/InputBase.d.mts +2 -1
- package/InputBase/InputBase.d.ts +2 -1
- package/InputBase/InputBase.js +52 -16
- package/InputBase/InputBase.mjs +52 -16
- package/InputLabel/InputLabel.js +7 -9
- package/InputLabel/InputLabel.mjs +7 -9
- package/LICENSE +1 -1
- package/LinearProgress/LinearProgress.d.mts +12 -2
- package/LinearProgress/LinearProgress.d.ts +12 -2
- package/LinearProgress/LinearProgress.js +225 -126
- package/LinearProgress/LinearProgress.mjs +224 -126
- package/List/List.js +2 -1
- package/List/List.mjs +2 -1
- package/ListItem/ListItem.js +2 -1
- package/ListItem/ListItem.mjs +2 -1
- package/ListItemButton/ListItemButton.js +9 -2
- package/ListItemButton/ListItemButton.mjs +9 -2
- package/Menu/Menu.d.mts +1 -1
- package/Menu/Menu.d.ts +1 -1
- package/MenuItem/MenuItem.js +7 -1
- package/MenuItem/MenuItem.mjs +7 -1
- package/MenuList/MenuList.js +2 -1
- package/MenuList/MenuList.mjs +2 -1
- package/MobileStepper/MobileStepper.js +2 -1
- package/MobileStepper/MobileStepper.mjs +2 -1
- package/NativeSelect/NativeSelect.js +2 -5
- package/NativeSelect/NativeSelect.mjs +2 -5
- package/OutlinedInput/NotchedOutline.js +4 -3
- package/OutlinedInput/NotchedOutline.mjs +4 -3
- package/OutlinedInput/OutlinedInput.js +13 -23
- package/OutlinedInput/OutlinedInput.mjs +13 -23
- package/PaginationItem/PaginationItem.js +2 -1
- package/PaginationItem/PaginationItem.mjs +2 -1
- package/Paper/Paper.js +2 -1
- package/Paper/Paper.mjs +2 -1
- package/PigmentContainer/PigmentContainer.js +0 -1
- package/PigmentContainer/PigmentContainer.mjs +0 -1
- package/Popover/Popover.d.mts +1 -1
- package/Popover/Popover.d.ts +1 -1
- package/Popper/BasePopper.js +23 -1
- package/Popper/BasePopper.mjs +23 -1
- package/README.md +3 -2
- package/Radio/RadioButtonIcon.js +3 -2
- package/Radio/RadioButtonIcon.mjs +3 -2
- package/Rating/Rating.js +2 -1
- package/Rating/Rating.mjs +2 -1
- package/Select/Select.js +2 -5
- package/Select/Select.mjs +2 -5
- package/Select/SelectInput.js +276 -24
- package/Select/SelectInput.mjs +276 -24
- package/Select/utils/closedTypeahead.js +73 -0
- package/Select/utils/closedTypeahead.mjs +63 -0
- package/Skeleton/Skeleton.js +22 -2
- package/Skeleton/Skeleton.mjs +22 -2
- package/Slide/Slide.d.mts +15 -2
- package/Slide/Slide.d.ts +15 -2
- package/Slide/Slide.js +97 -47
- package/Slide/Slide.mjs +97 -47
- package/Slider/Slider.js +14 -4
- package/Slider/Slider.mjs +14 -4
- package/Slider/useSlider.js +4 -3
- package/Slider/useSlider.mjs +4 -3
- package/Snackbar/Snackbar.d.mts +2 -2
- package/Snackbar/Snackbar.d.ts +2 -2
- package/SpeedDial/SpeedDial.d.mts +1 -1
- package/SpeedDial/SpeedDial.d.ts +1 -1
- package/SpeedDial/SpeedDial.js +6 -2
- package/SpeedDial/SpeedDial.mjs +6 -2
- package/SpeedDialAction/SpeedDialAction.js +11 -2
- package/SpeedDialAction/SpeedDialAction.mjs +12 -3
- package/SpeedDialIcon/SpeedDialIcon.js +40 -37
- package/SpeedDialIcon/SpeedDialIcon.mjs +40 -37
- package/Step/Step.js +47 -15
- package/Step/Step.mjs +47 -15
- package/StepButton/StepButton.js +9 -3
- package/StepButton/StepButton.mjs +9 -3
- package/StepConnector/StepConnector.js +10 -0
- package/StepConnector/StepConnector.mjs +10 -0
- package/StepContent/StepContent.d.mts +2 -2
- package/StepContent/StepContent.d.ts +2 -2
- package/StepContent/StepContent.js +26 -2
- package/StepContent/StepContent.mjs +26 -2
- package/StepIcon/StepIcon.js +2 -1
- package/StepIcon/StepIcon.mjs +2 -1
- package/StepLabel/StepLabel.js +52 -7
- package/StepLabel/StepLabel.mjs +52 -7
- package/Stepper/Stepper.d.mts +2 -0
- package/Stepper/Stepper.d.ts +2 -0
- package/Stepper/Stepper.js +18 -0
- package/Stepper/Stepper.mjs +18 -0
- package/SvgIcon/SvgIcon.js +2 -1
- package/SvgIcon/SvgIcon.mjs +2 -1
- package/SwipeableDrawer/SwipeableDrawer.js +21 -6
- package/SwipeableDrawer/SwipeableDrawer.mjs +21 -6
- package/Switch/Switch.js +10 -8
- package/Switch/Switch.mjs +10 -8
- package/TableSortLabel/TableSortLabel.js +2 -1
- package/TableSortLabel/TableSortLabel.mjs +2 -1
- package/Tabs/ScrollbarSize.js +2 -1
- package/Tabs/ScrollbarSize.mjs +2 -1
- package/Tabs/Tabs.js +16 -4
- package/Tabs/Tabs.mjs +16 -4
- package/Tooltip/Tooltip.d.mts +2 -2
- package/Tooltip/Tooltip.d.ts +2 -2
- package/Tooltip/Tooltip.js +29 -108
- package/Tooltip/Tooltip.mjs +29 -108
- package/Unstable_TrapFocus/FocusTrap.js +60 -22
- package/Unstable_TrapFocus/FocusTrap.mjs +60 -22
- package/Zoom/Zoom.d.mts +15 -2
- package/Zoom/Zoom.d.ts +15 -2
- package/Zoom/Zoom.js +43 -16
- package/Zoom/Zoom.mjs +42 -15
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internal/Transition.d.mts +34 -0
- package/internal/Transition.d.ts +34 -0
- package/internal/Transition.js +444 -0
- package/internal/Transition.mjs +436 -0
- package/internal/react-transition-group.d.mts +8 -0
- package/internal/react-transition-group.d.ts +8 -0
- package/package.json +50 -50
- package/styles/createMotion.d.mts +8 -0
- package/styles/createMotion.d.ts +8 -0
- package/styles/createMotion.js +13 -0
- package/styles/createMotion.mjs +7 -0
- package/styles/createThemeFoundation.d.mts +2 -0
- package/styles/createThemeFoundation.d.ts +2 -0
- package/styles/createThemeNoVars.d.mts +3 -0
- package/styles/createThemeNoVars.d.ts +3 -0
- package/styles/createThemeNoVars.js +5 -0
- package/styles/createThemeNoVars.mjs +5 -0
- package/styles/createTransitions.d.mts +6 -2
- package/styles/createTransitions.d.ts +6 -2
- package/styles/createTransitions.js +12 -4
- package/styles/createTransitions.mjs +12 -4
- package/styles/enhanceHighContrast.d.mts +70 -0
- package/styles/enhanceHighContrast.d.ts +70 -0
- package/styles/enhanceHighContrast.js +502 -0
- package/styles/enhanceHighContrast.mjs +495 -0
- package/styles/index.d.mts +2 -0
- package/styles/index.d.ts +2 -0
- package/styles/index.js +8 -0
- package/styles/index.mjs +1 -0
- package/styles/reducedMotion.d.mts +7 -0
- package/styles/reducedMotion.d.ts +7 -0
- package/styles/reducedMotion.js +21 -0
- package/styles/reducedMotion.mjs +14 -0
- package/styles/responsiveFontSizes.js +19 -8
- package/styles/responsiveFontSizes.mjs +19 -8
- package/styles/shouldSkipGeneratingVar.js +1 -1
- package/styles/shouldSkipGeneratingVar.mjs +1 -1
- package/styles/stringifyTheme.js +1 -0
- package/styles/stringifyTheme.mjs +1 -0
- package/styles/useThemeProps.d.mts +3 -3
- package/styles/useThemeProps.d.ts +3 -3
- package/transitions/index.d.mts +1 -1
- package/transitions/index.d.ts +1 -1
- package/transitions/index.js +0 -11
- package/transitions/index.mjs +1 -1
- package/transitions/transition.d.mts +1 -12
- package/transitions/transition.d.ts +1 -12
- package/transitions/types.d.mts +73 -0
- package/transitions/types.d.ts +73 -0
- package/transitions/useReducedMotion.d.mts +14 -0
- package/transitions/useReducedMotion.d.ts +14 -0
- package/transitions/useReducedMotion.js +117 -0
- package/transitions/useReducedMotion.mjs +110 -0
- package/transitions/utils.d.mts +51 -2
- package/transitions/utils.d.ts +51 -2
- package/transitions/utils.js +97 -4
- package/transitions/utils.mjs +94 -4
- package/useAutocomplete/useAutocomplete.d.mts +12 -6
- package/useAutocomplete/useAutocomplete.d.ts +12 -6
- package/useAutocomplete/useAutocomplete.js +230 -55
- package/useAutocomplete/useAutocomplete.mjs +230 -55
- package/utils/contains.d.mts +2 -0
- package/utils/contains.d.ts +2 -0
- package/utils/contains.js +9 -0
- package/utils/contains.mjs +2 -0
- package/utils/focusable.d.mts +7 -0
- package/utils/focusable.d.ts +7 -0
- package/utils/focusable.js +20 -0
- package/utils/focusable.mjs +13 -0
- package/utils/getEventTarget.d.mts +2 -0
- package/utils/getEventTarget.d.ts +2 -0
- package/utils/getEventTarget.js +9 -0
- package/utils/getEventTarget.mjs +2 -0
- package/utils/mergeSlotProps.js +2 -8
- package/utils/mergeSlotProps.mjs +1 -8
- package/version/index.js +2 -2
- package/version/index.mjs +2 -2
- package/FormControl/formControlState.js +0 -21
- package/FormControl/formControlState.mjs +0 -15
- /package/transitions/{transition.js → types.js} +0 -0
- /package/transitions/{transition.mjs → types.mjs} +0 -0
|
@@ -10,9 +10,23 @@ import memoTheme from "../utils/memoTheme.mjs";
|
|
|
10
10
|
import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
|
|
11
11
|
import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
|
|
12
12
|
import capitalize from "../utils/capitalize.mjs";
|
|
13
|
+
import { getReducedMotionStyles, getTransitionStyles } from "../transitions/utils.mjs";
|
|
13
14
|
import { getLinearProgressUtilityClass } from "./linearProgressClasses.mjs";
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
const TRANSITION_DURATION = 4; // seconds
|
|
17
|
+
const EMPTY_STYLE = {};
|
|
18
|
+
let warnedMinMaxWithoutVariant = false;
|
|
19
|
+
let warnedInvalidMinMaxValue = false;
|
|
20
|
+
let warnedValueRequired = false;
|
|
21
|
+
let warnedInvalidMinMaxValueBuffer = false;
|
|
22
|
+
let warnedValueBufferRequired = false;
|
|
23
|
+
export function resetWarningFlags() {
|
|
24
|
+
warnedMinMaxWithoutVariant = false;
|
|
25
|
+
warnedInvalidMinMaxValue = false;
|
|
26
|
+
warnedValueRequired = false;
|
|
27
|
+
warnedInvalidMinMaxValueBuffer = false;
|
|
28
|
+
warnedValueBufferRequired = false;
|
|
29
|
+
}
|
|
16
30
|
const indeterminate1Keyframe = keyframes`
|
|
17
31
|
0% {
|
|
18
32
|
left: -35%;
|
|
@@ -188,7 +202,11 @@ const LinearProgressDashed = styled('span', {
|
|
|
188
202
|
})), bufferAnimation || {
|
|
189
203
|
// At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
|
|
190
204
|
animation: `${bufferKeyframe} 3s infinite linear`
|
|
191
|
-
}
|
|
205
|
+
}, memoTheme(({
|
|
206
|
+
theme
|
|
207
|
+
}) => getReducedMotionStyles(theme, {
|
|
208
|
+
animation: 'none'
|
|
209
|
+
}) || EMPTY_STYLE));
|
|
192
210
|
const LinearProgressBar1 = styled('span', {
|
|
193
211
|
name: 'MuiLinearProgress',
|
|
194
212
|
slot: 'Bar1',
|
|
@@ -197,59 +215,81 @@ const LinearProgressBar1 = styled('span', {
|
|
|
197
215
|
}
|
|
198
216
|
})(memoTheme(({
|
|
199
217
|
theme
|
|
200
|
-
}) =>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
218
|
+
}) => {
|
|
219
|
+
const reducedMotionIndeterminateStyles = getReducedMotionStyles(theme, {
|
|
220
|
+
animation: 'none',
|
|
221
|
+
left: '30%',
|
|
222
|
+
right: 'auto',
|
|
223
|
+
width: '40%'
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
width: '100%',
|
|
227
|
+
position: 'absolute',
|
|
228
|
+
left: 0,
|
|
229
|
+
bottom: 0,
|
|
230
|
+
top: 0,
|
|
231
|
+
...getTransitionStyles(theme, 'transform', {
|
|
232
|
+
duration: '0.2s',
|
|
233
|
+
easing: 'linear'
|
|
234
|
+
}),
|
|
235
|
+
transformOrigin: 'left',
|
|
236
|
+
variants: [{
|
|
237
|
+
props: {
|
|
238
|
+
color: 'inherit'
|
|
239
|
+
},
|
|
240
|
+
style: {
|
|
241
|
+
backgroundColor: 'currentColor'
|
|
242
|
+
}
|
|
243
|
+
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
|
244
|
+
props: {
|
|
245
|
+
color
|
|
246
|
+
},
|
|
247
|
+
style: {
|
|
248
|
+
backgroundColor: (theme.vars || theme).palette[color].main
|
|
249
|
+
}
|
|
250
|
+
})), {
|
|
251
|
+
props: {
|
|
252
|
+
variant: 'determinate'
|
|
253
|
+
},
|
|
254
|
+
style: {
|
|
255
|
+
...getTransitionStyles(theme, 'transform', {
|
|
256
|
+
duration: `.${TRANSITION_DURATION}s`,
|
|
257
|
+
easing: 'linear'
|
|
258
|
+
})
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
props: {
|
|
262
|
+
variant: 'buffer'
|
|
263
|
+
},
|
|
264
|
+
style: {
|
|
265
|
+
zIndex: 1,
|
|
266
|
+
...getTransitionStyles(theme, 'transform', {
|
|
267
|
+
duration: `.${TRANSITION_DURATION}s`,
|
|
268
|
+
easing: 'linear'
|
|
269
|
+
})
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
props: ({
|
|
273
|
+
ownerState
|
|
274
|
+
}) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
|
|
275
|
+
style: {
|
|
276
|
+
width: 'auto'
|
|
277
|
+
}
|
|
278
|
+
}, {
|
|
279
|
+
props: ({
|
|
280
|
+
ownerState
|
|
281
|
+
}) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
|
|
282
|
+
style: indeterminate1Animation || {
|
|
283
|
+
animation: `${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`
|
|
284
|
+
}
|
|
285
|
+
}, ...(reducedMotionIndeterminateStyles ? [{
|
|
286
|
+
props: ({
|
|
287
|
+
ownerState
|
|
288
|
+
}) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
|
|
289
|
+
style: reducedMotionIndeterminateStyles
|
|
290
|
+
}] : [])]
|
|
291
|
+
};
|
|
292
|
+
}));
|
|
253
293
|
const LinearProgressBar2 = styled('span', {
|
|
254
294
|
name: 'MuiLinearProgress',
|
|
255
295
|
slot: 'Bar2',
|
|
@@ -258,67 +298,84 @@ const LinearProgressBar2 = styled('span', {
|
|
|
258
298
|
}
|
|
259
299
|
})(memoTheme(({
|
|
260
300
|
theme
|
|
261
|
-
}) =>
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
'
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
301
|
+
}) => {
|
|
302
|
+
const reducedMotionIndeterminateStyles = getReducedMotionStyles(theme, {
|
|
303
|
+
animation: 'none',
|
|
304
|
+
display: 'none'
|
|
305
|
+
});
|
|
306
|
+
return {
|
|
307
|
+
width: '100%',
|
|
308
|
+
position: 'absolute',
|
|
309
|
+
left: 0,
|
|
310
|
+
bottom: 0,
|
|
311
|
+
top: 0,
|
|
312
|
+
...getTransitionStyles(theme, 'transform', {
|
|
313
|
+
duration: '0.2s',
|
|
314
|
+
easing: 'linear'
|
|
315
|
+
}),
|
|
316
|
+
transformOrigin: 'left',
|
|
317
|
+
variants: [...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
|
318
|
+
props: {
|
|
319
|
+
color
|
|
320
|
+
},
|
|
321
|
+
style: {
|
|
322
|
+
'--LinearProgressBar2-barColor': (theme.vars || theme).palette[color].main
|
|
323
|
+
}
|
|
324
|
+
})), {
|
|
325
|
+
props: ({
|
|
326
|
+
ownerState
|
|
327
|
+
}) => ownerState.variant !== 'buffer' && ownerState.color !== 'inherit',
|
|
328
|
+
style: {
|
|
329
|
+
backgroundColor: 'var(--LinearProgressBar2-barColor, currentColor)'
|
|
330
|
+
}
|
|
331
|
+
}, {
|
|
332
|
+
props: ({
|
|
333
|
+
ownerState
|
|
334
|
+
}) => ownerState.variant !== 'buffer' && ownerState.color === 'inherit',
|
|
335
|
+
style: {
|
|
336
|
+
backgroundColor: 'currentColor'
|
|
337
|
+
}
|
|
338
|
+
}, {
|
|
339
|
+
props: {
|
|
340
|
+
color: 'inherit'
|
|
341
|
+
},
|
|
342
|
+
style: {
|
|
343
|
+
opacity: 0.3
|
|
344
|
+
}
|
|
345
|
+
}, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
|
|
346
|
+
props: {
|
|
347
|
+
color,
|
|
348
|
+
variant: 'buffer'
|
|
349
|
+
},
|
|
350
|
+
style: {
|
|
351
|
+
backgroundColor: getColorShade(theme, color),
|
|
352
|
+
...getTransitionStyles(theme, 'transform', {
|
|
353
|
+
duration: `.${TRANSITION_DURATION}s`,
|
|
354
|
+
easing: 'linear'
|
|
355
|
+
})
|
|
356
|
+
}
|
|
357
|
+
})), {
|
|
358
|
+
props: ({
|
|
359
|
+
ownerState
|
|
360
|
+
}) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
|
|
361
|
+
style: {
|
|
362
|
+
width: 'auto'
|
|
363
|
+
}
|
|
364
|
+
}, {
|
|
365
|
+
props: ({
|
|
366
|
+
ownerState
|
|
367
|
+
}) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
|
|
368
|
+
style: indeterminate2Animation || {
|
|
369
|
+
animation: `${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`
|
|
370
|
+
}
|
|
371
|
+
}, ...(reducedMotionIndeterminateStyles ? [{
|
|
372
|
+
props: ({
|
|
373
|
+
ownerState
|
|
374
|
+
}) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
|
|
375
|
+
style: reducedMotionIndeterminateStyles
|
|
376
|
+
}] : [])]
|
|
377
|
+
};
|
|
378
|
+
}));
|
|
322
379
|
|
|
323
380
|
/**
|
|
324
381
|
* ## ARIA
|
|
@@ -335,6 +392,8 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
|
|
|
335
392
|
const {
|
|
336
393
|
className,
|
|
337
394
|
color = 'primary',
|
|
395
|
+
max: maxProp,
|
|
396
|
+
min: minProp,
|
|
338
397
|
value,
|
|
339
398
|
valueBuffer,
|
|
340
399
|
variant = 'indeterminate',
|
|
@@ -345,6 +404,14 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
|
|
|
345
404
|
color,
|
|
346
405
|
variant
|
|
347
406
|
};
|
|
407
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
408
|
+
if (!warnedMinMaxWithoutVariant && ['indeterminate', 'query'].includes(variant) && (minProp !== undefined || maxProp !== undefined)) {
|
|
409
|
+
console.warn(`MUI: You have provided the \`min\` or \`max\` props with an 'indeterminate' or 'query' variant. These props will have no effect.`);
|
|
410
|
+
warnedMinMaxWithoutVariant = true;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
const min = minProp ?? 0;
|
|
414
|
+
const max = maxProp ?? 100;
|
|
348
415
|
const classes = useUtilityClasses(ownerState);
|
|
349
416
|
const isRtl = useRtl();
|
|
350
417
|
const rootProps = {};
|
|
@@ -354,27 +421,48 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
|
|
|
354
421
|
};
|
|
355
422
|
if (variant === 'determinate' || variant === 'buffer') {
|
|
356
423
|
if (value !== undefined) {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
424
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
425
|
+
if (!warnedInvalidMinMaxValue && (value < min || value > max || min >= max)) {
|
|
426
|
+
console.error(`MUI: The min, max, and value props in LinearProgress should be numbers where min < max and min <= value <= max. Received min=${min}, max=${max}, value=${value}.`);
|
|
427
|
+
warnedInvalidMinMaxValue = true;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
const range = max - min;
|
|
431
|
+
let transform = (value - min) / range * 100 - 100;
|
|
361
432
|
if (isRtl) {
|
|
362
433
|
transform = -transform;
|
|
363
434
|
}
|
|
364
|
-
inlineStyles.bar1.transform = `translateX(${transform}%)
|
|
435
|
+
inlineStyles.bar1.transform = range > 0 ? `translateX(${transform}%)` : 'translateX(-100%)'; // empty-state fallback when range is invalid
|
|
436
|
+
|
|
437
|
+
rootProps['aria-valuenow'] = value;
|
|
438
|
+
rootProps['aria-valuemin'] = min;
|
|
439
|
+
rootProps['aria-valuemax'] = max;
|
|
365
440
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
366
|
-
|
|
441
|
+
if (!warnedValueRequired) {
|
|
442
|
+
console.error('MUI: You need to provide a value prop when using the determinate or buffer variant of LinearProgress.');
|
|
443
|
+
warnedValueRequired = true;
|
|
444
|
+
}
|
|
367
445
|
}
|
|
368
446
|
}
|
|
369
447
|
if (variant === 'buffer') {
|
|
370
448
|
if (valueBuffer !== undefined) {
|
|
371
|
-
|
|
449
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
450
|
+
if (!warnedInvalidMinMaxValueBuffer && (valueBuffer < min || valueBuffer > max || valueBuffer < value || min >= max)) {
|
|
451
|
+
console.error(`MUI: The min, max, value, and valueBuffer props in LinearProgress should be numbers where min < max and min <= value <= valueBuffer <= max. Received min=${min}, max=${max}, value=${value}, valueBuffer=${valueBuffer}.`);
|
|
452
|
+
warnedInvalidMinMaxValueBuffer = true;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
const range = max - min;
|
|
456
|
+
let transform = (valueBuffer - min) / range * 100 - 100;
|
|
372
457
|
if (isRtl) {
|
|
373
458
|
transform = -transform;
|
|
374
459
|
}
|
|
375
|
-
inlineStyles.bar2.transform = `translateX(${transform}%)
|
|
460
|
+
inlineStyles.bar2.transform = range > 0 ? `translateX(${transform}%)` : 'translateX(-100%)'; // empty-state fallback when range is invalid
|
|
376
461
|
} else if (process.env.NODE_ENV !== 'production') {
|
|
377
|
-
|
|
462
|
+
if (!warnedValueBufferRequired) {
|
|
463
|
+
console.error('MUI: You need to provide a valueBuffer prop when using the buffer variant of LinearProgress.');
|
|
464
|
+
warnedValueBufferRequired = true;
|
|
465
|
+
}
|
|
378
466
|
}
|
|
379
467
|
}
|
|
380
468
|
return /*#__PURE__*/_jsxs(LinearProgressRoot, {
|
|
@@ -418,18 +506,28 @@ process.env.NODE_ENV !== "production" ? LinearProgress.propTypes /* remove-propt
|
|
|
418
506
|
* @default 'primary'
|
|
419
507
|
*/
|
|
420
508
|
color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'primary', 'secondary']), PropTypes.string]),
|
|
509
|
+
/**
|
|
510
|
+
* The maximum value for the progress indicator for the determinate and buffer variants.
|
|
511
|
+
* @default 100
|
|
512
|
+
*/
|
|
513
|
+
max: PropTypes.number,
|
|
514
|
+
/**
|
|
515
|
+
* The minimum value for the progress indicator for the determinate and buffer variants.
|
|
516
|
+
* @default 0
|
|
517
|
+
*/
|
|
518
|
+
min: PropTypes.number,
|
|
421
519
|
/**
|
|
422
520
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
423
521
|
*/
|
|
424
522
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
425
523
|
/**
|
|
426
524
|
* The value of the progress indicator for the determinate and buffer variants.
|
|
427
|
-
* Value between
|
|
525
|
+
* Value between `min` and `max`.
|
|
428
526
|
*/
|
|
429
527
|
value: PropTypes.number,
|
|
430
528
|
/**
|
|
431
529
|
* The value for the buffer variant.
|
|
432
|
-
* Value between
|
|
530
|
+
* Value between `min` and `max`.
|
|
433
531
|
*/
|
|
434
532
|
valueBuffer: PropTypes.number,
|
|
435
533
|
/**
|
package/List/List.js
CHANGED
package/List/List.mjs
CHANGED
package/ListItem/ListItem.js
CHANGED
|
@@ -19,6 +19,7 @@ var _ListContext = _interopRequireDefault(require("../List/ListContext"));
|
|
|
19
19
|
var _listItemClasses = require("./listItemClasses");
|
|
20
20
|
var _ListItemButton = require("../ListItemButton");
|
|
21
21
|
var _ListItemSecondaryAction = _interopRequireDefault(require("../ListItemSecondaryAction"));
|
|
22
|
+
var _utils = require("../transitions/utils");
|
|
22
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
24
|
const overridesResolver = (props, styles) => {
|
|
24
25
|
const {
|
|
@@ -119,7 +120,7 @@ const ListItemRoot = exports.ListItemRoot = (0, _zeroStyled.styled)('div', {
|
|
|
119
120
|
ownerState
|
|
120
121
|
}) => ownerState.button,
|
|
121
122
|
style: {
|
|
122
|
-
|
|
123
|
+
...(0, _utils.getTransitionStyles)(theme, 'background-color', {
|
|
123
124
|
duration: theme.transitions.duration.shortest
|
|
124
125
|
}),
|
|
125
126
|
'&:hover': {
|
package/ListItem/ListItem.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import ListContext from "../List/ListContext.mjs";
|
|
|
12
12
|
import { getListItemUtilityClass } from "./listItemClasses.mjs";
|
|
13
13
|
import { listItemButtonClasses } from "../ListItemButton/index.mjs";
|
|
14
14
|
import ListItemSecondaryAction from "../ListItemSecondaryAction/index.mjs";
|
|
15
|
+
import { getTransitionStyles } from "../transitions/utils.mjs";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
export const overridesResolver = (props, styles) => {
|
|
17
18
|
const {
|
|
@@ -111,7 +112,7 @@ export const ListItemRoot = styled('div', {
|
|
|
111
112
|
ownerState
|
|
112
113
|
}) => ownerState.button,
|
|
113
114
|
style: {
|
|
114
|
-
|
|
115
|
+
...getTransitionStyles(theme, 'background-color', {
|
|
115
116
|
duration: theme.transitions.duration.shortest
|
|
116
117
|
}),
|
|
117
118
|
'&:hover': {
|
|
@@ -20,6 +20,7 @@ var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEff
|
|
|
20
20
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
21
21
|
var _ListContext = _interopRequireDefault(require("../List/ListContext"));
|
|
22
22
|
var _listItemButtonClasses = _interopRequireWildcard(require("./listItemButtonClasses"));
|
|
23
|
+
var _utils = require("../transitions/utils");
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
const overridesResolver = (props, styles) => {
|
|
25
26
|
const {
|
|
@@ -66,7 +67,7 @@ const ListItemButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
|
|
|
66
67
|
textAlign: 'left',
|
|
67
68
|
paddingTop: 8,
|
|
68
69
|
paddingBottom: 8,
|
|
69
|
-
|
|
70
|
+
...(0, _utils.getTransitionStyles)(theme, 'background-color', {
|
|
70
71
|
duration: theme.transitions.duration.shortest
|
|
71
72
|
}),
|
|
72
73
|
'&:hover': {
|
|
@@ -172,6 +173,12 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
|
|
|
172
173
|
selected
|
|
173
174
|
};
|
|
174
175
|
const classes = useUtilityClasses(ownerState);
|
|
176
|
+
|
|
177
|
+
// Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
|
|
178
|
+
const {
|
|
179
|
+
root,
|
|
180
|
+
...forwardedClasses
|
|
181
|
+
} = classes;
|
|
175
182
|
const handleRef = (0, _useForkRef.default)(listItemRef, ref);
|
|
176
183
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListContext.default.Provider, {
|
|
177
184
|
value: childContext,
|
|
@@ -186,7 +193,7 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
|
|
|
186
193
|
ownerState: ownerState,
|
|
187
194
|
className: (0, _clsx.default)(classes.root, className),
|
|
188
195
|
...other,
|
|
189
|
-
classes:
|
|
196
|
+
classes: forwardedClasses,
|
|
190
197
|
children: children
|
|
191
198
|
})
|
|
192
199
|
});
|
|
@@ -13,6 +13,7 @@ import useEnhancedEffect from "../utils/useEnhancedEffect.mjs";
|
|
|
13
13
|
import useForkRef from "../utils/useForkRef.mjs";
|
|
14
14
|
import ListContext from "../List/ListContext.mjs";
|
|
15
15
|
import listItemButtonClasses, { getListItemButtonUtilityClass } from "./listItemButtonClasses.mjs";
|
|
16
|
+
import { getTransitionStyles } from "../transitions/utils.mjs";
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
export const overridesResolver = (props, styles) => {
|
|
18
19
|
const {
|
|
@@ -58,7 +59,7 @@ const ListItemButtonRoot = styled(ButtonBase, {
|
|
|
58
59
|
textAlign: 'left',
|
|
59
60
|
paddingTop: 8,
|
|
60
61
|
paddingBottom: 8,
|
|
61
|
-
|
|
62
|
+
...getTransitionStyles(theme, 'background-color', {
|
|
62
63
|
duration: theme.transitions.duration.shortest
|
|
63
64
|
}),
|
|
64
65
|
'&:hover': {
|
|
@@ -164,6 +165,12 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
|
|
|
164
165
|
selected
|
|
165
166
|
};
|
|
166
167
|
const classes = useUtilityClasses(ownerState);
|
|
168
|
+
|
|
169
|
+
// Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
|
|
170
|
+
const {
|
|
171
|
+
root,
|
|
172
|
+
...forwardedClasses
|
|
173
|
+
} = classes;
|
|
167
174
|
const handleRef = useForkRef(listItemRef, ref);
|
|
168
175
|
return /*#__PURE__*/_jsx(ListContext.Provider, {
|
|
169
176
|
value: childContext,
|
|
@@ -178,7 +185,7 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
|
|
|
178
185
|
ownerState: ownerState,
|
|
179
186
|
className: clsx(classes.root, className),
|
|
180
187
|
...other,
|
|
181
|
-
classes:
|
|
188
|
+
classes: forwardedClasses,
|
|
182
189
|
children: children
|
|
183
190
|
})
|
|
184
191
|
});
|
package/Menu/Menu.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ import { PopoverProps } from "../Popover/index.mjs";
|
|
|
7
7
|
import { MenuListProps } from "../MenuList/index.mjs";
|
|
8
8
|
import { ModalProps } from "../Modal/index.mjs";
|
|
9
9
|
import { BackdropProps } from "../Backdrop/index.mjs";
|
|
10
|
-
import { TransitionProps } from "../transitions/
|
|
10
|
+
import { TransitionProps } from "../transitions/types.mjs";
|
|
11
11
|
import { MenuClasses } from "./menuClasses.mjs";
|
|
12
12
|
import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from "../utils/types.mjs";
|
|
13
13
|
export interface MenuRootSlotPropsOverrides {}
|
package/Menu/Menu.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { PopoverProps } from "../Popover/index.js";
|
|
|
7
7
|
import { MenuListProps } from "../MenuList/index.js";
|
|
8
8
|
import { ModalProps } from "../Modal/index.js";
|
|
9
9
|
import { BackdropProps } from "../Backdrop/index.js";
|
|
10
|
-
import { TransitionProps } from "../transitions/
|
|
10
|
+
import { TransitionProps } from "../transitions/types.js";
|
|
11
11
|
import { MenuClasses } from "./menuClasses.js";
|
|
12
12
|
import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from "../utils/types.js";
|
|
13
13
|
export interface MenuRootSlotPropsOverrides {}
|
package/MenuItem/MenuItem.js
CHANGED
|
@@ -206,6 +206,12 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
206
206
|
disableGutters
|
|
207
207
|
};
|
|
208
208
|
const classes = useUtilityClasses(props);
|
|
209
|
+
|
|
210
|
+
// Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
|
|
211
|
+
const {
|
|
212
|
+
root,
|
|
213
|
+
...forwardedClasses
|
|
214
|
+
} = classes;
|
|
209
215
|
const rovingItemProps = (0, _useRovingTabIndex.useRovingTabIndexItem)({
|
|
210
216
|
id: rovingItemId,
|
|
211
217
|
ref,
|
|
@@ -238,7 +244,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
238
244
|
className: (0, _clsx.default)(classes.root, className),
|
|
239
245
|
...other,
|
|
240
246
|
ownerState: ownerState,
|
|
241
|
-
classes:
|
|
247
|
+
classes: forwardedClasses
|
|
242
248
|
})
|
|
243
249
|
});
|
|
244
250
|
});
|
package/MenuItem/MenuItem.mjs
CHANGED
|
@@ -198,6 +198,12 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
198
198
|
disableGutters
|
|
199
199
|
};
|
|
200
200
|
const classes = useUtilityClasses(props);
|
|
201
|
+
|
|
202
|
+
// Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
|
|
203
|
+
const {
|
|
204
|
+
root,
|
|
205
|
+
...forwardedClasses
|
|
206
|
+
} = classes;
|
|
201
207
|
const rovingItemProps = useRovingTabIndexItem({
|
|
202
208
|
id: rovingItemId,
|
|
203
209
|
ref,
|
|
@@ -230,7 +236,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
230
236
|
className: clsx(classes.root, className),
|
|
231
237
|
...other,
|
|
232
238
|
ownerState: ownerState,
|
|
233
|
-
classes:
|
|
239
|
+
classes: forwardedClasses
|
|
234
240
|
})
|
|
235
241
|
});
|
|
236
242
|
});
|
package/MenuList/MenuList.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.default = void 0;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _useRovingTabIndex = require("@mui/utils/useRovingTabIndex");
|
|
13
|
+
var _contains = _interopRequireDefault(require("../utils/contains"));
|
|
13
14
|
var _ownerDocument = _interopRequireDefault(require("../utils/ownerDocument"));
|
|
14
15
|
var _getActiveElement = _interopRequireDefault(require("../utils/getActiveElement"));
|
|
15
16
|
var _getScrollbarSize = _interopRequireDefault(require("../utils/getScrollbarSize"));
|
|
@@ -185,7 +186,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
185
186
|
return null;
|
|
186
187
|
}
|
|
187
188
|
const currentFocus = (0, _getActiveElement.default)((0, _ownerDocument.default)(listRef.current));
|
|
188
|
-
if (currentFocus && listRef.current
|
|
189
|
+
if (currentFocus && (0, _contains.default)(listRef.current, currentFocus)) {
|
|
189
190
|
return currentFocus;
|
|
190
191
|
}
|
|
191
192
|
return focusInitialTarget(true);
|