UNPKG

@tohuhono/puck-rich-text

Version:

A puck component for rich text editing made for OberonCMS

55 lines (54 loc) 1.31 kB
import { jsx } from "react/jsx-runtime"; import * as Menu from "@radix-ui/react-dropdown-menu"; import { getClassNameFactory } from "../../../../compat/get-class-name-factory.js"; import styles from "./styles.module.css.js"; const getClassName = getClassNameFactory("DropdownMenu", styles); function DropdownMenu({ children }) { return /* @__PURE__ */ jsx(Menu.Root, { children }); } function DropdownTrigger({ children, onClick, ...props }) { return /* @__PURE__ */ jsx( Menu.Trigger, { onClick: (e) => { e.stopPropagation(); onClick == null ? void 0 : onClick(e); }, className: getClassName("action"), ...props, children } ); } function DropdownContent({ children }) { return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Content, { className: getClassName("content"), children }) }); } function DropdownItem({ children, onClick, ...props }) { return /* @__PURE__ */ jsx( Menu.Item, { style: { justifyContent: "left" }, onClick: (e) => { e.stopPropagation(); onClick == null ? void 0 : onClick(e); }, className: getClassName("action"), ...props, children } ); } export { DropdownContent, DropdownItem, DropdownMenu, DropdownTrigger };