@mui/material 6.0.0-alpha.5 → 6.0.0-alpha.7
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/Autocomplete/Autocomplete.d.ts +78 -12
- package/Autocomplete/Autocomplete.js +120 -59
- 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 +95 -0
- package/Checkbox/Checkbox.js +3 -1
- package/Chip/chipClasses.d.ts +28 -26
- package/Chip/chipClasses.js +1 -1
- package/CircularProgress/circularProgressClasses.d.ts +6 -2
- 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 +4 -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/Autocomplete/Autocomplete.js +120 -59
- 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/Autocomplete/Autocomplete.js +120 -60
- 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 +6 -6
- package/umd/material-ui.development.js +2705 -1353
- package/umd/material-ui.production.min.js +4 -4
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',
|
package/Link/Link.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
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
|
const _excluded = ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant", "sx"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
+
import { alpha } from '@mui/system/colorManipulator';
|
|
9
10
|
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
10
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
12
|
import capitalize from '../utils/capitalize';
|
|
12
|
-
import styled from '../
|
|
13
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
13
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
14
|
import useIsFocusVisible from '../utils/useIsFocusVisible';
|
|
15
15
|
import useForkRef from '../utils/useForkRef';
|
|
16
16
|
import Typography from '../Typography';
|
|
17
17
|
import linkClasses, { getLinkUtilityClass } from './linkClasses';
|
|
18
18
|
import getTextDecoration, { colorTransformations } from './getTextDecoration';
|
|
19
|
+
import useTheme from '../styles/useTheme';
|
|
19
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
const useThemeProps = createUseThemeProps('MuiLink');
|
|
20
22
|
const useUtilityClasses = ownerState => {
|
|
21
23
|
const {
|
|
22
24
|
classes,
|
|
@@ -39,60 +41,92 @@ const LinkRoot = styled(Typography, {
|
|
|
39
41
|
return [styles.root, styles[`underline${capitalize(ownerState.underline)}`], ownerState.component === 'button' && styles.button];
|
|
40
42
|
}
|
|
41
43
|
})(({
|
|
42
|
-
theme
|
|
43
|
-
ownerState
|
|
44
|
+
theme
|
|
44
45
|
}) => {
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
46
|
+
return {
|
|
47
|
+
variants: [{
|
|
48
|
+
props: {
|
|
49
|
+
underline: 'none'
|
|
50
|
+
},
|
|
51
|
+
style: {
|
|
52
|
+
textDecoration: 'none'
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
props: {
|
|
56
|
+
underline: 'hover'
|
|
57
|
+
},
|
|
58
|
+
style: {
|
|
59
|
+
textDecoration: 'none',
|
|
60
|
+
'&:hover': {
|
|
61
|
+
textDecoration: 'underline'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
props: {
|
|
66
|
+
underline: 'always'
|
|
67
|
+
},
|
|
68
|
+
style: {
|
|
69
|
+
textDecoration: 'underline',
|
|
70
|
+
'&:hover': {
|
|
71
|
+
textDecorationColor: 'inherit'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
props: ({
|
|
76
|
+
underline,
|
|
77
|
+
ownerState
|
|
78
|
+
}) => underline === 'always' && ownerState.color !== 'inherit',
|
|
79
|
+
style: {
|
|
80
|
+
textDecorationColor: 'var(--Link-underlineColor)'
|
|
81
|
+
}
|
|
82
|
+
}, ...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
|
|
83
|
+
props: {
|
|
84
|
+
underline: 'always',
|
|
85
|
+
color
|
|
86
|
+
},
|
|
87
|
+
style: {
|
|
88
|
+
'--Link-underlineColor': theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.4)` : alpha(theme.palette[color].main, 0.4)
|
|
89
|
+
}
|
|
90
|
+
})), {
|
|
91
|
+
props: {
|
|
92
|
+
component: 'button'
|
|
93
|
+
},
|
|
94
|
+
style: {
|
|
95
|
+
position: 'relative',
|
|
96
|
+
WebkitTapHighlightColor: 'transparent',
|
|
97
|
+
backgroundColor: 'transparent',
|
|
98
|
+
// Reset default value
|
|
99
|
+
// We disable the focus ring for mouse, touch and keyboard users.
|
|
100
|
+
outline: 0,
|
|
101
|
+
border: 0,
|
|
102
|
+
margin: 0,
|
|
103
|
+
// Remove the margin in Safari
|
|
104
|
+
borderRadius: 0,
|
|
105
|
+
padding: 0,
|
|
106
|
+
// Remove the padding in Firefox
|
|
107
|
+
cursor: 'pointer',
|
|
108
|
+
userSelect: 'none',
|
|
109
|
+
verticalAlign: 'middle',
|
|
110
|
+
MozAppearance: 'none',
|
|
111
|
+
// Reset
|
|
112
|
+
WebkitAppearance: 'none',
|
|
113
|
+
// Reset
|
|
114
|
+
'&::-moz-focus-inner': {
|
|
115
|
+
borderStyle: 'none' // Remove Firefox dotted outline.
|
|
116
|
+
},
|
|
117
|
+
[`&.${linkClasses.focusVisible}`]: {
|
|
118
|
+
outline: 'auto'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}]
|
|
122
|
+
};
|
|
90
123
|
});
|
|
91
124
|
const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
92
125
|
const props = useThemeProps({
|
|
93
126
|
props: inProps,
|
|
94
127
|
name: 'MuiLink'
|
|
95
128
|
});
|
|
129
|
+
const theme = useTheme();
|
|
96
130
|
const {
|
|
97
131
|
className,
|
|
98
132
|
color = 'primary',
|
|
@@ -148,11 +182,18 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
|
148
182
|
onFocus: handleFocus,
|
|
149
183
|
ref: handlerRef,
|
|
150
184
|
ownerState: ownerState,
|
|
151
|
-
variant: variant
|
|
152
|
-
|
|
185
|
+
variant: variant
|
|
186
|
+
}, other, {
|
|
187
|
+
sx: [...(colorTransformations[color] === undefined ? [{
|
|
153
188
|
color
|
|
154
|
-
}] : []), ...(Array.isArray(sx) ? sx : [sx])]
|
|
155
|
-
|
|
189
|
+
}] : []), ...(Array.isArray(sx) ? sx : [sx])],
|
|
190
|
+
style: _extends({}, other.style, underline === 'always' && color !== 'inherit' && {
|
|
191
|
+
'--Link-underlineColor': getTextDecoration({
|
|
192
|
+
theme,
|
|
193
|
+
ownerState
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
}));
|
|
156
197
|
});
|
|
157
198
|
process.env.NODE_ENV !== "production" ? Link.propTypes /* remove-proptypes */ = {
|
|
158
199
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -189,6 +230,10 @@ process.env.NODE_ENV !== "production" ? Link.propTypes /* remove-proptypes */ =
|
|
|
189
230
|
* @ignore
|
|
190
231
|
*/
|
|
191
232
|
onFocus: PropTypes.func,
|
|
233
|
+
/**
|
|
234
|
+
* @ignore
|
|
235
|
+
*/
|
|
236
|
+
style: PropTypes.object,
|
|
192
237
|
/**
|
|
193
238
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
194
239
|
*/
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import type { Theme } from '../styles';
|
|
2
|
-
export declare const colorTransformations:
|
|
3
|
-
primary: string;
|
|
4
|
-
textPrimary: string;
|
|
5
|
-
secondary: string;
|
|
6
|
-
textSecondary: string;
|
|
7
|
-
error: string;
|
|
8
|
-
};
|
|
2
|
+
export declare const colorTransformations: Record<string, string | null | undefined>;
|
|
9
3
|
declare const getTextDecoration: <T extends Theme>({ theme, ownerState, }: {
|
|
10
4
|
theme: T;
|
|
11
5
|
ownerState: {
|
|
12
6
|
color: string;
|
|
13
7
|
};
|
|
14
|
-
}) => string;
|
|
8
|
+
}) => string | null;
|
|
15
9
|
export default getTextDecoration;
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import { getPath } from '@mui/system';
|
|
1
|
+
import { getPath } from '@mui/system/style';
|
|
2
2
|
import { alpha } from '@mui/system/colorManipulator';
|
|
3
|
+
// TODO v7: remove this transformation
|
|
3
4
|
export const colorTransformations = {
|
|
4
|
-
primary: 'primary.main',
|
|
5
5
|
textPrimary: 'text.primary',
|
|
6
|
-
secondary: 'secondary.main',
|
|
7
6
|
textSecondary: 'text.secondary',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
// For main palette, the color will be applied by the styles above.
|
|
8
|
+
primary: null,
|
|
9
|
+
secondary: null,
|
|
10
|
+
error: null,
|
|
11
|
+
info: null,
|
|
12
|
+
success: null,
|
|
13
|
+
warning: null
|
|
12
14
|
};
|
|
13
15
|
const getTextDecoration = ({
|
|
14
16
|
theme,
|
|
15
17
|
ownerState
|
|
16
18
|
}) => {
|
|
17
|
-
|
|
19
|
+
let transformedColor = colorTransformations[ownerState.color];
|
|
20
|
+
if (transformedColor === null) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (transformedColor === undefined) {
|
|
24
|
+
transformedColor = ownerState.color;
|
|
25
|
+
}
|
|
18
26
|
const color = getPath(theme, `palette.${transformedColor}`, false) || ownerState.color;
|
|
19
27
|
const channelColor = getPath(theme, `palette.${transformedColor}Channel`);
|
|
20
28
|
if ('vars' in theme && channelColor) {
|
package/List/List.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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
|
const _excluded = ["children", "className", "component", "dense", "disablePadding", "subheader"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import ListContext from './ListContext';
|
|
13
12
|
import { getListUtilityClass } from './listClasses';
|
|
14
13
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const useThemeProps = createUseThemeProps('MuiList');
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
17
17
|
classes,
|
|
@@ -33,19 +33,28 @@ const ListRoot = styled('ul', {
|
|
|
33
33
|
} = props;
|
|
34
34
|
return [styles.root, !ownerState.disablePadding && styles.padding, ownerState.dense && styles.dense, ownerState.subheader && styles.subheader];
|
|
35
35
|
}
|
|
36
|
-
})(
|
|
37
|
-
ownerState
|
|
38
|
-
}) => _extends({
|
|
36
|
+
})({
|
|
39
37
|
listStyle: 'none',
|
|
40
38
|
margin: 0,
|
|
41
39
|
padding: 0,
|
|
42
|
-
position: 'relative'
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
position: 'relative',
|
|
41
|
+
variants: [{
|
|
42
|
+
props: ({
|
|
43
|
+
ownerState
|
|
44
|
+
}) => !ownerState.disablePadding,
|
|
45
|
+
style: {
|
|
46
|
+
paddingTop: 8,
|
|
47
|
+
paddingBottom: 8
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
props: ({
|
|
51
|
+
ownerState
|
|
52
|
+
}) => ownerState.subheader,
|
|
53
|
+
style: {
|
|
54
|
+
paddingTop: 0
|
|
55
|
+
}
|
|
56
|
+
}]
|
|
57
|
+
});
|
|
49
58
|
const List = /*#__PURE__*/React.forwardRef(function List(inProps, ref) {
|
|
50
59
|
const props = useThemeProps({
|
|
51
60
|
props: inProps,
|
package/ListItem/ListItem.js
CHANGED
|
@@ -12,8 +12,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
12
12
|
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
|
13
13
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
14
14
|
import { alpha } from '@mui/system/colorManipulator';
|
|
15
|
-
import styled from '../
|
|
16
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
15
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
17
16
|
import ButtonBase from '../ButtonBase';
|
|
18
17
|
import isMuiElement from '../utils/isMuiElement';
|
|
19
18
|
import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
@@ -23,6 +22,7 @@ import listItemClasses, { getListItemUtilityClass } from './listItemClasses';
|
|
|
23
22
|
import { listItemButtonClasses } from '../ListItemButton';
|
|
24
23
|
import ListItemSecondaryAction from '../ListItemSecondaryAction';
|
|
25
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
const useThemeProps = createUseThemeProps('MuiListItem');
|
|
26
26
|
export const overridesResolver = (props, styles) => {
|
|
27
27
|
const {
|
|
28
28
|
ownerState
|
|
@@ -8,10 +8,10 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import ListContext from '../List/ListContext';
|
|
11
|
-
import styled from '../
|
|
12
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
11
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
13
12
|
import { getListItemAvatarUtilityClass } from './listItemAvatarClasses';
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const useThemeProps = createUseThemeProps('MuiListItemAvatar');
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
17
17
|
alignItems,
|
|
@@ -8,14 +8,15 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import { alpha } from '@mui/system/colorManipulator';
|
|
11
|
-
import styled,
|
|
12
|
-
import
|
|
11
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
13
13
|
import ButtonBase from '../ButtonBase';
|
|
14
14
|
import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
15
15
|
import useForkRef from '../utils/useForkRef';
|
|
16
16
|
import ListContext from '../List/ListContext';
|
|
17
17
|
import listItemButtonClasses, { getListItemButtonUtilityClass } from './listItemButtonClasses';
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
const useThemeProps = createUseThemeProps('MuiListItemButton');
|
|
19
20
|
export const overridesResolver = (props, styles) => {
|
|
20
21
|
const {
|
|
21
22
|
ownerState
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
const _excluded = ["className"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import { getListItemIconUtilityClass } from './listItemIconClasses';
|
|
13
12
|
import ListContext from '../List/ListContext';
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const useThemeProps = createUseThemeProps('MuiListItemIcon');
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
17
17
|
alignItems,
|
|
@@ -32,15 +32,20 @@ const ListItemIconRoot = styled('div', {
|
|
|
32
32
|
return [styles.root, ownerState.alignItems === 'flex-start' && styles.alignItemsFlexStart];
|
|
33
33
|
}
|
|
34
34
|
})(({
|
|
35
|
-
theme
|
|
36
|
-
|
|
37
|
-
}) => _extends({
|
|
35
|
+
theme
|
|
36
|
+
}) => ({
|
|
38
37
|
minWidth: 56,
|
|
39
38
|
color: (theme.vars || theme).palette.action.active,
|
|
40
39
|
flexShrink: 0,
|
|
41
|
-
display: 'inline-flex'
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
display: 'inline-flex',
|
|
41
|
+
variants: [{
|
|
42
|
+
props: {
|
|
43
|
+
alignItems: 'flex-start'
|
|
44
|
+
},
|
|
45
|
+
style: {
|
|
46
|
+
marginTop: 8
|
|
47
|
+
}
|
|
48
|
+
}]
|
|
44
49
|
}));
|
|
45
50
|
|
|
46
51
|
/**
|
|
@@ -7,11 +7,11 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import ListContext from '../List/ListContext';
|
|
13
12
|
import { getListItemSecondaryActionClassesUtilityClass } from './listItemSecondaryActionClasses';
|
|
14
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const useThemeProps = createUseThemeProps('MuiListItemSecondaryAction');
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
17
17
|
disableGutters,
|
|
@@ -9,10 +9,10 @@ import clsx from 'clsx';
|
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import Typography from '../Typography';
|
|
11
11
|
import ListContext from '../List/ListContext';
|
|
12
|
-
import
|
|
13
|
-
import styled from '../styles/styled';
|
|
12
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
13
|
import listItemTextClasses, { getListItemTextUtilityClass } from './listItemTextClasses';
|
|
15
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const useThemeProps = createUseThemeProps('MuiListItemText');
|
|
16
16
|
const useUtilityClasses = ownerState => {
|
|
17
17
|
const {
|
|
18
18
|
classes,
|