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.

80 lines (78 loc) 3.12 kB
import * as React from "react"; import styled, { css } from "styled-components"; import mq from "../utils/mediaQuery"; import defaultTheme from "../defaultTheme"; import Heading from "../Heading"; import Stack from "../Stack"; import Text from "../Text"; var StyledCallOutBanner = styled.div.withConfig({ displayName: "CallOutBanner__StyledCallOutBanner", componentId: "sc-1ml9ckq-0" })(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;background:", ";border-radius:", ";padding:", ";", ";", ";"], function (_ref) { var theme = _ref.theme; return theme.orbit.paletteWhite; }, function (_ref2) { var theme = _ref2.theme; return theme.orbit.borderRadiusSmall; }, function (_ref3) { var theme = _ref3.theme; return theme.orbit.spaceMedium; }, function (_ref4) { var onClick = _ref4.onClick; return onClick ? css(["box-shadow:", ";transition:box-shadow ", " ease-in-out;cursor:pointer;:focus,:active,:hover{box-shadow:", ";outline:none;}border:1px solid transparent;"], function (_ref5) { var theme = _ref5.theme; return theme.orbit.boxShadowAction; }, function (_ref6) { var theme = _ref6.theme; return theme.orbit.durationFast; }, function (_ref7) { var theme = _ref7.theme; return theme.orbit.boxShadowActionActive; }) : css(["border:1px solid ", ";"], function (_ref8) { var theme = _ref8.theme; return theme.orbit.paletteCloudNormal; }); }, mq.largeMobile(css(["flex-direction:row;padding:", ";"], function (_ref9) { var theme = _ref9.theme; return theme.orbit.spaceLarge; }))); StyledCallOutBanner.defaultProps = { theme: defaultTheme }; var StyledIllustration = styled.div.withConfig({ displayName: "CallOutBanner__StyledIllustration", componentId: "sc-1ml9ckq-1" })(["padding-bottom:", ";", ";"], function (_ref10) { var theme = _ref10.theme; return theme.orbit.spaceMedium; }, mq.largeMobile(css(["padding-right:", ";padding-bottom:0;"], function (_ref11) { var theme = _ref11.theme; return theme.orbit.spaceLarge; }))); StyledIllustration.defaultProps = { theme: defaultTheme }; var CallOutBanner = function CallOutBanner(_ref12) { var children = _ref12.children, illustration = _ref12.illustration, actions = _ref12.actions, title = _ref12.title, onClick = _ref12.onClick, tabIndex = _ref12.tabIndex, description = _ref12.description, dataTest = _ref12.dataTest; return /*#__PURE__*/React.createElement(StyledCallOutBanner, { onClick: onClick, tabIndex: (onClick || tabIndex) && (tabIndex || 0), "data-test": dataTest }, illustration && /*#__PURE__*/React.createElement(StyledIllustration, null, illustration), /*#__PURE__*/React.createElement(Stack, { spacing: "natural" }, /*#__PURE__*/React.createElement(Stack, { spacing: "condensed" }, /*#__PURE__*/React.createElement(Stack, { spacing: "tight" }, title && /*#__PURE__*/React.createElement(Heading, { type: "title3" }, title), description && /*#__PURE__*/React.createElement(Text, null, description)), children), actions)); }; export default CallOutBanner;