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.

24 lines (21 loc) 1.01 kB
import styled, { css } from "styled-components"; import { left } from "../../../utils/rtl"; import defaultTheme from "../../../defaultTheme"; const renderStatus = (type, theme) => { if (type === "success") return theme.orbit.colorTextSuccess; if (type === "warning") return theme.orbit.colorTextWarning; if (type === "critical") return theme.orbit.colorTextCritical; return theme.orbit.paletteCloudNormalHover; }; const StyledProgressLine = styled.span.withConfig({ displayName: "StyledProgressLine", componentId: "sc-1yvg893-0" })(["", ""], ({ desktop, theme, status }) => css(["", ";", ";width:", ";", ":11px;background:", ";height:", ";"], !desktop && `position: absolute`, !desktop && `top: 18px`, desktop ? "50%" : "2px", left, renderStatus(status, theme), desktop ? `2px` : `calc(100% + 4px)`)); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 StyledProgressLine.defaultProps = { theme: defaultTheme }; export default StyledProgressLine;