UNPKG

@rtdui/editor

Version:

React rich text editor based on tiptap

38 lines (35 loc) 933 B
'use client'; import { jsx } from 'react/jsx-runtime'; import { forwardRef } from 'react'; import clsx from 'clsx'; const ControlBase = forwardRef( (props, ref) => { const { className, active, icon: Icon, interactive = true, ...others } = props; return /* @__PURE__ */ jsx( "button", { type: "button", className: clsx("join-item", "btn btn-sm btn-square", { "btn-active": active, "btn-disabled": !interactive }), "data-tiptap-control": true, tabIndex: interactive ? 0 : -1, "aria-pressed": active && interactive || void 0, "aria-hidden": !interactive || void 0, ref, ...others, children: Icon && /* @__PURE__ */ jsx(Icon, { size: "20px" }) } ); } ); ControlBase.displayName = "@rtdui/ControlBase"; export { ControlBase }; //# sourceMappingURL=ControlBase.mjs.map