@mui/material 6.0.0-alpha.4 → 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 +86 -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 +21 -14
- package/FormControlLabel/FormControlLabel.js +22 -4
- 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 +26 -14
- package/PaginationItem/PaginationItem.js +64 -20
- 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/SvgIcon/SvgIcon.js +73 -21
- 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 +22 -4
- 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 +64 -20
- 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/SvgIcon/SvgIcon.js +73 -21
- 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 +23 -5
- 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 +65 -20
- 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/SvgIcon/SvgIcon.js +79 -24
- 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 +2777 -1334
- package/umd/material-ui.production.min.js +4 -4
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.rootOverridesResolver = exports.inputOverridesResolver = exports.default = exports.InputBaseRoot = exports.
|
|
8
|
+
exports.rootOverridesResolver = exports.inputOverridesResolver = exports.default = exports.InputBaseRoot = exports.InputBaseInput = void 0;
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
|
|
@@ -20,8 +20,7 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
|
|
|
20
20
|
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
21
21
|
var _FormControlContext = _interopRequireDefault(require("../FormControl/FormControlContext"));
|
|
22
22
|
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
23
|
-
var
|
|
24
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
23
|
+
var _zeroStyled = require("../zero-styled");
|
|
25
24
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
26
25
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
27
26
|
var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEffect"));
|
|
@@ -32,6 +31,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
32
31
|
const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"];
|
|
33
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
34
33
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
34
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiInputBase');
|
|
35
35
|
const rootOverridesResolver = (props, styles) => {
|
|
36
36
|
const {
|
|
37
37
|
ownerState
|
|
@@ -69,13 +69,12 @@ const useUtilityClasses = ownerState => {
|
|
|
69
69
|
};
|
|
70
70
|
return (0, _composeClasses.default)(slots, _inputBaseClasses.getInputBaseUtilityClass, classes);
|
|
71
71
|
};
|
|
72
|
-
const InputBaseRoot = exports.InputBaseRoot = (0,
|
|
72
|
+
const InputBaseRoot = exports.InputBaseRoot = (0, _zeroStyled.styled)('div', {
|
|
73
73
|
name: 'MuiInputBase',
|
|
74
74
|
slot: 'Root',
|
|
75
75
|
overridesResolver: rootOverridesResolver
|
|
76
76
|
})(({
|
|
77
|
-
theme
|
|
78
|
-
ownerState
|
|
77
|
+
theme
|
|
79
78
|
}) => (0, _extends2.default)({}, theme.typography.body1, {
|
|
80
79
|
color: (theme.vars || theme).palette.text.primary,
|
|
81
80
|
lineHeight: '1.4375em',
|
|
@@ -89,21 +88,37 @@ const InputBaseRoot = exports.InputBaseRoot = (0, _styled.default)('div', {
|
|
|
89
88
|
[`&.${_inputBaseClasses.default.disabled}`]: {
|
|
90
89
|
color: (theme.vars || theme).palette.text.disabled,
|
|
91
90
|
cursor: 'default'
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
},
|
|
92
|
+
variants: [{
|
|
93
|
+
props: ({
|
|
94
|
+
ownerState
|
|
95
|
+
}) => ownerState.multiline,
|
|
96
|
+
style: {
|
|
97
|
+
padding: '4px 0 5px'
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
props: ({
|
|
101
|
+
ownerState,
|
|
102
|
+
size
|
|
103
|
+
}) => ownerState.multiline && size === 'small',
|
|
104
|
+
style: {
|
|
105
|
+
paddingTop: 1
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
props: ({
|
|
109
|
+
ownerState
|
|
110
|
+
}) => ownerState.fullWidth,
|
|
111
|
+
style: {
|
|
112
|
+
width: '100%'
|
|
113
|
+
}
|
|
114
|
+
}]
|
|
99
115
|
}));
|
|
100
|
-
const
|
|
116
|
+
const InputBaseInput = exports.InputBaseInput = (0, _zeroStyled.styled)('input', {
|
|
101
117
|
name: 'MuiInputBase',
|
|
102
118
|
slot: 'Input',
|
|
103
119
|
overridesResolver: inputOverridesResolver
|
|
104
120
|
})(({
|
|
105
|
-
theme
|
|
106
|
-
ownerState
|
|
121
|
+
theme
|
|
107
122
|
}) => {
|
|
108
123
|
const light = theme.palette.mode === 'light';
|
|
109
124
|
const placeholder = (0, _extends2.default)({
|
|
@@ -125,7 +140,7 @@ const InputBaseComponent = exports.InputBaseComponent = (0, _styled.default)('in
|
|
|
125
140
|
} : {
|
|
126
141
|
opacity: light ? 0.42 : 0.5
|
|
127
142
|
};
|
|
128
|
-
return
|
|
143
|
+
return {
|
|
129
144
|
font: 'inherit',
|
|
130
145
|
letterSpacing: 'inherit',
|
|
131
146
|
color: 'currentColor',
|
|
@@ -187,18 +202,33 @@ const InputBaseComponent = exports.InputBaseComponent = (0, _styled.default)('in
|
|
|
187
202
|
'&:-webkit-autofill': {
|
|
188
203
|
animationDuration: '5000s',
|
|
189
204
|
animationName: 'mui-auto-fill'
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
205
|
+
},
|
|
206
|
+
variants: [{
|
|
207
|
+
props: {
|
|
208
|
+
size: 'small'
|
|
209
|
+
},
|
|
210
|
+
style: {
|
|
211
|
+
paddingTop: 1
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
props: ({
|
|
215
|
+
ownerState
|
|
216
|
+
}) => ownerState.multiline,
|
|
217
|
+
style: {
|
|
218
|
+
height: 'auto',
|
|
219
|
+
resize: 'none',
|
|
220
|
+
padding: 0,
|
|
221
|
+
paddingTop: 0
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
props: {
|
|
225
|
+
type: 'search'
|
|
226
|
+
},
|
|
227
|
+
style: {
|
|
228
|
+
MozAppearance: 'textfield' // Improve type search style.
|
|
229
|
+
}
|
|
230
|
+
}]
|
|
231
|
+
};
|
|
202
232
|
});
|
|
203
233
|
const inputGlobalStyles = /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyles.default, {
|
|
204
234
|
styles: {
|
|
@@ -222,7 +252,7 @@ const inputGlobalStyles = /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyles.defaul
|
|
|
222
252
|
*/
|
|
223
253
|
const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
|
|
224
254
|
var _slotProps$input;
|
|
225
|
-
const props = (
|
|
255
|
+
const props = useThemeProps({
|
|
226
256
|
props: inProps,
|
|
227
257
|
name: 'MuiInputBase'
|
|
228
258
|
});
|
|
@@ -439,7 +469,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
439
469
|
const classes = useUtilityClasses(ownerState);
|
|
440
470
|
const Root = slots.root || components.Root || InputBaseRoot;
|
|
441
471
|
const rootProps = slotProps.root || componentsProps.root || {};
|
|
442
|
-
const Input = slots.input || components.Input ||
|
|
472
|
+
const Input = slots.input || components.Input || InputBaseInput;
|
|
443
473
|
inputProps = (0, _extends2.default)({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
|
|
444
474
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
445
475
|
children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/(0, _jsxRuntime.jsxs)(Root, (0, _extends2.default)({}, rootProps, !(0, _utils.isHostComponent)(Root) && {
|
|
@@ -15,14 +15,15 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
15
15
|
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
16
16
|
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
17
17
|
var _FormLabel = _interopRequireWildcard(require("../FormLabel"));
|
|
18
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
19
18
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
20
|
-
var
|
|
19
|
+
var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShouldForwardProp"));
|
|
20
|
+
var _zeroStyled = require("../zero-styled");
|
|
21
21
|
var _inputLabelClasses = require("./inputLabelClasses");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const _excluded = ["disableAnimation", "margin", "shrink", "variant", "className"];
|
|
24
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
25
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiInputLabel');
|
|
26
27
|
const useUtilityClasses = ownerState => {
|
|
27
28
|
const {
|
|
28
29
|
classes,
|
|
@@ -40,8 +41,8 @@ const useUtilityClasses = ownerState => {
|
|
|
40
41
|
const composedClasses = (0, _composeClasses.default)(slots, _inputLabelClasses.getInputLabelUtilityClasses, classes);
|
|
41
42
|
return (0, _extends2.default)({}, classes, composedClasses);
|
|
42
43
|
};
|
|
43
|
-
const InputLabelRoot = (0,
|
|
44
|
-
shouldForwardProp: prop => (0,
|
|
44
|
+
const InputLabelRoot = (0, _zeroStyled.styled)(_FormLabel.default, {
|
|
45
|
+
shouldForwardProp: prop => (0, _rootShouldForwardProp.default)(prop) || prop === 'classes',
|
|
45
46
|
name: 'MuiInputLabel',
|
|
46
47
|
slot: 'Root',
|
|
47
48
|
overridesResolver: (props, styles) => {
|
|
@@ -53,69 +54,130 @@ const InputLabelRoot = (0, _styled.default)(_FormLabel.default, {
|
|
|
53
54
|
}, 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]];
|
|
54
55
|
}
|
|
55
56
|
})(({
|
|
56
|
-
theme
|
|
57
|
-
|
|
58
|
-
}) => (0, _extends2.default)({
|
|
57
|
+
theme
|
|
58
|
+
}) => ({
|
|
59
59
|
display: 'block',
|
|
60
60
|
transformOrigin: 'top left',
|
|
61
61
|
whiteSpace: 'nowrap',
|
|
62
62
|
overflow: 'hidden',
|
|
63
63
|
textOverflow: 'ellipsis',
|
|
64
|
-
maxWidth: '100%'
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
64
|
+
maxWidth: '100%',
|
|
65
|
+
variants: [{
|
|
66
|
+
props: ({
|
|
67
|
+
ownerState
|
|
68
|
+
}) => ownerState.formControl,
|
|
69
|
+
style: {
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
left: 0,
|
|
72
|
+
top: 0,
|
|
73
|
+
// slight alteration to spec spacing to match visual spec result
|
|
74
|
+
transform: 'translate(0, 20px) scale(1)'
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
props: {
|
|
78
|
+
size: 'small'
|
|
79
|
+
},
|
|
80
|
+
style: {
|
|
81
|
+
// Compensation for the `Input.inputSizeSmall` style.
|
|
82
|
+
transform: 'translate(0, 17px) scale(1)'
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
props: ({
|
|
86
|
+
ownerState
|
|
87
|
+
}) => ownerState.shrink,
|
|
88
|
+
style: {
|
|
89
|
+
transform: 'translate(0, -1.5px) scale(0.75)',
|
|
90
|
+
transformOrigin: 'top left',
|
|
91
|
+
maxWidth: '133%'
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
props: ({
|
|
95
|
+
ownerState
|
|
96
|
+
}) => !ownerState.disableAnimation,
|
|
97
|
+
style: {
|
|
98
|
+
transition: theme.transitions.create(['color', 'transform', 'max-width'], {
|
|
99
|
+
duration: theme.transitions.duration.shorter,
|
|
100
|
+
easing: theme.transitions.easing.easeOut
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
props: {
|
|
105
|
+
variant: 'filled'
|
|
106
|
+
},
|
|
107
|
+
style: {
|
|
108
|
+
// Chrome's autofill feature gives the input field a yellow background.
|
|
109
|
+
// Since the input field is behind the label in the HTML tree,
|
|
110
|
+
// the input field is drawn last and hides the label with an opaque background color.
|
|
111
|
+
// zIndex: 1 will raise the label above opaque background-colors of input.
|
|
112
|
+
zIndex: 1,
|
|
113
|
+
pointerEvents: 'none',
|
|
114
|
+
transform: 'translate(12px, 16px) scale(1)',
|
|
115
|
+
maxWidth: 'calc(100% - 24px)'
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
props: {
|
|
119
|
+
variant: 'filled',
|
|
120
|
+
size: 'small'
|
|
121
|
+
},
|
|
122
|
+
style: {
|
|
123
|
+
transform: 'translate(12px, 13px) scale(1)'
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
props: ({
|
|
127
|
+
variant,
|
|
128
|
+
ownerState
|
|
129
|
+
}) => variant === 'filled' && ownerState.shrink,
|
|
130
|
+
style: {
|
|
131
|
+
userSelect: 'none',
|
|
132
|
+
pointerEvents: 'auto',
|
|
133
|
+
transform: 'translate(12px, 7px) scale(0.75)',
|
|
134
|
+
maxWidth: 'calc(133% - 24px)'
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
props: ({
|
|
138
|
+
variant,
|
|
139
|
+
ownerState,
|
|
140
|
+
size
|
|
141
|
+
}) => variant === 'filled' && ownerState.shrink && size === 'small',
|
|
142
|
+
style: {
|
|
143
|
+
transform: 'translate(12px, 4px) scale(0.75)'
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
props: {
|
|
147
|
+
variant: 'outlined'
|
|
148
|
+
},
|
|
149
|
+
style: {
|
|
150
|
+
// see comment above on filled.zIndex
|
|
151
|
+
zIndex: 1,
|
|
152
|
+
pointerEvents: 'none',
|
|
153
|
+
transform: 'translate(14px, 16px) scale(1)',
|
|
154
|
+
maxWidth: 'calc(100% - 24px)'
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
props: {
|
|
158
|
+
variant: 'outlined',
|
|
159
|
+
size: 'small'
|
|
160
|
+
},
|
|
161
|
+
style: {
|
|
162
|
+
transform: 'translate(14px, 9px) scale(1)'
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
props: ({
|
|
166
|
+
variant,
|
|
167
|
+
ownerState
|
|
168
|
+
}) => variant === 'outlined' && ownerState.shrink,
|
|
169
|
+
style: {
|
|
170
|
+
userSelect: 'none',
|
|
171
|
+
pointerEvents: 'auto',
|
|
172
|
+
// Theoretically, we should have (8+5)*2/0.75 = 34px
|
|
173
|
+
// but it feels a better when it bleeds a bit on the left, so 32px.
|
|
174
|
+
maxWidth: 'calc(133% - 32px)',
|
|
175
|
+
transform: 'translate(14px, -9px) scale(0.75)'
|
|
176
|
+
}
|
|
177
|
+
}]
|
|
178
|
+
}));
|
|
117
179
|
const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
|
|
118
|
-
const props = (
|
|
180
|
+
const props = useThemeProps({
|
|
119
181
|
name: 'MuiInputLabel',
|
|
120
182
|
props: inProps
|
|
121
183
|
});
|
package/node/Link/Link.js
CHANGED
|
@@ -6,25 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
|
+
var _colorManipulator = require("@mui/system/colorManipulator");
|
|
14
15
|
var _elementTypeAcceptingRef = _interopRequireDefault(require("@mui/utils/elementTypeAcceptingRef"));
|
|
15
16
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
17
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
17
|
-
var
|
|
18
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
18
|
+
var _zeroStyled = require("../zero-styled");
|
|
19
19
|
var _useIsFocusVisible = _interopRequireDefault(require("../utils/useIsFocusVisible"));
|
|
20
20
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
21
21
|
var _Typography = _interopRequireDefault(require("../Typography"));
|
|
22
22
|
var _linkClasses = _interopRequireWildcard(require("./linkClasses"));
|
|
23
23
|
var _getTextDecoration = _interopRequireWildcard(require("./getTextDecoration"));
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const _excluded = ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant", "sx"];
|
|
26
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
27
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiLink');
|
|
28
30
|
const useUtilityClasses = ownerState => {
|
|
29
31
|
const {
|
|
30
32
|
classes,
|
|
@@ -37,7 +39,7 @@ const useUtilityClasses = ownerState => {
|
|
|
37
39
|
};
|
|
38
40
|
return (0, _composeClasses.default)(slots, _linkClasses.getLinkUtilityClass, classes);
|
|
39
41
|
};
|
|
40
|
-
const LinkRoot = (0,
|
|
42
|
+
const LinkRoot = (0, _zeroStyled.styled)(_Typography.default, {
|
|
41
43
|
name: 'MuiLink',
|
|
42
44
|
slot: 'Root',
|
|
43
45
|
overridesResolver: (props, styles) => {
|
|
@@ -47,60 +49,92 @@ const LinkRoot = (0, _styled.default)(_Typography.default, {
|
|
|
47
49
|
return [styles.root, styles[`underline${(0, _capitalize.default)(ownerState.underline)}`], ownerState.component === 'button' && styles.button];
|
|
48
50
|
}
|
|
49
51
|
})(({
|
|
50
|
-
theme
|
|
51
|
-
ownerState
|
|
52
|
+
theme
|
|
52
53
|
}) => {
|
|
53
|
-
return
|
|
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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
54
|
+
return {
|
|
55
|
+
variants: [{
|
|
56
|
+
props: {
|
|
57
|
+
underline: 'none'
|
|
58
|
+
},
|
|
59
|
+
style: {
|
|
60
|
+
textDecoration: 'none'
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
props: {
|
|
64
|
+
underline: 'hover'
|
|
65
|
+
},
|
|
66
|
+
style: {
|
|
67
|
+
textDecoration: 'none',
|
|
68
|
+
'&:hover': {
|
|
69
|
+
textDecoration: 'underline'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
props: {
|
|
74
|
+
underline: 'always'
|
|
75
|
+
},
|
|
76
|
+
style: {
|
|
77
|
+
textDecoration: 'underline',
|
|
78
|
+
'&:hover': {
|
|
79
|
+
textDecorationColor: 'inherit'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
props: ({
|
|
84
|
+
underline,
|
|
85
|
+
ownerState
|
|
86
|
+
}) => underline === 'always' && ownerState.color !== 'inherit',
|
|
87
|
+
style: {
|
|
88
|
+
textDecorationColor: 'var(--Link-underlineColor)'
|
|
89
|
+
}
|
|
90
|
+
}, ...Object.entries(theme.palette).filter(([, value]) => value.main).map(([color]) => ({
|
|
91
|
+
props: {
|
|
92
|
+
underline: 'always',
|
|
93
|
+
color
|
|
94
|
+
},
|
|
95
|
+
style: {
|
|
96
|
+
'--Link-underlineColor': theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.4)` : (0, _colorManipulator.alpha)(theme.palette[color].main, 0.4)
|
|
97
|
+
}
|
|
98
|
+
})), {
|
|
99
|
+
props: {
|
|
100
|
+
component: 'button'
|
|
101
|
+
},
|
|
102
|
+
style: {
|
|
103
|
+
position: 'relative',
|
|
104
|
+
WebkitTapHighlightColor: 'transparent',
|
|
105
|
+
backgroundColor: 'transparent',
|
|
106
|
+
// Reset default value
|
|
107
|
+
// We disable the focus ring for mouse, touch and keyboard users.
|
|
108
|
+
outline: 0,
|
|
109
|
+
border: 0,
|
|
110
|
+
margin: 0,
|
|
111
|
+
// Remove the margin in Safari
|
|
112
|
+
borderRadius: 0,
|
|
113
|
+
padding: 0,
|
|
114
|
+
// Remove the padding in Firefox
|
|
115
|
+
cursor: 'pointer',
|
|
116
|
+
userSelect: 'none',
|
|
117
|
+
verticalAlign: 'middle',
|
|
118
|
+
MozAppearance: 'none',
|
|
119
|
+
// Reset
|
|
120
|
+
WebkitAppearance: 'none',
|
|
121
|
+
// Reset
|
|
122
|
+
'&::-moz-focus-inner': {
|
|
123
|
+
borderStyle: 'none' // Remove Firefox dotted outline.
|
|
124
|
+
},
|
|
125
|
+
[`&.${_linkClasses.default.focusVisible}`]: {
|
|
126
|
+
outline: 'auto'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}]
|
|
130
|
+
};
|
|
98
131
|
});
|
|
99
132
|
const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
100
|
-
const props = (
|
|
133
|
+
const props = useThemeProps({
|
|
101
134
|
props: inProps,
|
|
102
135
|
name: 'MuiLink'
|
|
103
136
|
});
|
|
137
|
+
const theme = (0, _useTheme.default)();
|
|
104
138
|
const {
|
|
105
139
|
className,
|
|
106
140
|
color = 'primary',
|
|
@@ -156,11 +190,18 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
|
156
190
|
onFocus: handleFocus,
|
|
157
191
|
ref: handlerRef,
|
|
158
192
|
ownerState: ownerState,
|
|
159
|
-
variant: variant
|
|
160
|
-
|
|
193
|
+
variant: variant
|
|
194
|
+
}, other, {
|
|
195
|
+
sx: [...(_getTextDecoration.colorTransformations[color] === undefined ? [{
|
|
161
196
|
color
|
|
162
|
-
}] : []), ...(Array.isArray(sx) ? sx : [sx])]
|
|
163
|
-
|
|
197
|
+
}] : []), ...(Array.isArray(sx) ? sx : [sx])],
|
|
198
|
+
style: (0, _extends2.default)({}, other.style, underline === 'always' && color !== 'inherit' && {
|
|
199
|
+
'--Link-underlineColor': (0, _getTextDecoration.default)({
|
|
200
|
+
theme,
|
|
201
|
+
ownerState
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
}));
|
|
164
205
|
});
|
|
165
206
|
process.env.NODE_ENV !== "production" ? Link.propTypes /* remove-proptypes */ = {
|
|
166
207
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -197,6 +238,10 @@ process.env.NODE_ENV !== "production" ? Link.propTypes /* remove-proptypes */ =
|
|
|
197
238
|
* @ignore
|
|
198
239
|
*/
|
|
199
240
|
onFocus: _propTypes.default.func,
|
|
241
|
+
/**
|
|
242
|
+
* @ignore
|
|
243
|
+
*/
|
|
244
|
+
style: _propTypes.default.object,
|
|
200
245
|
/**
|
|
201
246
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
202
247
|
*/
|
|
@@ -4,25 +4,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.colorTransformations = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _style = require("@mui/system/style");
|
|
8
8
|
var _colorManipulator = require("@mui/system/colorManipulator");
|
|
9
|
+
// TODO v7: remove this transformation
|
|
9
10
|
const colorTransformations = exports.colorTransformations = {
|
|
10
|
-
primary: 'primary.main',
|
|
11
11
|
textPrimary: 'text.primary',
|
|
12
|
-
secondary: 'secondary.main',
|
|
13
12
|
textSecondary: 'text.secondary',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
// For main palette, the color will be applied by the styles above.
|
|
14
|
+
primary: null,
|
|
15
|
+
secondary: null,
|
|
16
|
+
error: null,
|
|
17
|
+
info: null,
|
|
18
|
+
success: null,
|
|
19
|
+
warning: null
|
|
18
20
|
};
|
|
19
21
|
const getTextDecoration = ({
|
|
20
22
|
theme,
|
|
21
23
|
ownerState
|
|
22
24
|
}) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
let transformedColor = colorTransformations[ownerState.color];
|
|
26
|
+
if (transformedColor === null) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (transformedColor === undefined) {
|
|
30
|
+
transformedColor = ownerState.color;
|
|
31
|
+
}
|
|
32
|
+
const color = (0, _style.getPath)(theme, `palette.${transformedColor}`, false) || ownerState.color;
|
|
33
|
+
const channelColor = (0, _style.getPath)(theme, `palette.${transformedColor}Channel`);
|
|
26
34
|
if ('vars' in theme && channelColor) {
|
|
27
35
|
return `rgba(${channelColor} / 0.4)`;
|
|
28
36
|
}
|