@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.
70 lines (66 loc) • 2.59 kB
JavaScript
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";
const StyledCallOutBanner = styled.div.withConfig({
displayName: "CallOutBanner__StyledCallOutBanner",
componentId: "sc-s1x3on-0"
})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;background:", ";border-radius:", ";padding:", ";", ";", ";"], ({
theme
}) => theme.orbit.paletteWhite, ({
theme
}) => theme.orbit.borderRadiusSmall, ({
theme
}) => theme.orbit.spaceMedium, ({
onClick
}) => onClick ? css(["box-shadow:", ";transition:box-shadow ", " ease-in-out;cursor:pointer;:focus,:active,:hover{box-shadow:", ";outline:none;}border:1px solid transparent;"], ({
theme
}) => theme.orbit.boxShadowAction, ({
theme
}) => theme.orbit.durationFast, ({
theme
}) => theme.orbit.boxShadowActionActive) : css(["border:1px solid ", ";"], ({
theme
}) => theme.orbit.paletteCloudNormal), mq.largeMobile(css(["flex-direction:row;padding:", ";"], ({
theme
}) => theme.orbit.spaceLarge))); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198
StyledCallOutBanner.defaultProps = {
theme: defaultTheme
};
const StyledIllustration = styled.div.withConfig({
displayName: "CallOutBanner__StyledIllustration",
componentId: "sc-s1x3on-1"
})(["padding-bottom:", ";", ";"], ({
theme
}) => theme.orbit.spaceMedium, mq.largeMobile(css(["padding-right:", ";padding-bottom:0;"], ({
theme
}) => theme.orbit.spaceLarge))); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198
StyledIllustration.defaultProps = {
theme: defaultTheme
};
const CallOutBanner = ({
children,
illustration,
actions,
title,
onClick,
tabIndex,
description,
dataTest
}) => /*#__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: "medium"
}, /*#__PURE__*/React.createElement(Stack, {
spacing: "XSmall"
}, /*#__PURE__*/React.createElement(Stack, {
spacing: "XXSmall"
}, title && /*#__PURE__*/React.createElement(Heading, {
type: "title3"
}, title), description && /*#__PURE__*/React.createElement(Text, null, description)), children), actions));
export default CallOutBanner;