1 | import { __rest } from "tslib";
|
2 | import * as React from 'react';
|
3 | import { css } from '@patternfly/react-styles';
|
4 | import styles from '@patternfly/react-styles/css/components/ToggleGroup/toggle-group';
|
5 | import { ToggleGroupItem } from './ToggleGroupItem';
|
6 | export const ToggleGroup = (_a) => {
|
7 | var { className, children, isCompact = false, areAllGroupsDisabled = false, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["className", "children", "isCompact", "areAllGroupsDisabled", 'aria-label']);
|
8 | const toggleGroupItemList = React.Children.map(children, child => {
|
9 | const childCompName = child.type.name;
|
10 | return childCompName !== ToggleGroupItem.name
|
11 | ? child
|
12 | : React.cloneElement(child, areAllGroupsDisabled ? { isDisabled: true } : {});
|
13 | });
|
14 | return (React.createElement("div", Object.assign({ className: css(styles.toggleGroup, isCompact && styles.modifiers.compact, className), role: "group", "aria-label": ariaLabel }, props), toggleGroupItemList));
|
15 | };
|
16 | ToggleGroup.displayName = 'ToggleGroup';
|
17 |
|
\ | No newline at end of file |