jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
33 lines (30 loc) • 1.25 kB
JavaScript
import { __rest } from '../../../../../../node_modules/tslib/tslib.es6.js';
import React__default 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 Renders a single flex item.
*/
/**
* Will align content provide in the children property centerally.
* Use this component when you want to align something centerally.
*/
const StyledFlexItem = styled.div `
align-self: ${props => props.alignSelf};
justify-self: ${props => props.justifySelf};
${props => (props.flex ? `flex: ${props.flex};` : ``)}
${space}
`;
/**
* Display multiple items in a flex structure. Useful for laying single dimensionally
* a set of items together.
*/
const FlexItem = (_a) => {
var { alignSelf = 'auto', justifySelf = 'auto', flex, children } = _a, props = __rest(_a, ["alignSelf", "justifySelf", "flex", "children"]);
return (React__default.createElement(StyledFlexItem, Object.assign({ alignSelf: alignSelf, justifySelf: justifySelf, flex: flex }, props), children));
};
export default FlexItem;
export { FlexItem };