"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _components = require("@wordpress/components");
var _element = require("@wordpress/element");
var _icons = require("@wordpress/icons");
var _lockUnlock = require("../../lock-unlock");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const {
  Tabs
} = (0, _lockUnlock.unlock)(_components.privateApis);
function TabbedSidebar({
  defaultTabId,
  onClose,
  onSelect,
  selectedTab,
  tabs,
  closeButtonLabel
}, ref) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: "block-editor-tabbed-sidebar",
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tabs, {
      selectOnMove: false,
      defaultTabId: defaultTabId,
      onSelect: onSelect,
      selectedTabId: selectedTab,
      children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
        className: "block-editor-tabbed-sidebar__tablist-and-close-button",
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
          className: "block-editor-tabbed-sidebar__close-button",
          icon: _icons.closeSmall,
          label: closeButtonLabel,
          onClick: () => onClose(),
          size: "compact"
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabList, {
          className: "block-editor-tabbed-sidebar__tablist",
          ref: ref,
          children: tabs.map(tab => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.Tab, {
            tabId: tab.name,
            className: "block-editor-tabbed-sidebar__tab",
            children: tab.title
          }, tab.name))
        })]
      }), tabs.map(tab => /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabPanel, {
        tabId: tab.name,
        focusable: false,
        className: "block-editor-tabbed-sidebar__tabpanel",
        ref: tab.panelRef,
        children: tab.panel
      }, tab.name))]
    })
  });
}
var _default = exports.default = (0, _element.forwardRef)(TabbedSidebar);
//# sourceMappingURL=index.js.map