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.

42 lines (40 loc) 1.51 kB
import * as React from "react"; import styled from "styled-components"; import defaultTheme from "../../defaultTheme"; import getViewportHideStyles from "../../Hide/helpers/getViewportHideStyles"; import { StyledCard } from "../../Card"; import { StyledCard as DeprecatedStyledCard } from "../../deprecated/Card"; import { getBreakpointWidth } from "../../utils/mediaQuery"; import { QUERIES } from "../../utils/mediaQuery/consts"; var StyledColumn = styled.div.withConfig({ displayName: "LayoutColumn__StyledColumn", componentId: "sc-1aiwbna-0" })(["", ";@media (max-width:", "px){", ",", "{margin-right:-", ";margin-left:-", ";width:auto;}}"], function (_ref) { var hideOn = _ref.hideOn; return !!hideOn && getViewportHideStyles(hideOn); }, function (_ref2) { var theme = _ref2.theme; return +getBreakpointWidth(QUERIES.LARGEMOBILE, theme, true) - 1; }, StyledCard, DeprecatedStyledCard, function (_ref3) { var theme = _ref3.theme; return theme.orbit.spaceMedium; }, function (_ref4) { var theme = _ref4.theme; return theme.orbit.spaceMedium; }); StyledColumn.defaultProps = { theme: defaultTheme }; var LayoutColumn = function LayoutColumn(_ref5) { var children = _ref5.children, hideOn = _ref5.hideOn, _ref5$as = _ref5.as, as = _ref5$as === void 0 ? "div" : _ref5$as, dataTest = _ref5.dataTest; return /*#__PURE__*/React.createElement(StyledColumn, { "data-test": dataTest, hideOn: hideOn, as: as }, children); }; export default LayoutColumn;