UNPKG

1.96 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';
4import { css } from '@patternfly/react-styles';
5import { formatBreakpointMods, toCamel } from '../../helpers/util';
6import { PageContext } from '../Page/Page';
7export var ToolbarGroupVariant;
8(function (ToolbarGroupVariant) {
9 ToolbarGroupVariant["filter-group"] = "filter-group";
10 ToolbarGroupVariant["icon-button-group"] = "icon-button-group";
11 ToolbarGroupVariant["button-group"] = "button-group";
12})(ToolbarGroupVariant || (ToolbarGroupVariant = {}));
13class ToolbarGroupWithRef extends React.Component {
14 render() {
15 const _a = this.props, { visibility, visiblity, alignment, spacer, spaceItems, className, variant, children, innerRef } = _a, props = __rest(_a, ["visibility", "visiblity", "alignment", "spacer", "spaceItems", "className", "variant", "children", "innerRef"]);
16 if (visiblity !== undefined) {
17 // eslint-disable-next-line no-console
18 console.warn('The ToolbarGroup visiblity prop has been deprecated. ' +
19 'Please use the correctly spelled visibility prop instead.');
20 }
21 return (React.createElement(PageContext.Consumer, null, ({ width, getBreakpoint }) => (React.createElement("div", Object.assign({ className: css(styles.toolbarGroup, variant && styles.modifiers[toCamel(variant)], formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)), formatBreakpointMods(alignment, styles, '', getBreakpoint(width)), formatBreakpointMods(spacer, styles, '', getBreakpoint(width)), formatBreakpointMods(spaceItems, styles, '', getBreakpoint(width)), className) }, props, { ref: innerRef }), children))));
22 }
23}
24export const ToolbarGroup = React.forwardRef((props, ref) => (React.createElement(ToolbarGroupWithRef, Object.assign({}, props, { innerRef: ref }))));
25//# sourceMappingURL=ToolbarGroup.js.map
\No newline at end of file