1 | import { __rest } from "tslib";
|
2 | import * as React from 'react';
|
3 | import styles from '@patternfly/react-styles/css/layouts/Grid/grid';
|
4 | import { css } from '@patternfly/react-styles';
|
5 | import { DeviceSizes } from '../../styles/sizes';
|
6 | import * as gridToken from '@patternfly/react-tokens/dist/esm/l_grid_item_Order';
|
7 | import { setBreakpointCssVars } from '../../helpers/util';
|
8 | export const Grid = (_a) => {
|
9 | var { children = null, className = '', component = 'div', hasGutter, span = null, order, style } = _a, props = __rest(_a, ["children", "className", "component", "hasGutter", "span", "order", "style"]);
|
10 | const classes = [styles.grid, span && styles.modifiers[`all_${span}Col`]];
|
11 | const Component = component;
|
12 | Object.entries(DeviceSizes).forEach(([propKey, gridSpanModifier]) => {
|
13 | const key = propKey;
|
14 | const propValue = props[key];
|
15 | if (propValue) {
|
16 | classes.push(styles.modifiers[`all_${propValue}ColOn${gridSpanModifier}`]);
|
17 | }
|
18 | delete props[key];
|
19 | });
|
20 | return (React.createElement(Component, Object.assign({ className: css(...classes, hasGutter && styles.modifiers.gutter, className), style: style || order ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order, gridToken.l_grid_item_Order.name)) : undefined }, props), children));
|
21 | };
|
22 | Grid.displayName = 'Grid';
|
23 |
|
\ | No newline at end of file |