UNPKG

1.09 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.FormFieldGroupExpandable = void 0;
4const tslib_1 = require("tslib");
5const React = tslib_1.__importStar(require("react"));
6const react_1 = require("react");
7const InternalFormFieldGroup_1 = require("./InternalFormFieldGroup");
8const FormFieldGroupExpandable = (_a) => {
9 var { children, className, header, isExpanded = false, toggleAriaLabel } = _a, props = tslib_1.__rest(_a, ["children", "className", "header", "isExpanded", "toggleAriaLabel"]);
10 const [localIsExpanded, setIsExpanded] = react_1.useState(isExpanded);
11 return (React.createElement(InternalFormFieldGroup_1.InternalFormFieldGroup, Object.assign({ className: className, header: header, isExpandable: true, isExpanded: localIsExpanded, toggleAriaLabel: toggleAriaLabel, onToggle: () => setIsExpanded(!localIsExpanded) }, props), children));
12};
13exports.FormFieldGroupExpandable = FormFieldGroupExpandable;
14exports.FormFieldGroupExpandable.displayName = 'FormFieldGroupExpandable';
15//# sourceMappingURL=FormFieldGroupExpandable.js.map
\No newline at end of file