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 (47 loc) 1.71 kB
import * as React from "react"; import styled from "styled-components"; import Calendar from "../../../icons/Calendar"; import defaultTheme from "../../../defaultTheme"; import Text, { StyledText } from "../../../Text"; import Clock from "../../../icons/Clock"; import Stack from "../../../Stack"; import Badge from "../../../Badge"; var StyledTripDate = styled.div.withConfig({ displayName: "TripDate__StyledTripDate", componentId: "h285yc-0" })(["display:flex;align-items:center;margin-bottom:", ";padding-bottom:", ";background:", ";z-index:1;", "{font-weight:", ";height:", ";}"], function (_ref) { var theme = _ref.theme; return theme.orbit.spaceXSmall; }, function (_ref2) { var theme = _ref2.theme; return theme.orbit.spaceXXSmall; }, function (_ref3) { var theme = _ref3.theme; return theme.orbit.paletteWhite; }, StyledText, function (_ref4) { var theme = _ref4.theme; return theme.orbit.fontWeightMedium; }, function (_ref5) { var theme = _ref5.theme; return theme.orbit.heightIconSmall; }); StyledTripDate.defaultProps = { theme: defaultTheme }; var TripDate = function TripDate(_ref6) { var children = _ref6.children, dataTest = _ref6.dataTest, duration = _ref6.duration; return /*#__PURE__*/React.createElement(StyledTripDate, { "data-test": dataTest }, /*#__PURE__*/React.createElement(Stack, { direction: "row", spacing: "condensed", shrink: true }, /*#__PURE__*/React.createElement(Calendar, { size: "small" }), /*#__PURE__*/React.createElement(Text, null, children)), duration && /*#__PURE__*/React.createElement(Badge, { icon: /*#__PURE__*/React.createElement(Clock, null) }, duration)); }; export default TripDate;