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)

82 lines (74 loc) 2.02 kB
import React__default from 'react'; import styled from 'styled-components'; import FlexItem from '../../../02-atoms/06-layout/03-flex/02-flex-item/index.js'; /** * @file index.tsx * * @fileoverview Shows form elements inline. */ const ChildFlexItem = styled(FlexItem) ` position: relative; z-index: 10; & > div { margin-bottom: 0; label { margin: 0; } } /* Custom style for selects */ div[role='combobox'] { width: 100%; max-width: none !important; } ${props => props.theme.mediaQueries.smallRevert} { margin-left: 0; margin-right: 0; } ${props => props.theme.mediaQueries.small} { input, input[type='text'] { width: 100%; border-right-width: ${props => `calc(${props.theme.input.borderWidth} / 2)`}; border-top-right-radius: 0; border-bottom-right-radius: 0; } &:not(:first-child) { input, input[type='text'] { border-left-width: ${props => `calc(${props.theme.input.borderWidth} / 2)`}; border-top-left-radius: 0; border-bottom-left-radius: 0; } } } `; const StyledFlexItemsWrapper = styled.div ` ${props => props.theme.mediaQueries.smallRevert} { button { width: 100%; margin-top: ${props => props.theme.space[4]}; } } ${props => props.theme.mediaQueries.small} { button { border-top-left-radius: 0; border-bottom-left-radius: 0; } } `; const StyledFlexItems = styled.div ` display: block; ${props => props.theme.mediaQueries.small} { display: flex; align-items: center; } `; const FormItemsInline = ({ inputs, button }) => { return (React__default.createElement(StyledFlexItemsWrapper, null, React__default.createElement(StyledFlexItems, null, inputs.map((input, index) => { return (inputs && (React__default.createElement(ChildFlexItem, { key: index, m: [3, 0] }, input))); }), button))); }; export { FormItemsInline };