jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
40 lines (34 loc) • 1.56 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var tslib_es6 = require('../../../../node_modules/tslib/tslib.es6.js');
var React = require('react');
var React__default = _interopDefault(React);
var styled = require('styled-components');
var styled__default = _interopDefault(styled);
var styles = require('./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 = styled.withTheme((_a) => {
var { children, label, marginClean = false, paddingClean = false, theme, p, mt } = _a, props = tslib_es6.__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 (React.createElement(styles.Box, Object.assign({ "data-testid": "box", p: p, mt: mt, paddingClean: paddingClean, marginClean: marginClean }, props),
label && React.createElement(styles.BoxTitle, null, label),
children));
});
exports.Box = Box;
exports.default = Box;