@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.
37 lines • 1.26 kB
JavaScript
import * as React from "react";
import styled, { css } from "styled-components";
import defaultTheme from "../../defaultTheme";
import getViewportHideStyles from "../../Hide/helpers/getViewportHideStyles";
import { StyledCard } from "../../Card";
import { getBreakpointWidth } from "../../utils/mediaQuery";
import { QUERIES } from "../../utils/mediaQuery/consts";
const StyledColumn = styled.div.withConfig({
displayName: "LayoutColumn__StyledColumn",
componentId: "sc-aa57pk-0"
})(["", ""], ({
theme,
spanEntireRow,
hideOn
}) => css(["", ";", ";@media (max-width:", "px){", "{margin-right:-", ";margin-left:-", ";width:auto;}}"], !!hideOn && getViewportHideStyles(hideOn), spanEntireRow && css(["grid-column:1 / -1;"]), +getBreakpointWidth(QUERIES.LARGEMOBILE, theme, true) - 1, StyledCard, theme.orbit.spaceMedium, theme.orbit.spaceMedium));
StyledColumn.defaultProps = {
theme: defaultTheme
};
const LayoutColumn = ({
children,
hideOn,
as = "div",
spanEntireRow,
dataTest
}) => {
return (
/*#__PURE__*/
// @ts-expect-error TODO
React.createElement(StyledColumn, {
"data-test": dataTest,
hideOn: hideOn,
as: as,
spanEntireRow: spanEntireRow
}, children)
);
};
export default LayoutColumn;