@patternfly/react-core
Version:
This library provides a set of common React components for use with the PatternFly reference implementation.
17 lines • 1.67 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlexItem = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const react_styles_1 = require("@patternfly/react-styles");
const flex_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/layouts/Flex/flex"));
const flexToken = tslib_1.__importStar(require('@patternfly/react-tokens/dist/js/l_flex_item_Order'));
const util_1 = require("../../helpers/util");
const FlexItem = (_a) => {
var { children = null, className = '', component = 'div', spacer, grow, shrink, flex, alignSelf, align, fullWidth, order, style } = _a, props = tslib_1.__rest(_a, ["children", "className", "component", "spacer", "grow", "shrink", "flex", "alignSelf", "align", "fullWidth", "order", "style"]);
const Component = component;
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({}, props, { className: (0, react_styles_1.css)((0, util_1.formatBreakpointMods)(spacer, flex_1.default), (0, util_1.formatBreakpointMods)(grow, flex_1.default), (0, util_1.formatBreakpointMods)(shrink, flex_1.default), (0, util_1.formatBreakpointMods)(flex, flex_1.default), (0, util_1.formatBreakpointMods)(alignSelf, flex_1.default), (0, util_1.formatBreakpointMods)(align, flex_1.default), (0, util_1.formatBreakpointMods)(fullWidth, flex_1.default), className), style: style || order ? Object.assign(Object.assign({}, style), (0, util_1.setBreakpointCssVars)(order, flexToken.l_flex_item_Order.name)) : undefined, children: children })));
};
exports.FlexItem = FlexItem;
exports.FlexItem.displayName = 'FlexItem';
//# sourceMappingURL=FlexItem.js.map
;