@ntragas/pouncejstest
Version:
A collection of UI components from Panther labs
38 lines (35 loc) • 1.19 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import React from 'react';
import Box from '../Box';
/**
* Extends Box.
*
* A Divider is a simple component that will render a line to separate content into two sections
*/
var Divider = function Divider(_ref) {
var _ref$orientation = _ref.orientation,
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation,
color = _ref.color,
backgroundColor = _ref.backgroundColor,
borderColor = _ref.borderColor,
rest = _objectWithoutPropertiesLoose(_ref, ["orientation", "color", "backgroundColor", "borderColor"]);
var borderProps = orientation === 'vertical' ? {
borderLeft: '0.0625rem solid',
height: 'auto',
mx: 2
} : {
borderBottom: '0.0625rem solid',
width: 'auto',
my: 2
};
return /*#__PURE__*/React.createElement(Box, _extends({
as: "hr",
"aria-orientation": orientation,
border: "none",
opacity: 0.6
}, borderProps, {
borderColor: color || backgroundColor || borderColor || 'inherit'
}, rest));
};
export default Divider;