@mui/codemod
Version:
Codemod scripts for Material UI.
37 lines (36 loc) • 1.55 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DigitalClockItem = void 0;
var _colorManipulator = require("@mui/system/colorManipulator");
const DigitalClockItem = exports.DigitalClockItem = styled(MenuItem, {
name: 'MuiDigitalClock',
slot: 'Item',
shouldForwardProp: prop => prop !== 'itemValue' && prop !== 'formattedValue',
overridesResolver: (props, styles) => styles.item
})(({
theme
}) => ({
padding: '8px 16px',
margin: '2px 4px',
'&:first-of-type': {
marginTop: 4
},
'&:hover': {
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.hoverOpacity)
},
'&.Mui-selected': {
backgroundColor: (theme.vars || theme).palette.primary.main,
color: (theme.vars || theme).palette.primary.contrastText,
'&:focus-visible, &:hover': {
backgroundColor: (theme.vars || theme).palette.primary.dark
}
},
'&.Mui-focusVisible': {
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.focusOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.focusOpacity)
}
}));
function transform(t) {
const backgroundBackdrop = t.vars ? `rgba(${t.vars.palette.background.defaultChannel} / ${t.vars.palette.action.disabledOpacity})` : (0, _colorManipulator.alpha)(t.palette.background.default, t.palette.action.disabledOpacity);
}
;