UNPKG

@material-ui/lab

Version:

Material-UI Lab - Incubator for Material-UI React components.

37 lines (34 loc) 1.21 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import * as React from 'react'; import clsx from 'clsx'; import Typography from '@material-ui/core/Typography'; import { createStyles, withStyles, alpha } from '@material-ui/core/styles'; export const styles = theme => { const textColor = theme.palette.mode === 'light' ? theme.palette.primary.contrastText : theme.palette.getContrastText(theme.palette.background.default); return createStyles({ root: { transition: theme.transitions.create('color'), color: alpha(textColor, 0.54), '&$selected': { color: textColor } }, selected: {} }); }; const ToolbarText = props => { const { className, classes, selected, value } = props, other = _objectWithoutPropertiesLoose(props, ["className", "classes", "selected", "value"]); return /*#__PURE__*/React.createElement(Typography, _extends({ className: clsx(classes.root, className, selected && classes.selected) }, other), value); }; export default withStyles(styles, { name: 'MuiPickersToolbarText' })(ToolbarText);