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.

49 lines 1.83 kB
import _styled from "styled-components"; import * as React from "react"; import { css } from "styled-components"; import { StyledBadgeListItem, getIconColor, StyledVerticalBadge, StyledBadgeContent } from "../../BadgeList/BadgeListItem"; import Stack from "../../Stack"; // TODO: remove after designers will resolve status colors // https://skypicker.slack.com/archives/GSGN9BN6Q/p1674568716519889 import Text from "../ItineraryTemporaryText"; const ItineraryBadgeListItem = ({ children, cancelledValue, withBackground, dataTest, type = "neutral", icon, strikeThrough }) => { return /*#__PURE__*/React.createElement(StyledBadgeListItem, { "data-test": dataTest }, /*#__PURE__*/React.createElement(StyledVerticalBadge, { $type: type, "aria-hidden": true }, /*#__PURE__*/React.isValidElement(icon) && /*#__PURE__*/React.cloneElement(icon, { color: getIconColor(type) })), /*#__PURE__*/React.createElement(_StyledStyledBadgeContent, { $_css: cancelledValue ? `4px` : "" }, /*#__PURE__*/React.createElement(Stack, { direction: "column", spacing: "XXSmall" }, /*#__PURE__*/React.createElement(Text, { withBackground: withBackground, type: withBackground && type !== "neutral" ? type : "secondary", weight: withBackground ? "medium" : "normal", size: "small", as: "span", strikeThrough: strikeThrough }, children), cancelledValue && /*#__PURE__*/React.createElement(Text, { type: "secondary", size: "small", as: "span", strikeThrough: true, weight: "medium" }, cancelledValue)))); }; export default ItineraryBadgeListItem; var _StyledStyledBadgeContent = _styled(StyledBadgeContent).withConfig({ displayName: "ItineraryBadgeListItem___StyledStyledBadgeContent", componentId: "sc-1xs5h6a-0" })(["margin-top:", ";"], p => p.$_css);