import _extends from "@babel/runtime/helpers/builtin/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/builtin/objectWithoutProperties";
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import { fade } from '../styles/colorManipulator';
export const styles = theme => ({
  root: {
    height: 1,
    margin: 0,
    // Reset browser default style.
    border: 'none',
    flexShrink: 0,
    backgroundColor: theme.palette.divider
  },
  absolute: {
    position: 'absolute',
    bottom: 0,
    left: 0,
    width: '100%'
  },
  inset: {
    marginLeft: 72
  },
  light: {
    backgroundColor: fade(theme.palette.divider, 0.08)
  }
});

function Divider(props) {
  const {
    absolute,
    classes,
    className: classNameProp,
    component: Component,
    inset,
    light
  } = props,
        other = _objectWithoutProperties(props, ["absolute", "classes", "className", "component", "inset", "light"]);

  const className = classNames(classes.root, {
    [classes.absolute]: absolute,
    [classes.inset]: inset,
    [classes.light]: light
  }, classNameProp);
  return React.createElement(Component, _extends({
    className: className
  }, other));
}

Divider.propTypes = process.env.NODE_ENV !== "production" ? {
  absolute: PropTypes.bool,

  /**
   * Override or extend the styles applied to the component.
   * See [CSS API](#css-api) below for more details.
   */
  classes: PropTypes.object.isRequired,

  /**
   * @ignore
   */
  className: PropTypes.string,

  /**
   * The component used for the root node.
   * Either a string to use a DOM element or a component.
   */
  component: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]),

  /**
   * If `true`, the divider will be indented.
   */
  inset: PropTypes.bool,

  /**
   * If `true`, the divider will have a lighter color.
   */
  light: PropTypes.bool
} : {};
Divider.defaultProps = {
  absolute: false,
  component: 'hr',
  inset: false,
  light: false
};
export default withStyles(styles, {
  name: 'MuiDivider'
})(Divider);