"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.Panel = void 0;
var _clsx = _interopRequireDefault(require("clsx"));
var _element = require("@wordpress/element");
var _header = _interopRequireDefault(require("./header"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function UnforwardedPanel({
  header,
  className,
  children
}, ref) {
  const classNames = (0, _clsx.default)(className, 'components-panel');
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    className: classNames,
    ref: ref,
    children: [header && /*#__PURE__*/(0, _jsxRuntime.jsx)(_header.default, {
      label: header
    }), children]
  });
}

/**
 * `Panel` expands and collapses multiple sections of content.
 *
 * ```jsx
 * import { Panel, PanelBody, PanelRow } from '@wordpress/components';
 * import { more } from '@wordpress/icons';
 *
 * const MyPanel = () => (
 * 	<Panel header="My Panel">
 * 		<PanelBody title="My Block Settings" icon={ more } initialOpen={ true }>
 * 			<PanelRow>My Panel Inputs and Labels</PanelRow>
 * 		</PanelBody>
 * 	</Panel>
 * );
 * ```
 */
const Panel = exports.Panel = (0, _element.forwardRef)(UnforwardedPanel);
var _default = exports.default = Panel;
//# sourceMappingURL=index.js.map