UNPKG

@wix/design-system

Version:

@wix/design-system

26 lines 1.64 kB
import React from 'react'; import PropTypes from 'prop-types'; import Heading from '../../../Heading'; import Text from '../../../Text'; import Divider from '../../../Divider'; import { st, classes } from './Section.st.css.js'; import { dataHooks } from './constants'; import { WixDesignSystemContext } from '../../../WixDesignSystemProvider/context'; const Section = ({ dataHook, showDivider, title, subtitle, actionsBar, className, }) => (React.createElement(WixDesignSystemContext.Consumer, null, ({ newColorsBranding }) => (React.createElement("div", { className: st(classes.root, { showDivider }, className), "data-hook": dataHook }, React.createElement("div", { className: classes.content }, React.createElement("div", { className: classes.titleColumn }, title && (React.createElement(Heading, { size: newColorsBranding ? 'small' : 'large', as: "h2", dataHook: dataHooks.pageSectionTitle, ellipsis: true }, title)), subtitle && (React.createElement(Text, { secondary: true, weight: "thin", ellipsis: true, dataHook: dataHooks.pageSectionSubtitle }, subtitle))), actionsBar && (React.createElement("div", { className: classes.actionsBar, "data-hook": dataHooks.pageSectionActionsBar }, actionsBar))), showDivider && React.createElement(Divider, { className: classes.divider }))))); Section.displayName = 'Page.Section'; Section.propTypes = { dataHook: PropTypes.string, className: PropTypes.string, title: PropTypes.node, subtitle: PropTypes.node, actionsBar: PropTypes.node, showDivider: PropTypes.bool, }; export default Section; //# sourceMappingURL=Section.js.map