UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

73 lines (68 loc) 2.87 kB
import * as React from "react"; import styled, { css } from "styled-components"; import defaultTheme from "../../defaultTheme"; import mq from "../../utils/mediaQuery"; import IllustrationPrimitive from "."; const List = styled.div.withConfig({ displayName: "IllustrationPrimitiveList__List", componentId: "sc-1be75eu-0" })(["display:flex;flex-flow:row wrap;justify-content:space-between;border-radius:", ";"], ({ theme }) => theme.orbit.borderRadiusLarge); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 List.defaultProps = { theme: defaultTheme }; const Container = styled.div.withConfig({ displayName: "IllustrationPrimitiveList__Container", componentId: "sc-1be75eu-1" })(["display:flex;flex-direction:column;justify-content:flex-start;align-items:center;align-content:center;width:100%;min-height:80px;background-color:white;margin-bottom:", ";border-radius:", ";border:", " ", " ", ";padding:", ";", ";"], ({ theme }) => theme.orbit.spaceLarge, ({ theme }) => theme.orbit.borderRadiusLarge, ({ theme }) => theme.orbit.borderWidthCard, ({ theme }) => theme.orbit.borderStyleCard, ({ theme }) => theme.orbit.paletteCloudNormal, ({ theme }) => theme.orbit.spaceLarge, mq.largeMobile(css(["flex-direction:row;"]))); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 Container.defaultProps = { theme: defaultTheme }; const IllustrationJSX = styled.div.withConfig({ displayName: "IllustrationPrimitiveList__IllustrationJSX", componentId: "sc-1be75eu-2" })(["font-family:\"SFMono-Regular\",Consolas,\"Liberation Mono\",Menlo,Courier,monospace;font-size:12px;line-height:", ";color:", ";background-color:", ";border:", " ", " ", ";margin-top:", ";padding:", " ", ";", ";"], ({ theme }) => theme.orbit.lineHeightTextSmall, ({ theme }) => theme.orbit.paletteInkNormal, ({ theme }) => theme.orbit.paletteCloudLight, ({ theme }) => theme.orbit.borderWidthCard, ({ theme }) => theme.orbit.borderStyleCard, ({ theme }) => theme.orbit.paletteCloudNormal, ({ theme }) => theme.orbit.spaceMedium, ({ theme }) => theme.orbit.spaceXXSmall, ({ theme }) => theme.orbit.spaceXSmall, mq.largeMobile(css(["margin:0;"]))); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 IllustrationJSX.defaultProps = { theme: defaultTheme }; const IllustrationPrimitiveList = props => { return /*#__PURE__*/React.createElement(List, null, props.images.map(illustration => { return /*#__PURE__*/React.createElement(Container, { key: illustration }, /*#__PURE__*/React.createElement(IllustrationPrimitive, { name: illustration }), /*#__PURE__*/React.createElement(IllustrationJSX, null, `<${props.nameOfComponent} name="${illustration}" />`)); })); }; export default IllustrationPrimitiveList;