vcc-ui
Version:
A React library for building user interfaces at Volvo Cars
42 lines (41 loc) • 1.07 kB
JavaScript
import PropTypes from 'prop-types';
import React from 'react';
import { Flex } from '../flex';
/**
* @deprecated This component is deprecated and can be recreated using CSS only. See [Grid](https://developer.volvocars.com/design-system/web/?path=/docs/layout-grid--docs)
*/
export const Grid = _ref => {
let {
children
} = _ref;
return /*#__PURE__*/React.createElement(Flex, {
extend: gridCSS
}, children);
};
Grid.propTypes = {
/** A JSX node */
// @ts-ignore
children: PropTypes.node.isRequired
};
const gridCSS = _ref2 => {
let {
theme
} = _ref2;
return {
boxSizing: 'border-box',
width: '100%',
maxWidth: 1400,
margin: '0 auto',
paddingLeft: theme.baselineGrid * 2,
paddingRight: theme.baselineGrid * 2,
// We use onlyM here so that breakpoint orders don't need to be defined by the user
onlyM: {
paddingLeft: theme.baselineGrid * 3,
paddingRight: theme.baselineGrid * 3
},
fromL: {
paddingLeft: theme.baselineGrid * 5,
paddingRight: theme.baselineGrid * 5
}
};
};