@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.
53 lines • 2.32 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-1k8vemg-0"
})(["", ";"], ({
theme,
onClick
}) => css(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;background:", ";border-radius:", ";padding:", ";", ";", ";"], theme.orbit.paletteWhite, theme.orbit.borderRadiusSmall, theme.orbit.spaceMedium, onClick ? css(["box-shadow:", ";transition:box-shadow ", " ease-in-out;cursor:pointer;:active,:hover{box-shadow:", ";outline:none;}border:1px solid transparent;"], theme.orbit.boxShadowAction, theme.orbit.durationFast, theme.orbit.boxShadowActionActive) : css(["border:1px solid ", ";"], theme.orbit.paletteCloudNormal), mq.largeMobile(css(["flex-direction:row;padding:", ";"], theme.orbit.spaceLarge))));
StyledCallOutBanner.defaultProps = {
theme: defaultTheme
};
const StyledIllustration = styled.div.withConfig({
displayName: "CallOutBanner__StyledIllustration",
componentId: "sc-1k8vemg-1"
})(["padding-bottom:", ";", ";"], ({
theme
}) => theme.orbit.spaceMedium, mq.largeMobile(css(["padding-right:", ";padding-bottom:0;"], ({
theme
}) => theme.orbit.spaceLarge)));
StyledIllustration.defaultProps = {
theme: defaultTheme
};
const CallOutBanner = ({
children,
illustration,
actions,
title,
onClick,
tabIndex,
description,
dataTest,
id
}) => /*#__PURE__*/React.createElement(StyledCallOutBanner, {
onClick: onClick,
tabIndex: (onClick || Number(tabIndex)) && (Number(tabIndex) || 0),
"data-test": dataTest,
id: id
}, 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;