UNPKG

@randy.tarampi/jsx

Version:

Some common JSX components for www.randytarampi.ca

77 lines 2.54 kB
import PropTypes from "prop-types"; import React from "react"; import { Col, Row } from "react-materialize"; import SectionWrapper from "./sectionWrapper"; export var RightDescriptionSection = (_ref) => { var { printableType, type, label, labelNode, description, descriptionNode, hideOnPrint, showOnLetter, showOnA4, showOnLegal, hideOnScreen, verticallyAlignContent, className, children } = _ref; var sectionClassNames = ["printable-section--description", "printable-section--description-right"]; return /*#__PURE__*/React.createElement(SectionWrapper, { printableType, type, hideOnPrint, showOnLetter, showOnA4, showOnLegal, hideOnScreen, verticallyAlignContent, className: sectionClassNames.concat(className).join(" ").trim() }, /*#__PURE__*/React.createElement(Col, { m: 9, className: "printable-section__content" }, children), /*#__PURE__*/React.createElement("aside", { className: "col m3 printable-section__header hide-on-small-only" }, labelNode ? labelNode : label ? /*#__PURE__*/React.createElement("h3", { className: "printable-section__label" }, /*#__PURE__*/React.createElement("span", { className: "text" }, label)) : null, descriptionNode || description ? /*#__PURE__*/React.createElement(Row, { className: "hide-on-small-only" }, /*#__PURE__*/React.createElement(Col, { s: 9 }, descriptionNode ? /*#__PURE__*/React.createElement("div", { className: "printable-section__description" }, descriptionNode) : /*#__PURE__*/React.createElement("p", { className: "printable-section__description" }, /*#__PURE__*/React.createElement("span", { className: "text" }, description)))) : null)); }; RightDescriptionSection.propTypes = { className: PropTypes.string, label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), labelNode: PropTypes.node, description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), descriptionNode: PropTypes.node, printableType: PropTypes.string.isRequired, type: PropTypes.string.isRequired, hideOnPrint: PropTypes.bool, hideOnScreen: PropTypes.bool, showOnA4: PropTypes.bool, showOnLegal: PropTypes.bool, showOnLetter: PropTypes.bool, verticallyAlignContent: PropTypes.bool }; RightDescriptionSection.defaultProps = { hideOnPrint: false, hideOnScreen: false, showOnA4: false, showOnLegal: false, showOnLetter: false, verticallyAlignContent: false }; export default RightDescriptionSection;