import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "position", "dashed"];
import React from "react";
import PropTypes from "prop-types";
import cx from "classnames";
import createComponent from "../system/createComponent";
import getClasses from "./styles";
var Divider = /*#__PURE__*/React.forwardRef(function (props, ref) {
  var _styles;

  var classes = getClasses(props);

  var className = props.className,
      position = props.position,
      dashed = props.dashed,
      restProps = _objectWithoutProperties(props, _excluded);

  var styles = (_styles = {}, _defineProperty(_styles, classes.reset, true), _defineProperty(_styles, classes.horizontal, position === "horizontal"), _defineProperty(_styles, classes.vertical, position === "vertical"), _defineProperty(_styles, classes.dashed, dashed), _styles);
  return /*#__PURE__*/React.createElement("hr", _extends({
    ref: ref,
    className: cx(styles, className)
  }, restProps));
});
Divider.propTypes = {
  className: PropTypes.string,
  position: PropTypes.oneOf(["horizontal", "vertical"]),
  dashed: PropTypes.bool
};
Divider.defaultProps = {
  position: "horizontal",
  dashed: false
};

if (process.env.NODE_ENV !== "production") {
  Divider.displayName = "Divider";
}

export default createComponent(Divider);