UNPKG

@wordpress/global-styles-ui

Version:
68 lines (66 loc) • 2.89 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/global-styles-ui/src/presets/preset-edit-header.tsx var preset_edit_header_exports = {}; __export(preset_edit_header_exports, { default: () => PresetEditHeader }); module.exports = __toCommonJS(preset_edit_header_exports); var import_components = require("@wordpress/components"); var import_icons = require("@wordpress/icons"); var import_ui = require("@wordpress/ui"); var import_screen_header = require("../screen-header.cjs"); var import_lock_unlock = require("../lock-unlock.cjs"); var import_jsx_runtime = require("react/jsx-runtime"); var { Menu } = (0, import_lock_unlock.unlock)(import_components.privateApis); function PresetEditHeader({ title, description, menuLabel, menuItems }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { justify: "space-between", align: "flex-start", children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_screen_header.ScreenHeader, { title, description }), menuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalSpacer, { marginTop: 2, marginBottom: 0, paddingX: 4, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Menu, { children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)( Menu.TriggerButton, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_components.Button, { size: "small", icon: import_icons.moreVertical, label: menuLabel } ) } ), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu.Popover, { children: menuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)( Menu.Item, { disabled: item.disabled, onClick: item.onClick, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu.ItemLabel, { children: item.label }) }, item.label )) }) ] }) }) }) ] }); } //# sourceMappingURL=preset-edit-header.cjs.map