UNPKG

@material-ui/lab

Version:

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

35 lines (32 loc) 1.27 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; 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 var styles = function styles(theme) { var 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: {} }); }; var ToolbarText = function ToolbarText(props) { var className = props.className, classes = props.classes, selected = props.selected, value = props.value, other = _objectWithoutProperties(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);