@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.
33 lines • 1.14 kB
JavaScript
import * as React from "react";
import styled, { css } from "styled-components";
import getSpacingToken from "../../common/getSpacingToken";
import themeDefault from "../../defaultTheme";
import { left } from "../../utils/rtl";
import BadgeList from "../../BadgeList";
import { useWidth } from "../context";
import ItineraryBadgeListItem from "./ItineraryBadgeListItem";
export const StyledWrapper = styled.div.withConfig({
displayName: "ItineraryBadgeList__StyledWrapper",
componentId: "sc-awgruv-0"
})(["", ";"], ({
theme,
offset
}) => css(["margin-bottom:", ";margin-", ":", "px"], getSpacingToken, left, parseInt(theme.orbit.spaceSmall, 10) + parseInt(theme.orbit.spaceSmall, 10) + offset));
StyledWrapper.defaultProps = {
theme: themeDefault
};
const ItineraryBadgeList = ({
children,
spaceAfter,
...props
}) => {
const {
calculatedWidth: offset
} = useWidth();
return /*#__PURE__*/React.createElement(StyledWrapper, {
offset: offset,
spaceAfter: spaceAfter
}, /*#__PURE__*/React.createElement(BadgeList, props, children));
};
export default ItineraryBadgeList;
export { ItineraryBadgeListItem };