<filename>node_modules/@chakra-ui/layout/dist/cjs/divider.js
"use strict";

exports.__esModule = true;
exports.Divider = void 0;

var _system = require("@chakra-ui/system");

var _utils = require("@chakra-ui/utils");

var React = _interopRequireWildcard(require("react"));

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

/**
 * Layout component used to visually separate content in a list or group.
 * It display a thin horizontal or vertical line, and renders a `hr` tag.
 *
 * @see Docs https://chakra-ui.com/docs/data-display/divider
 */
var Divider = /*#__PURE__*/(0, _system.forwardRef)(function (props, ref) {
  var _useStyleConfig = (0, _system.useStyleConfig)("Divider", props),
      borderLeftWidth = _useStyleConfig.borderLeftWidth,
      borderBottomWidth = _useStyleConfig.borderBottomWidth,
      borderTopWidth = _useStyleConfig.borderTopWidth,
      borderRightWidth = _useStyleConfig.borderRightWidth,
      borderWidth = _useStyleConfig.borderWidth,
      borderStyle = _useStyleConfig.borderStyle,
      borderColor = _useStyleConfig.borderColor,
      styles = _objectWithoutPropertiesLoose(_useStyleConfig, ["borderLeftWidth", "borderBottomWidth", "borderTopWidth", "borderRightWidth", "borderWidth", "borderStyle", "borderColor"]);

  var _omitThemingProps = (0, _system.omitThemingProps)(props),
      className = _omitThemingProps.className,
      _omitThemingProps$ori = _omitThemingProps.orientation,
      orientation = _omitThemingProps$ori === void 0 ? "horizontal" : _omitThemingProps$ori,
      __css = _omitThemingProps.__css,
      rest = _objectWithoutPropertiesLoose(_omitThemingProps, ["className", "orientation", "__css"]);

  var dividerStyles = {
    vertical: {
      borderLeftWidth: borderLeftWidth || borderRightWidth || borderWidth || "1px",
      height: "100%"
    },
    horizontal: {
      borderBottomWidth: borderBottomWidth || borderTopWidth || borderWidth || "1px",
      width: "100%"
    }
  };
  return /*#__PURE__*/React.createElement(_system.chakra.hr, _extends({
    ref: ref,
    "aria-orientation": orientation
  }, rest, {
    __css: _extends({}, styles, {
      border: "0",
      borderColor: borderColor,
      borderStyle: borderStyle
    }, dividerStyles[orientation], __css),
    className: (0, _utils.cx)("chakra-divider", className)
  }));
});
exports.Divider = Divider;

if (_utils.__DEV__) {
  Divider.displayName = "Divider";
}
//# sourceMappingURL=divider.js.map