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.

89 lines (84 loc) 3.59 kB
import * as React from "react"; import styled, { css } from "styled-components"; import defaultTheme from "../../defaultTheme"; import mq from "../../utils/mediaQuery"; import IllustrationPrimitive from "."; var List = styled.div.withConfig({ displayName: "IllustrationPrimitiveList__List", componentId: "sc-1be75eu-0" })(["display:flex;flex-flow:row wrap;justify-content:space-between;border-radius:", ";"], function (_ref) { var theme = _ref.theme; return theme.orbit.borderRadiusLarge; }); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 List.defaultProps = { theme: defaultTheme }; var 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:", ";", ";"], function (_ref2) { var theme = _ref2.theme; return theme.orbit.spaceLarge; }, function (_ref3) { var theme = _ref3.theme; return theme.orbit.borderRadiusLarge; }, function (_ref4) { var theme = _ref4.theme; return theme.orbit.borderWidthCard; }, function (_ref5) { var theme = _ref5.theme; return theme.orbit.borderStyleCard; }, function (_ref6) { var theme = _ref6.theme; return theme.orbit.paletteCloudNormal; }, function (_ref7) { var theme = _ref7.theme; return 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 }; var 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:", " ", ";", ";"], function (_ref8) { var theme = _ref8.theme; return theme.orbit.lineHeightTextSmall; }, function (_ref9) { var theme = _ref9.theme; return theme.orbit.paletteInkNormal; }, function (_ref10) { var theme = _ref10.theme; return theme.orbit.paletteCloudLight; }, function (_ref11) { var theme = _ref11.theme; return theme.orbit.borderWidthCard; }, function (_ref12) { var theme = _ref12.theme; return theme.orbit.borderStyleCard; }, function (_ref13) { var theme = _ref13.theme; return theme.orbit.paletteCloudNormal; }, function (_ref14) { var theme = _ref14.theme; return theme.orbit.spaceMedium; }, function (_ref15) { var theme = _ref15.theme; return theme.orbit.spaceXXSmall; }, function (_ref16) { var theme = _ref16.theme; return theme.orbit.spaceXSmall; }, mq.largeMobile(css(["margin:0;"]))); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 IllustrationJSX.defaultProps = { theme: defaultTheme }; var IllustrationPrimitiveList = function IllustrationPrimitiveList(props) { return /*#__PURE__*/React.createElement(List, null, props.images.map(function (illustration) { return /*#__PURE__*/React.createElement(Container, { key: illustration }, /*#__PURE__*/React.createElement(IllustrationPrimitive, { name: illustration }), /*#__PURE__*/React.createElement(IllustrationJSX, null, "<".concat(props.nameOfComponent, " name=\"").concat(illustration, "\" />"))); })); }; export default IllustrationPrimitiveList;