UNPKG

tldraw

Version:

A tiny little drawing editor.

80 lines (79 loc) 1.69 kB
import { jsx } from "react/jsx-runtime"; import classnames from "classnames"; import { Toolbar as _Toolbar } from "radix-ui"; import React from "react"; const TldrawUiToolbar = React.forwardRef( ({ children, className, label, ...props }, ref) => { return /* @__PURE__ */ jsx( _Toolbar.Root, { ref, ...props, className: classnames("tlui-toolbar-container", className), "aria-label": label, children } ); } ); const TldrawUiToolbarButton = React.forwardRef( ({ asChild, children, type, isActive, ...props }, ref) => { return /* @__PURE__ */ jsx( _Toolbar.Button, { ref, asChild, draggable: false, "data-isactive": isActive, ...props, className: classnames("tlui-button", `tlui-button__${type}`, props.className), children } ); } ); const TldrawUiToolbarToggleGroup = ({ children, className, type, ...props }) => { return /* @__PURE__ */ jsx( _Toolbar.ToggleGroup, { type, ...props, className: classnames("tlui-toolbar-toggle-group", className), children } ); }; const TldrawUiToolbarToggleItem = ({ children, className, type, value, ...props }) => { return /* @__PURE__ */ jsx( _Toolbar.ToggleItem, { ...props, className: classnames( "tlui-button", `tlui-button__${type}`, "tlui-toolbar-toggle-group-item", className ), value, children } ); }; export { TldrawUiToolbar, TldrawUiToolbarButton, TldrawUiToolbarToggleGroup, TldrawUiToolbarToggleItem }; //# sourceMappingURL=TldrawUiToolbar.mjs.map