@wordpress/block-library
Version:
Block library for the WordPress editor.
25 lines (24 loc) • 1.12 kB
JavaScript
import { __experimentalToggleGroupControl, __experimentalToggleGroupControlOption } from "@wordpress/components";
import { __ } from "@wordpress/i18n";
import { jsx, jsxs } from "react/jsx-runtime";
// packages/block-library/src/terms-query/edit/inspector-controls/inherit-control.jsx
function InheritControl({ value, onChange, label }) {
return /* @__PURE__ */ jsxs(__experimentalToggleGroupControl, {
label,
isBlock: true,
onChange: (newValue) => {
onChange({ inherit: newValue === "default" });
},
help: value ? __("Display terms based on the current taxonomy archive. For hierarchical taxonomies, shows children of the current term. For non-hierarchical taxonomies, shows all terms.") : __("Display terms based on specific criteria."),
value: value ? "default" : "custom",
children: [/* @__PURE__ */ jsx(__experimentalToggleGroupControlOption, {
value: "default",
label: __("Default")
}), /* @__PURE__ */ jsx(__experimentalToggleGroupControlOption, {
value: "custom",
label: __("Custom")
})]
});
}
export { InheritControl as default };
//# sourceMappingURL=inherit-control.mjs.map