@wordpress/block-library
Version:
Block library for the WordPress editor.
40 lines (39 loc) • 1.42 kB
JavaScript
// packages/block-library/src/tabs/controls.js
import { __ } from "@wordpress/i18n";
import { PanelBody, TextControl } from "@wordpress/components";
import { InspectorControls } from "@wordpress/block-editor";
import AddTabToolbarControl from "../tab/add-tab-toolbar-control.mjs";
import RemoveTabToolbarControl from "../tab/remove-tab-toolbar-control.mjs";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
function Controls({ attributes, setAttributes, clientId }) {
const {
metadata = {
name: ""
}
} = attributes;
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(AddTabToolbarControl, { tabsClientId: clientId }),
/* @__PURE__ */ jsx(RemoveTabToolbarControl, { tabsClientId: clientId }),
/* @__PURE__ */ jsx(InspectorControls, { children: /* @__PURE__ */ jsx(PanelBody, { title: __("Settings"), children: /* @__PURE__ */ jsx(
TextControl,
{
label: __("Tabs Title"),
help: __(
"The tabs title is used by screen readers to describe the purpose and content of the tabs."
),
value: metadata.name,
placeholder: __("Tab Contents"),
onChange: (value) => {
setAttributes({
metadata: { ...metadata, name: value }
});
},
__next40pxDefaultSize: true
}
) }) })
] });
}
export {
Controls as default
};
//# sourceMappingURL=controls.mjs.map