jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
31 lines (28 loc) • 1.17 kB
JavaScript
import { __rest } from '../../../../../node_modules/tslib/tslib.es6.js';
import { createElement } from 'react';
import styled from 'styled-components';
import { space } from '../../../../../node_modules/@styled-system/space/dist/index.esm.js';
import '../../../../../node_modules/styled-system/dist/index.esm.js';
/**
* @file index.tsx
*
* @fileoverview A component that defines spacing on top or bottom.
*/
const StyledSpace = styled.div `
${space}
`;
const spacesMap = {
small: 4,
medium: 6,
large: 8
};
/**
* The Spacing component can be used to wrap some content with either vertical or bottom spacing. or both. it will generate consistent amounts
* of spacing comming from what is defined in the theme. This ensures that when making space between elements we are defining a consistent look and feel.
*/
const Spacing = (_a) => {
var { size = 'small', mt = spacesMap[size], mb = spacesMap[size], children } = _a, props = __rest(_a, ["size", "mt", "mb", "children"]);
return createElement(StyledSpace, Object.assign({}, Object.assign({ size, mt, mb }, props)), children);
};
export default Spacing;
export { Spacing };