@patternfly/react-core
Version:
This library provides a set of common React components for use with the PatternFly reference implementation.
11 lines • 841 B
JavaScript
import { __rest } from "tslib";
import * as React from 'react';
import { useState } from 'react';
import { InternalFormFieldGroup } from './InternalFormFieldGroup';
export const FormFieldGroupExpandable = (_a) => {
var { children, className, header, isExpanded = false, toggleAriaLabel } = _a, props = __rest(_a, ["children", "className", "header", "isExpanded", "toggleAriaLabel"]);
const [localIsExpanded, setIsExpanded] = useState(isExpanded);
return (React.createElement(InternalFormFieldGroup, Object.assign({ className: className, header: header, isExpandable: true, isExpanded: localIsExpanded, toggleAriaLabel: toggleAriaLabel, onToggle: () => setIsExpanded(!localIsExpanded) }, props), children));
};
FormFieldGroupExpandable.displayName = 'FormFieldGroupExpandable';
//# sourceMappingURL=FormFieldGroupExpandable.js.map