| 1 |
import { __rest } from "tslib"; |
| 2 |
import { jsx as _jsx } from "react/jsx-runtime"; |
| 3 |
import styles from '@patternfly/react-styles/css/layouts/Grid/grid.mjs'; |
| 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 (_jsx(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: children }))); |
| 21 |
}; |
| 22 |
Grid.displayName = 'Grid'; |
| 23 |
//# sourceMappingURL=Grid.js.map |