@wordpress/block-library
Version:
Block library for the WordPress editor.
35 lines (34 loc) • 1.47 kB
JavaScript
import clsx from "clsx";
import { RichText, __experimentalGetBorderClassesAndStyles, __experimentalGetColorClassesAndStyles, __experimentalGetShadowClassesAndStyles, __experimentalGetSpacingClassesAndStyles, getBackgroundClassesAndStyles, useBlockProps } from "@wordpress/block-editor";
import { jsx } from "react/jsx-runtime";
// packages/block-library/src/tab-list/save.jsx
function save({ attributes }) {
const { tabs } = attributes;
const blockProps = useBlockProps.save({ role: "tablist" });
const backgroundProps = getBackgroundClassesAndStyles(attributes);
const colorProps = __experimentalGetColorClassesAndStyles(attributes);
const borderProps = __experimentalGetBorderClassesAndStyles(attributes);
const spacingProps = __experimentalGetSpacingClassesAndStyles(attributes);
const shadowProps = __experimentalGetShadowClassesAndStyles(attributes);
const buttonClassName = clsx(backgroundProps.className, colorProps.className, borderProps.className);
const buttonStyle = {
...backgroundProps.style,
...colorProps.style,
...borderProps.style,
...spacingProps.style,
...shadowProps.style
};
return /* @__PURE__ */ jsx("div", {
...blockProps,
children: tabs.map((tab, index) => /* @__PURE__ */ jsx(RichText.Content, {
className: buttonClassName || void 0,
style: buttonStyle,
tagName: "button",
value: tab.label,
type: "button",
role: "tab"
}, index))
});
}
export { save as default };
//# sourceMappingURL=save.mjs.map