@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.
61 lines (59 loc) • 2.2 kB
JavaScript
import * as React from "react";
import styled from "styled-components";
import StyledRelative from "../primitives/StyledRelative";
import defaultTheme from "../../../defaultTheme";
import CustomBadge from "./CustomBadge";
import Badge from "../../../Badge";
import Text from "../../../Text";
import Stack from "../../../Stack";
import StyledIconWrapper from "../primitives/StyledIconWrapper";
import StyledProgressLine from "../primitives/StyledProgressLine";
import StyledText from "../primitives/StyledText";
var StyledIndent = styled.div.withConfig({
displayName: "TimelineStepMobile__StyledIndent",
componentId: "sc-12kfx34-0"
})(["padding-left:", ";"], function (_ref) {
var theme = _ref.theme;
return theme.orbit.spaceXSmall;
});
StyledIndent.defaultProps = {
theme: defaultTheme
};
var TimelineStepMobile = function TimelineStepMobile(_ref2) {
var type = _ref2.type,
subLabel = _ref2.subLabel,
label = _ref2.label,
nextType = _ref2.nextType,
typeIcon = _ref2.typeIcon,
children = _ref2.children,
last = _ref2.last;
return /*#__PURE__*/React.createElement(StyledRelative, null, /*#__PURE__*/React.createElement(Stack, {
flex: true,
spaceAfter: "large",
align: "stretch",
desktop: {
align: "start"
}
}, /*#__PURE__*/React.createElement(StyledIconWrapper, {
mobile: true
}, typeIcon), !last && /*#__PURE__*/React.createElement(StyledProgressLine, {
status: nextType,
"data-test": "progressLine"
}), /*#__PURE__*/React.createElement(Stack, {
flex: true,
shrink: true,
direction: "column",
spacing: "condensed"
}, /*#__PURE__*/React.createElement(Stack, {
flex: true,
spacing: "condensed",
align: "center"
}, !type ? /*#__PURE__*/React.createElement(CustomBadge, null, label) : /*#__PURE__*/React.createElement(Badge, {
type: type
}, label), /*#__PURE__*/React.createElement(StyledText, null, /*#__PURE__*/React.createElement(Text, {
size: "small"
}, subLabel))), /*#__PURE__*/React.createElement(StyledIndent, null, /*#__PURE__*/React.createElement(Text, {
type: type ? "primary" : "secondary"
}, children)))));
};
export default TimelineStepMobile;