UNPKG

wix-style-react

Version:
34 lines 1.13 kB
import React from 'react'; import PropTypes from 'prop-types'; import { st, classes } from './Divider.st.css'; import { directions, skins } from './constants'; /** A component that separates content by a line horizontally or vertically */ class Divider extends React.PureComponent { render() { const { dataHook, className, direction, skin } = this.props; return (React.createElement("hr", { "data-hook": dataHook, className: st(classes.root, { direction, skin }, className) })); } } Divider.displayName = 'Divider'; Divider.propTypes = { /** Applies a data-hook HTML attribute that can be used in the tests. */ dataHook: PropTypes.string, /** Controls divider direction. */ direction: PropTypes.oneOf(['horizontal', 'vertical']), /** Sets the skin of the divider. */ skin: PropTypes.oneOf([ 'light', 'dark', 'standard', 'warning', 'destructive', 'success', 'premium', ]), }; Divider.defaultProps = { direction: directions.horizontal, skin: skins.light, }; export default Divider; //# sourceMappingURL=Divider.js.map