UNPKG

@material-ui/core

Version:

React components that implement Google's Material Design.

52 lines (48 loc) 1.48 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; export var styles = function styles(theme) { return { /* Styles applied to the root element. */ root: { minWidth: 56, color: theme.palette.action.active, flexShrink: 0, display: 'inline-flex' } }; }; /** * A simple wrapper to apply `List` styles to an `Icon` or `SvgIcon`. */ var ListItemIcon = React.forwardRef(function ListItemIcon(props, ref) { var classes = props.classes, className = props.className, other = _objectWithoutProperties(props, ["classes", "className"]); return React.createElement("div", _extends({ className: clsx(classes.root, className), ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? ListItemIcon.propTypes = { /** * The content of the component, normally `Icon`, `SvgIcon`, * or a `@material-ui/icons` SVG icon element. */ children: PropTypes.element.isRequired, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string } : void 0; export default withStyles(styles, { name: 'MuiListItemIcon' })(ListItemIcon);