@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.
65 lines (61 loc) • 2.37 kB
JavaScript
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import * as React from "react";
import styled, { css } from "styled-components";
import { left } from "../utils/rtl";
import Stack from "../Stack";
import mq from "../utils/mediaQuery";
import { StyledTextLink } from "../TextLink";
import defaultTheme from "../defaultTheme";
var StyledLinkList = styled.ul.withConfig({
displayName: "LinkList__StyledLinkList",
componentId: "wz7xd9-0"
})(["display:block;width:100%;margin:0;padding:0;padding-", ":", ";list-style:none;font-size:", ";"], left, function (_ref) {
var indent = _ref.indent,
theme = _ref.theme;
return indent && theme.orbit.spaceXXSmall;
}, function (_ref2) {
var theme = _ref2.theme;
return theme.orbit.fontSizeTextNormal;
});
StyledLinkList.defaultProps = {
theme: defaultTheme
};
var StyledNavigationLinkListChild = styled(function (_ref3) {
var theme = _ref3.theme,
direction = _ref3.direction,
props = _objectWithoutProperties(_ref3, ["theme", "direction"]);
return /*#__PURE__*/React.createElement("li", props);
}).withConfig({
displayName: "LinkList__StyledNavigationLinkListChild",
componentId: "wz7xd9-1"
})(["", "{text-decoration:none;}", ";"], StyledTextLink, function (_ref4) {
var direction = _ref4.direction;
return direction === "column" && css(["width:100%;", "{width:100%;", ";}"], StyledTextLink, mq.tablet(css(["width:auto;"])));
});
StyledNavigationLinkListChild.defaultProps = {
theme: defaultTheme
};
var LinkList = function LinkList(_ref5) {
var _ref5$direction = _ref5.direction,
direction = _ref5$direction === void 0 ? "column" : _ref5$direction,
indent = _ref5.indent,
_ref5$spacing = _ref5.spacing,
spacing = _ref5$spacing === void 0 ? "natural" : _ref5$spacing,
children = _ref5.children,
dataTest = _ref5.dataTest;
return /*#__PURE__*/React.createElement(StyledLinkList, {
indent: indent,
"data-test": dataTest
}, /*#__PURE__*/React.createElement(Stack, {
direction: direction,
spacing: spacing
}, React.Children.map(children, function (item) {
if ( /*#__PURE__*/React.isValidElement(item)) {
return /*#__PURE__*/React.createElement(StyledNavigationLinkListChild, {
direction: direction
}, item);
}
return null;
})));
};
export default LinkList;