@mui/material 6.0.0-alpha.5 → 6.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.js +2 -2
- package/AccordionSummary/accordionSummaryClasses.d.ts +1 -1
- package/Alert/Alert.d.ts +2 -2
- package/Alert/Alert.js +2 -2
- package/Alert/alertClasses.d.ts +12 -12
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/Backdrop/Backdrop.js +1 -1
- package/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +2 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/Button/Button.js +1 -1
- package/Button/buttonClasses.d.ts +33 -33
- package/ButtonGroup/buttonGroupClasses.d.ts +17 -17
- package/CHANGELOG.md +48 -0
- package/Checkbox/Checkbox.js +3 -1
- package/Chip/chipClasses.d.ts +28 -26
- package/Chip/chipClasses.js +1 -1
- package/Collapse/Collapse.js +66 -35
- package/Dialog/Dialog.js +105 -61
- package/DialogActions/DialogActions.js +16 -12
- package/DialogContent/DialogContent.js +25 -15
- package/DialogContentText/DialogContentText.js +3 -2
- package/DialogTitle/DialogTitle.js +2 -2
- package/Divider/Divider.d.ts +1 -1
- package/Divider/Divider.js +1 -1
- package/Drawer/Drawer.js +73 -32
- package/Fab/Fab.js +1 -1
- package/FilledInput/FilledInput.d.ts +1 -0
- package/FilledInput/FilledInput.js +170 -87
- package/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/FormControlLabel/FormControlLabel.js +1 -1
- package/FormHelperText/FormHelperText.js +2 -2
- package/FormLabel/FormLabel.js +23 -13
- package/Grow/Grow.js +3 -1
- package/Icon/Icon.js +63 -23
- package/ImageList/ImageList.js +2 -2
- package/ImageListItem/ImageListItem.js +2 -2
- package/ImageListItemBar/ImageListItemBar.js +2 -2
- package/Input/Input.d.ts +1 -0
- package/Input/Input.js +84 -61
- package/InputAdornment/InputAdornment.js +37 -21
- package/InputBase/InputBase.js +58 -28
- package/InputLabel/InputLabel.js +120 -58
- package/Link/Link.js +99 -54
- package/Link/getTextDecoration.d.ts +2 -8
- package/Link/getTextDecoration.js +16 -8
- package/List/List.js +22 -13
- package/ListItem/ListItem.js +2 -2
- package/ListItemAvatar/ListItemAvatar.js +2 -2
- package/ListItemButton/ListItemButton.js +3 -2
- package/ListItemIcon/ListItemIcon.js +14 -9
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/ListItemText/ListItemText.js +2 -2
- package/ListSubheader/ListSubheader.js +5 -3
- package/Menu/Menu.js +3 -2
- package/MenuItem/MenuItem.js +47 -27
- package/NativeSelect/NativeSelectInput.js +78 -49
- package/OutlinedInput/NotchedOutline.js +60 -43
- package/OutlinedInput/OutlinedInput.js +97 -39
- package/Pagination/Pagination.js +2 -2
- package/PaginationItem/PaginationItem.d.ts +1 -1
- package/PaginationItem/PaginationItem.js +1 -1
- package/PaginationItem/paginationItemClasses.d.ts +4 -4
- package/Paper/Paper.js +44 -21
- package/Radio/Radio.js +5 -3
- package/Radio/RadioButtonIcon.js +1 -1
- package/Rating/Rating.js +3 -2
- package/Select/Select.js +2 -1
- package/Select/SelectInput.js +8 -6
- package/Skeleton/Skeleton.js +109 -61
- package/Slider/Slider.d.ts +2 -2
- package/Slider/Slider.js +2 -2
- package/Snackbar/Snackbar.js +66 -40
- package/SnackbarContent/SnackbarContent.js +2 -2
- package/SpeedDial/SpeedDial.d.ts +28 -1
- package/SpeedDial/SpeedDial.js +107 -49
- package/SpeedDialAction/SpeedDialAction.js +50 -24
- package/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/StepConnector/stepConnectorClasses.d.ts +2 -2
- package/StepLabel/StepLabel.d.ts +3 -3
- package/StepLabel/StepLabel.js +3 -3
- package/SwipeableDrawer/SwipeArea.js +39 -18
- package/Tab/Tab.js +127 -55
- package/TabScrollButton/TabScrollButton.js +27 -15
- package/Table/Table.js +2 -2
- package/TableBody/TableBody.js +2 -2
- package/TableCell/TableCell.js +2 -2
- package/TableContainer/TableContainer.js +2 -2
- package/TableFooter/TableFooter.js +2 -2
- package/TableHead/TableHead.js +2 -2
- package/TablePagination/TablePagination.js +2 -2
- package/TableRow/TableRow.js +2 -2
- package/TableSortLabel/TableSortLabel.js +2 -2
- package/Tabs/Tabs.js +107 -54
- package/TextField/TextField.js +2 -2
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +2 -2
- package/Toolbar/Toolbar.js +3 -7
- package/Tooltip/Tooltip.js +185 -88
- package/Typography/Typography.js +89 -39
- package/index.js +1 -1
- package/internal/SwitchBase.js +39 -11
- package/modern/Accordion/Accordion.js +2 -2
- package/modern/Alert/Alert.js +2 -2
- package/modern/Avatar/Avatar.js +1 -1
- package/modern/Backdrop/Backdrop.js +1 -1
- package/modern/Badge/Badge.js +2 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -1
- package/modern/Button/Button.js +1 -1
- package/modern/Checkbox/Checkbox.js +3 -1
- package/modern/Chip/chipClasses.js +1 -1
- package/modern/Collapse/Collapse.js +66 -35
- package/modern/Dialog/Dialog.js +105 -61
- package/modern/DialogActions/DialogActions.js +16 -12
- package/modern/DialogContent/DialogContent.js +25 -15
- package/modern/DialogContentText/DialogContentText.js +3 -2
- package/modern/DialogTitle/DialogTitle.js +2 -2
- package/modern/Divider/Divider.js +1 -1
- package/modern/Drawer/Drawer.js +73 -32
- package/modern/Fab/Fab.js +1 -1
- package/modern/FilledInput/FilledInput.js +170 -87
- package/modern/FormControlLabel/FormControlLabel.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +2 -2
- package/modern/FormLabel/FormLabel.js +23 -13
- package/modern/Grow/Grow.js +3 -1
- package/modern/Icon/Icon.js +63 -23
- package/modern/ImageList/ImageList.js +2 -2
- package/modern/ImageListItem/ImageListItem.js +2 -2
- package/modern/ImageListItemBar/ImageListItemBar.js +2 -2
- package/modern/Input/Input.js +84 -61
- package/modern/InputAdornment/InputAdornment.js +37 -21
- package/modern/InputBase/InputBase.js +58 -28
- package/modern/InputLabel/InputLabel.js +120 -58
- package/modern/Link/Link.js +99 -54
- package/modern/Link/getTextDecoration.js +16 -8
- package/modern/List/List.js +22 -13
- package/modern/ListItem/ListItem.js +2 -2
- package/modern/ListItemAvatar/ListItemAvatar.js +2 -2
- package/modern/ListItemButton/ListItemButton.js +3 -2
- package/modern/ListItemIcon/ListItemIcon.js +14 -9
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -2
- package/modern/ListItemText/ListItemText.js +2 -2
- package/modern/ListSubheader/ListSubheader.js +5 -3
- package/modern/Menu/Menu.js +3 -2
- package/modern/MenuItem/MenuItem.js +47 -27
- package/modern/NativeSelect/NativeSelectInput.js +78 -49
- package/modern/OutlinedInput/NotchedOutline.js +60 -43
- package/modern/OutlinedInput/OutlinedInput.js +97 -39
- package/modern/Pagination/Pagination.js +2 -2
- package/modern/PaginationItem/PaginationItem.js +1 -1
- package/modern/Paper/Paper.js +44 -21
- package/modern/Radio/Radio.js +5 -3
- package/modern/Radio/RadioButtonIcon.js +1 -1
- package/modern/Rating/Rating.js +3 -2
- package/modern/Select/Select.js +2 -1
- package/modern/Select/SelectInput.js +8 -6
- package/modern/Skeleton/Skeleton.js +109 -61
- package/modern/Slider/Slider.js +2 -2
- package/modern/Snackbar/Snackbar.js +66 -40
- package/modern/SnackbarContent/SnackbarContent.js +2 -2
- package/modern/SpeedDial/SpeedDial.js +107 -49
- package/modern/SpeedDialAction/SpeedDialAction.js +50 -24
- package/modern/SpeedDialIcon/SpeedDialIcon.js +37 -16
- package/modern/StepLabel/StepLabel.js +3 -3
- package/modern/SwipeableDrawer/SwipeArea.js +39 -18
- package/modern/Tab/Tab.js +127 -55
- package/modern/TabScrollButton/TabScrollButton.js +27 -15
- package/modern/Table/Table.js +2 -2
- package/modern/TableBody/TableBody.js +2 -2
- package/modern/TableCell/TableCell.js +2 -2
- package/modern/TableContainer/TableContainer.js +2 -2
- package/modern/TableFooter/TableFooter.js +2 -2
- package/modern/TableHead/TableHead.js +2 -2
- package/modern/TablePagination/TablePagination.js +2 -2
- package/modern/TableRow/TableRow.js +2 -2
- package/modern/TableSortLabel/TableSortLabel.js +2 -2
- package/modern/Tabs/Tabs.js +107 -54
- package/modern/TextField/TextField.js +2 -2
- package/modern/Toolbar/Toolbar.js +3 -7
- package/modern/Tooltip/Tooltip.js +185 -88
- package/modern/Typography/Typography.js +89 -39
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +39 -11
- package/node/Accordion/Accordion.js +2 -2
- package/node/Alert/Alert.js +2 -2
- package/node/Avatar/Avatar.js +1 -1
- package/node/Backdrop/Backdrop.js +1 -1
- package/node/Badge/Badge.js +2 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +3 -3
- package/node/Button/Button.js +2 -2
- package/node/Checkbox/Checkbox.js +3 -1
- package/node/Chip/chipClasses.js +1 -1
- package/node/Collapse/Collapse.js +70 -39
- package/node/Dialog/Dialog.js +110 -66
- package/node/DialogActions/DialogActions.js +18 -14
- package/node/DialogContent/DialogContent.js +27 -17
- package/node/DialogContentText/DialogContentText.js +6 -5
- package/node/DialogTitle/DialogTitle.js +4 -4
- package/node/Divider/Divider.js +1 -1
- package/node/Drawer/Drawer.js +78 -37
- package/node/Fab/Fab.js +2 -2
- package/node/FilledInput/FilledInput.js +176 -91
- package/node/FormControlLabel/FormControlLabel.js +1 -1
- package/node/FormHelperText/FormHelperText.js +4 -4
- package/node/FormLabel/FormLabel.js +26 -16
- package/node/Grow/Grow.js +3 -1
- package/node/Icon/Icon.js +65 -25
- package/node/ImageList/ImageList.js +4 -4
- package/node/ImageListItem/ImageListItem.js +4 -4
- package/node/ImageListItemBar/ImageListItemBar.js +8 -8
- package/node/Input/Input.js +87 -64
- package/node/InputAdornment/InputAdornment.js +39 -23
- package/node/InputBase/InputBase.js +61 -31
- package/node/InputLabel/InputLabel.js +123 -61
- package/node/Link/Link.js +101 -56
- package/node/Link/getTextDecoration.js +18 -10
- package/node/List/List.js +24 -15
- package/node/ListItem/ListItem.js +5 -5
- package/node/ListItemAvatar/ListItemAvatar.js +4 -4
- package/node/ListItemButton/ListItemButton.js +6 -5
- package/node/ListItemIcon/ListItemIcon.js +16 -11
- package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +4 -4
- package/node/ListItemText/ListItemText.js +4 -4
- package/node/ListSubheader/ListSubheader.js +7 -5
- package/node/Menu/Menu.js +8 -7
- package/node/MenuItem/MenuItem.js +50 -30
- package/node/NativeSelect/NativeSelectInput.js +80 -53
- package/node/OutlinedInput/NotchedOutline.js +64 -47
- package/node/OutlinedInput/OutlinedInput.js +101 -43
- package/node/Pagination/Pagination.js +5 -5
- package/node/PaginationItem/PaginationItem.js +1 -1
- package/node/Paper/Paper.js +49 -28
- package/node/Radio/Radio.js +6 -4
- package/node/Radio/RadioButtonIcon.js +2 -2
- package/node/Rating/Rating.js +9 -8
- package/node/Select/Select.js +6 -5
- package/node/Select/SelectInput.js +9 -7
- package/node/Skeleton/Skeleton.js +113 -65
- package/node/Slider/Slider.js +2 -2
- package/node/Snackbar/Snackbar.js +68 -42
- package/node/SnackbarContent/SnackbarContent.js +6 -6
- package/node/SpeedDial/SpeedDial.js +111 -53
- package/node/SpeedDialAction/SpeedDialAction.js +54 -28
- package/node/SpeedDialIcon/SpeedDialIcon.js +39 -18
- package/node/StepLabel/StepLabel.js +3 -3
- package/node/SwipeableDrawer/SwipeArea.js +41 -20
- package/node/Tab/Tab.js +129 -57
- package/node/TabScrollButton/TabScrollButton.js +29 -17
- package/node/Table/Table.js +4 -4
- package/node/TableBody/TableBody.js +4 -4
- package/node/TableCell/TableCell.js +4 -4
- package/node/TableContainer/TableContainer.js +4 -4
- package/node/TableFooter/TableFooter.js +4 -4
- package/node/TableHead/TableHead.js +4 -4
- package/node/TablePagination/TablePagination.js +10 -10
- package/node/TableRow/TableRow.js +4 -4
- package/node/TableSortLabel/TableSortLabel.js +5 -5
- package/node/Tabs/Tabs.js +113 -60
- package/node/TextField/TextField.js +4 -4
- package/node/Toolbar/Toolbar.js +5 -9
- package/node/Tooltip/Tooltip.js +189 -92
- package/node/Typography/Typography.js +90 -40
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +41 -13
- package/package.json +4 -4
- package/umd/material-ui.development.js +2585 -1287
- package/umd/material-ui.production.min.js +4 -4
package/Input/Input.js
CHANGED
|
@@ -9,11 +9,12 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
9
9
|
import deepmerge from '@mui/utils/deepmerge';
|
|
10
10
|
import refType from '@mui/utils/refType';
|
|
11
11
|
import InputBase from '../InputBase';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
12
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
13
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
14
|
import inputClasses, { getInputUtilityClass } from './inputClasses';
|
|
15
|
-
import { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot,
|
|
15
|
+
import { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseInput } from '../InputBase/InputBase';
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const useThemeProps = createUseThemeProps('MuiInput');
|
|
17
18
|
const useUtilityClasses = ownerState => {
|
|
18
19
|
const {
|
|
19
20
|
classes,
|
|
@@ -37,70 +38,89 @@ const InputRoot = styled(InputBaseRoot, {
|
|
|
37
38
|
return [...inputBaseRootOverridesResolver(props, styles), !ownerState.disableUnderline && styles.underline];
|
|
38
39
|
}
|
|
39
40
|
})(({
|
|
40
|
-
theme
|
|
41
|
-
ownerState
|
|
41
|
+
theme
|
|
42
42
|
}) => {
|
|
43
43
|
const light = theme.palette.mode === 'light';
|
|
44
44
|
let bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
45
45
|
if (theme.vars) {
|
|
46
46
|
bottomLineColor = `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})`;
|
|
47
47
|
}
|
|
48
|
-
return
|
|
49
|
-
position: 'relative'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
bottom: 0,
|
|
59
|
-
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
60
|
-
content: '""',
|
|
61
|
-
position: 'absolute',
|
|
62
|
-
right: 0,
|
|
63
|
-
transform: 'scaleX(0)',
|
|
64
|
-
transition: theme.transitions.create('transform', {
|
|
65
|
-
duration: theme.transitions.duration.shorter,
|
|
66
|
-
easing: theme.transitions.easing.easeOut
|
|
67
|
-
}),
|
|
68
|
-
pointerEvents: 'none' // Transparent to the hover style.
|
|
69
|
-
},
|
|
70
|
-
[`&.${inputClasses.focused}:after`]: {
|
|
71
|
-
// translateX(0) is a workaround for Safari transform scale bug
|
|
72
|
-
// See https://github.com/mui/material-ui/issues/31766
|
|
73
|
-
transform: 'scaleX(1) translateX(0)'
|
|
74
|
-
},
|
|
75
|
-
[`&.${inputClasses.error}`]: {
|
|
76
|
-
'&::before, &::after': {
|
|
77
|
-
borderBottomColor: (theme.vars || theme).palette.error.main
|
|
48
|
+
return {
|
|
49
|
+
position: 'relative',
|
|
50
|
+
variants: [{
|
|
51
|
+
props: ({
|
|
52
|
+
ownerState
|
|
53
|
+
}) => ownerState.formControl,
|
|
54
|
+
style: {
|
|
55
|
+
'label + &': {
|
|
56
|
+
marginTop: 16
|
|
57
|
+
}
|
|
78
58
|
}
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
59
|
+
}, {
|
|
60
|
+
props: ({
|
|
61
|
+
ownerState
|
|
62
|
+
}) => !ownerState.disableUnderline,
|
|
63
|
+
style: {
|
|
64
|
+
'&::after': {
|
|
65
|
+
left: 0,
|
|
66
|
+
bottom: 0,
|
|
67
|
+
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
68
|
+
content: '""',
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
right: 0,
|
|
71
|
+
transform: 'scaleX(0)',
|
|
72
|
+
transition: theme.transitions.create('transform', {
|
|
73
|
+
duration: theme.transitions.duration.shorter,
|
|
74
|
+
easing: theme.transitions.easing.easeOut
|
|
75
|
+
}),
|
|
76
|
+
pointerEvents: 'none' // Transparent to the hover style.
|
|
77
|
+
},
|
|
78
|
+
[`&.${inputClasses.focused}:after`]: {
|
|
79
|
+
// translateX(0) is a workaround for Safari transform scale bug
|
|
80
|
+
// See https://github.com/mui/material-ui/issues/31766
|
|
81
|
+
transform: 'scaleX(1) translateX(0)'
|
|
82
|
+
},
|
|
83
|
+
[`&.${inputClasses.error}`]: {
|
|
84
|
+
'&::before, &::after': {
|
|
85
|
+
borderBottomColor: (theme.vars || theme).palette.error.main
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
'&::before': {
|
|
89
|
+
borderBottom: `1px solid ${bottomLineColor}`,
|
|
90
|
+
left: 0,
|
|
91
|
+
bottom: 0,
|
|
92
|
+
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
93
|
+
content: '"\\00a0"',
|
|
94
|
+
position: 'absolute',
|
|
95
|
+
right: 0,
|
|
96
|
+
transition: theme.transitions.create('border-bottom-color', {
|
|
97
|
+
duration: theme.transitions.duration.shorter
|
|
98
|
+
}),
|
|
99
|
+
pointerEvents: 'none' // Transparent to the hover style.
|
|
100
|
+
},
|
|
101
|
+
[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]: {
|
|
102
|
+
borderBottom: `2px solid ${(theme.vars || theme).palette.text.primary}`,
|
|
103
|
+
// Reset on touch devices, it doesn't add specificity
|
|
104
|
+
'@media (hover: none)': {
|
|
105
|
+
borderBottom: `1px solid ${bottomLineColor}`
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
[`&.${inputClasses.disabled}:before`]: {
|
|
109
|
+
borderBottomStyle: 'dotted'
|
|
110
|
+
}
|
|
98
111
|
}
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
}, ...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
|
|
113
|
+
props: {
|
|
114
|
+
color,
|
|
115
|
+
disableUnderline: false
|
|
116
|
+
},
|
|
117
|
+
style: {
|
|
118
|
+
'&::after': {
|
|
119
|
+
borderBottom: `2px solid ${(theme.vars || theme).palette[color].main}`
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}))]
|
|
123
|
+
};
|
|
104
124
|
});
|
|
105
125
|
const InputInput = styled(InputBaseInput, {
|
|
106
126
|
name: 'MuiInput',
|
|
@@ -113,7 +133,7 @@ const Input = /*#__PURE__*/React.forwardRef(function Input(inProps, ref) {
|
|
|
113
133
|
name: 'MuiInput'
|
|
114
134
|
});
|
|
115
135
|
const {
|
|
116
|
-
disableUnderline,
|
|
136
|
+
disableUnderline = false,
|
|
117
137
|
components = {},
|
|
118
138
|
componentsProps: componentsPropsProp,
|
|
119
139
|
fullWidth = false,
|
|
@@ -213,6 +233,7 @@ process.env.NODE_ENV !== "production" ? Input.propTypes /* remove-proptypes */ =
|
|
|
213
233
|
disabled: PropTypes.bool,
|
|
214
234
|
/**
|
|
215
235
|
* If `true`, the `input` will not have an underline.
|
|
236
|
+
* @default false
|
|
216
237
|
*/
|
|
217
238
|
disableUnderline: PropTypes.bool,
|
|
218
239
|
/**
|
|
@@ -337,5 +358,7 @@ process.env.NODE_ENV !== "production" ? Input.propTypes /* remove-proptypes */ =
|
|
|
337
358
|
*/
|
|
338
359
|
value: PropTypes.any
|
|
339
360
|
} : void 0;
|
|
340
|
-
Input
|
|
361
|
+
if (Input) {
|
|
362
|
+
Input.muiName = 'Input';
|
|
363
|
+
}
|
|
341
364
|
export default Input;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
var _span;
|
|
6
6
|
const _excluded = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"];
|
|
7
7
|
import * as React from 'react';
|
|
@@ -12,10 +12,10 @@ import capitalize from '../utils/capitalize';
|
|
|
12
12
|
import Typography from '../Typography';
|
|
13
13
|
import FormControlContext from '../FormControl/FormControlContext';
|
|
14
14
|
import useFormControl from '../FormControl/useFormControl';
|
|
15
|
-
import styled from '../
|
|
15
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
16
16
|
import inputAdornmentClasses, { getInputAdornmentUtilityClass } from './inputAdornmentClasses';
|
|
17
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
18
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const useThemeProps = createUseThemeProps('MuiInputAdornment');
|
|
19
19
|
const overridesResolver = (props, styles) => {
|
|
20
20
|
const {
|
|
21
21
|
ownerState
|
|
@@ -41,30 +41,46 @@ const InputAdornmentRoot = styled('div', {
|
|
|
41
41
|
slot: 'Root',
|
|
42
42
|
overridesResolver
|
|
43
43
|
})(({
|
|
44
|
-
theme
|
|
45
|
-
|
|
46
|
-
}) => _extends({
|
|
44
|
+
theme
|
|
45
|
+
}) => ({
|
|
47
46
|
display: 'flex',
|
|
48
47
|
height: '0.01em',
|
|
49
48
|
// Fix IE11 flexbox alignment. To remove at some point.
|
|
50
49
|
maxHeight: '2em',
|
|
51
50
|
alignItems: 'center',
|
|
52
51
|
whiteSpace: 'nowrap',
|
|
53
|
-
color: (theme.vars || theme).palette.action.active
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
color: (theme.vars || theme).palette.action.active,
|
|
53
|
+
variants: [{
|
|
54
|
+
props: {
|
|
55
|
+
variant: 'filled'
|
|
56
|
+
},
|
|
57
|
+
style: {
|
|
58
|
+
[`&.${inputAdornmentClasses.positionStart}&:not(.${inputAdornmentClasses.hiddenLabel})`]: {
|
|
59
|
+
marginTop: 16
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
props: {
|
|
64
|
+
position: 'start'
|
|
65
|
+
},
|
|
66
|
+
style: {
|
|
67
|
+
marginRight: 8
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
props: {
|
|
71
|
+
position: 'end'
|
|
72
|
+
},
|
|
73
|
+
style: {
|
|
74
|
+
marginLeft: 8
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
props: {
|
|
78
|
+
disablePointerEvents: true
|
|
79
|
+
},
|
|
80
|
+
style: {
|
|
81
|
+
pointerEvents: 'none'
|
|
82
|
+
}
|
|
83
|
+
}]
|
|
68
84
|
}));
|
|
69
85
|
const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inProps, ref) {
|
|
70
86
|
const props = useThemeProps({
|
package/InputBase/InputBase.js
CHANGED
|
@@ -15,8 +15,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
15
15
|
import formControlState from '../FormControl/formControlState';
|
|
16
16
|
import FormControlContext from '../FormControl/FormControlContext';
|
|
17
17
|
import useFormControl from '../FormControl/useFormControl';
|
|
18
|
-
import styled from '../
|
|
19
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
18
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
20
19
|
import capitalize from '../utils/capitalize';
|
|
21
20
|
import useForkRef from '../utils/useForkRef';
|
|
22
21
|
import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
@@ -24,6 +23,7 @@ import GlobalStyles from '../GlobalStyles';
|
|
|
24
23
|
import { isFilled } from './utils';
|
|
25
24
|
import inputBaseClasses, { getInputBaseUtilityClass } from './inputBaseClasses';
|
|
26
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
const useThemeProps = createUseThemeProps('MuiInputBase');
|
|
27
27
|
export const rootOverridesResolver = (props, styles) => {
|
|
28
28
|
const {
|
|
29
29
|
ownerState
|
|
@@ -64,8 +64,7 @@ export const InputBaseRoot = styled('div', {
|
|
|
64
64
|
slot: 'Root',
|
|
65
65
|
overridesResolver: rootOverridesResolver
|
|
66
66
|
})(({
|
|
67
|
-
theme
|
|
68
|
-
ownerState
|
|
67
|
+
theme
|
|
69
68
|
}) => _extends({}, theme.typography.body1, {
|
|
70
69
|
color: (theme.vars || theme).palette.text.primary,
|
|
71
70
|
lineHeight: '1.4375em',
|
|
@@ -79,21 +78,37 @@ export const InputBaseRoot = styled('div', {
|
|
|
79
78
|
[`&.${inputBaseClasses.disabled}`]: {
|
|
80
79
|
color: (theme.vars || theme).palette.text.disabled,
|
|
81
80
|
cursor: 'default'
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
},
|
|
82
|
+
variants: [{
|
|
83
|
+
props: ({
|
|
84
|
+
ownerState
|
|
85
|
+
}) => ownerState.multiline,
|
|
86
|
+
style: {
|
|
87
|
+
padding: '4px 0 5px'
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
props: ({
|
|
91
|
+
ownerState,
|
|
92
|
+
size
|
|
93
|
+
}) => ownerState.multiline && size === 'small',
|
|
94
|
+
style: {
|
|
95
|
+
paddingTop: 1
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
props: ({
|
|
99
|
+
ownerState
|
|
100
|
+
}) => ownerState.fullWidth,
|
|
101
|
+
style: {
|
|
102
|
+
width: '100%'
|
|
103
|
+
}
|
|
104
|
+
}]
|
|
89
105
|
}));
|
|
90
|
-
export const
|
|
106
|
+
export const InputBaseInput = styled('input', {
|
|
91
107
|
name: 'MuiInputBase',
|
|
92
108
|
slot: 'Input',
|
|
93
109
|
overridesResolver: inputOverridesResolver
|
|
94
110
|
})(({
|
|
95
|
-
theme
|
|
96
|
-
ownerState
|
|
111
|
+
theme
|
|
97
112
|
}) => {
|
|
98
113
|
const light = theme.palette.mode === 'light';
|
|
99
114
|
const placeholder = _extends({
|
|
@@ -115,7 +130,7 @@ export const InputBaseComponent = styled('input', {
|
|
|
115
130
|
} : {
|
|
116
131
|
opacity: light ? 0.42 : 0.5
|
|
117
132
|
};
|
|
118
|
-
return
|
|
133
|
+
return {
|
|
119
134
|
font: 'inherit',
|
|
120
135
|
letterSpacing: 'inherit',
|
|
121
136
|
color: 'currentColor',
|
|
@@ -177,18 +192,33 @@ export const InputBaseComponent = styled('input', {
|
|
|
177
192
|
'&:-webkit-autofill': {
|
|
178
193
|
animationDuration: '5000s',
|
|
179
194
|
animationName: 'mui-auto-fill'
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
},
|
|
196
|
+
variants: [{
|
|
197
|
+
props: {
|
|
198
|
+
size: 'small'
|
|
199
|
+
},
|
|
200
|
+
style: {
|
|
201
|
+
paddingTop: 1
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
props: ({
|
|
205
|
+
ownerState
|
|
206
|
+
}) => ownerState.multiline,
|
|
207
|
+
style: {
|
|
208
|
+
height: 'auto',
|
|
209
|
+
resize: 'none',
|
|
210
|
+
padding: 0,
|
|
211
|
+
paddingTop: 0
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
props: {
|
|
215
|
+
type: 'search'
|
|
216
|
+
},
|
|
217
|
+
style: {
|
|
218
|
+
MozAppearance: 'textfield' // Improve type search style.
|
|
219
|
+
}
|
|
220
|
+
}]
|
|
221
|
+
};
|
|
192
222
|
});
|
|
193
223
|
const inputGlobalStyles = /*#__PURE__*/_jsx(GlobalStyles, {
|
|
194
224
|
styles: {
|
|
@@ -428,7 +458,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
428
458
|
const classes = useUtilityClasses(ownerState);
|
|
429
459
|
const Root = slots.root || components.Root || InputBaseRoot;
|
|
430
460
|
const rootProps = slotProps.root || componentsProps.root || {};
|
|
431
|
-
const Input = slots.input || components.Input ||
|
|
461
|
+
const Input = slots.input || components.Input || InputBaseInput;
|
|
432
462
|
inputProps = _extends({}, inputProps, slotProps.input ?? componentsProps.input);
|
|
433
463
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
434
464
|
children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
package/InputLabel/InputLabel.js
CHANGED
|
@@ -10,11 +10,12 @@ import clsx from 'clsx';
|
|
|
10
10
|
import formControlState from '../FormControl/formControlState';
|
|
11
11
|
import useFormControl from '../FormControl/useFormControl';
|
|
12
12
|
import FormLabel, { formLabelClasses } from '../FormLabel';
|
|
13
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
14
13
|
import capitalize from '../utils/capitalize';
|
|
15
|
-
import
|
|
14
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
15
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
16
16
|
import { getInputLabelUtilityClasses } from './inputLabelClasses';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
const useThemeProps = createUseThemeProps('MuiInputLabel');
|
|
18
19
|
const useUtilityClasses = ownerState => {
|
|
19
20
|
const {
|
|
20
21
|
classes,
|
|
@@ -45,67 +46,128 @@ const InputLabelRoot = styled(FormLabel, {
|
|
|
45
46
|
}, styles.root, ownerState.formControl && styles.formControl, ownerState.size === 'small' && styles.sizeSmall, ownerState.shrink && styles.shrink, !ownerState.disableAnimation && styles.animated, ownerState.focused && styles.focused, styles[ownerState.variant]];
|
|
46
47
|
}
|
|
47
48
|
})(({
|
|
48
|
-
theme
|
|
49
|
-
|
|
50
|
-
}) => _extends({
|
|
49
|
+
theme
|
|
50
|
+
}) => ({
|
|
51
51
|
display: 'block',
|
|
52
52
|
transformOrigin: 'top left',
|
|
53
53
|
whiteSpace: 'nowrap',
|
|
54
54
|
overflow: 'hidden',
|
|
55
55
|
textOverflow: 'ellipsis',
|
|
56
|
-
maxWidth: '100%'
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
56
|
+
maxWidth: '100%',
|
|
57
|
+
variants: [{
|
|
58
|
+
props: ({
|
|
59
|
+
ownerState
|
|
60
|
+
}) => ownerState.formControl,
|
|
61
|
+
style: {
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
left: 0,
|
|
64
|
+
top: 0,
|
|
65
|
+
// slight alteration to spec spacing to match visual spec result
|
|
66
|
+
transform: 'translate(0, 20px) scale(1)'
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
props: {
|
|
70
|
+
size: 'small'
|
|
71
|
+
},
|
|
72
|
+
style: {
|
|
73
|
+
// Compensation for the `Input.inputSizeSmall` style.
|
|
74
|
+
transform: 'translate(0, 17px) scale(1)'
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
props: ({
|
|
78
|
+
ownerState
|
|
79
|
+
}) => ownerState.shrink,
|
|
80
|
+
style: {
|
|
81
|
+
transform: 'translate(0, -1.5px) scale(0.75)',
|
|
82
|
+
transformOrigin: 'top left',
|
|
83
|
+
maxWidth: '133%'
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
props: ({
|
|
87
|
+
ownerState
|
|
88
|
+
}) => !ownerState.disableAnimation,
|
|
89
|
+
style: {
|
|
90
|
+
transition: theme.transitions.create(['color', 'transform', 'max-width'], {
|
|
91
|
+
duration: theme.transitions.duration.shorter,
|
|
92
|
+
easing: theme.transitions.easing.easeOut
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
props: {
|
|
97
|
+
variant: 'filled'
|
|
98
|
+
},
|
|
99
|
+
style: {
|
|
100
|
+
// Chrome's autofill feature gives the input field a yellow background.
|
|
101
|
+
// Since the input field is behind the label in the HTML tree,
|
|
102
|
+
// the input field is drawn last and hides the label with an opaque background color.
|
|
103
|
+
// zIndex: 1 will raise the label above opaque background-colors of input.
|
|
104
|
+
zIndex: 1,
|
|
105
|
+
pointerEvents: 'none',
|
|
106
|
+
transform: 'translate(12px, 16px) scale(1)',
|
|
107
|
+
maxWidth: 'calc(100% - 24px)'
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
props: {
|
|
111
|
+
variant: 'filled',
|
|
112
|
+
size: 'small'
|
|
113
|
+
},
|
|
114
|
+
style: {
|
|
115
|
+
transform: 'translate(12px, 13px) scale(1)'
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
props: ({
|
|
119
|
+
variant,
|
|
120
|
+
ownerState
|
|
121
|
+
}) => variant === 'filled' && ownerState.shrink,
|
|
122
|
+
style: {
|
|
123
|
+
userSelect: 'none',
|
|
124
|
+
pointerEvents: 'auto',
|
|
125
|
+
transform: 'translate(12px, 7px) scale(0.75)',
|
|
126
|
+
maxWidth: 'calc(133% - 24px)'
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
props: ({
|
|
130
|
+
variant,
|
|
131
|
+
ownerState,
|
|
132
|
+
size
|
|
133
|
+
}) => variant === 'filled' && ownerState.shrink && size === 'small',
|
|
134
|
+
style: {
|
|
135
|
+
transform: 'translate(12px, 4px) scale(0.75)'
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
props: {
|
|
139
|
+
variant: 'outlined'
|
|
140
|
+
},
|
|
141
|
+
style: {
|
|
142
|
+
// see comment above on filled.zIndex
|
|
143
|
+
zIndex: 1,
|
|
144
|
+
pointerEvents: 'none',
|
|
145
|
+
transform: 'translate(14px, 16px) scale(1)',
|
|
146
|
+
maxWidth: 'calc(100% - 24px)'
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
props: {
|
|
150
|
+
variant: 'outlined',
|
|
151
|
+
size: 'small'
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
transform: 'translate(14px, 9px) scale(1)'
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
props: ({
|
|
158
|
+
variant,
|
|
159
|
+
ownerState
|
|
160
|
+
}) => variant === 'outlined' && ownerState.shrink,
|
|
161
|
+
style: {
|
|
162
|
+
userSelect: 'none',
|
|
163
|
+
pointerEvents: 'auto',
|
|
164
|
+
// Theoretically, we should have (8+5)*2/0.75 = 34px
|
|
165
|
+
// but it feels a better when it bleeds a bit on the left, so 32px.
|
|
166
|
+
maxWidth: 'calc(133% - 32px)',
|
|
167
|
+
transform: 'translate(14px, -9px) scale(0.75)'
|
|
168
|
+
}
|
|
169
|
+
}]
|
|
170
|
+
}));
|
|
109
171
|
const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
|
|
110
172
|
const props = useThemeProps({
|
|
111
173
|
name: 'MuiInputLabel',
|