@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.
38 lines (34 loc) • 1.35 kB
JavaScript
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
const _excluded = ["children", "spaceAfter"];
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";
const StyledWrapper = styled.div.withConfig({
displayName: "ItineraryBadgeList__StyledWrapper",
componentId: "sc-1ljhg3y-0"
})(["", ";"], ({
theme,
offset
}) => css(["margin-bottom:", ";margin-", ":", "px"], getSpacingToken, left, parseInt(theme.orbit.spaceSmall, 10) + parseInt(theme.orbit.spaceSmall, 10) + offset)); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198
StyledWrapper.defaultProps = {
theme: themeDefault
};
const ItineraryBadgeList = (_ref) => {
let {
children,
spaceAfter = "medium"
} = _ref,
props = _objectWithoutProperties(_ref, _excluded);
const {
calculatedWidth: offset
} = useWidth();
return /*#__PURE__*/React.createElement(StyledWrapper, {
offset: offset,
spaceAfter: spaceAfter
}, /*#__PURE__*/React.createElement(BadgeList, props, children));
};
export default ItineraryBadgeList;