UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

32 lines (29 loc) 1.25 kB
import { __rest } from '../../../../node_modules/tslib/tslib.es6.js'; import { createElement } from 'react'; import { withTheme } from 'styled-components'; import { Box as Box$1, BoxTitle } from './styles.js'; /** * @file index.tsx * * @fileoverview Generates a box element. A div with some box styling properties * that come from the theme. */ /** * This component renders a box with some content inside. It has specific styling passed vai the theme object. It can be used in a * variety of situations but always should be used agains the background so that it contrasts with the background color. */ const Box = withTheme((_a) => { var { children, label, marginClean = false, paddingClean = false, theme, p, mt } = _a, props = __rest(_a, ["children", "label", "marginClean", "paddingClean", "theme", "p", "mt"]); // Get some default values from theme. if (!p) { p = theme.box.p; } if (!mt) { mt = theme.box.mt; } return (createElement(Box$1, Object.assign({ "data-testid": "box", p: p, mt: mt, paddingClean: paddingClean, marginClean: marginClean }, props), label && createElement(BoxTitle, null, label), children)); }); export default Box; export { Box };