UNPKG

1.29 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import { css } from '@patternfly/react-styles';
4import styles from '@patternfly/react-styles/css/layouts/Flex/flex';
5import * as flexToken from '@patternfly/react-tokens/dist/esm/l_flex_item_Order';
6import { formatBreakpointMods, setBreakpointCssVars } from '../../helpers/util';
7export const FlexItem = (_a) => {
8 var { children = null, className = '', component = 'div', spacer, grow, shrink, flex, alignSelf, align, fullWidth, order, style } = _a, props = __rest(_a, ["children", "className", "component", "spacer", "grow", "shrink", "flex", "alignSelf", "align", "fullWidth", "order", "style"]);
9 const Component = component;
10 return (React.createElement(Component, Object.assign({}, props, { className: css(formatBreakpointMods(spacer, styles), formatBreakpointMods(grow, styles), formatBreakpointMods(shrink, styles), formatBreakpointMods(flex, styles), formatBreakpointMods(alignSelf, styles), formatBreakpointMods(align, styles), formatBreakpointMods(fullWidth, styles), className), style: style || order ? Object.assign(Object.assign({}, style), setBreakpointCssVars(order, flexToken.l_flex_item_Order.name)) : undefined }), children));
11};
12FlexItem.displayName = 'FlexItem';
13//# sourceMappingURL=FlexItem.js.map
\No newline at end of file