import { jsx } from "react/jsx-runtime";
import { Button, cn } from "@uipath/apollo-wind";
import { forwardRef, isValidElement } from "react";
import { CanvasIcon } from "../../utils/icon-registry.js";
const CANVAS_INLINE_BUTTON_CLASS = "grid place-items-center w-7 h-7 rounded-[10px] border border-(--canvas-border) bg-(--canvas-background-raised) text-(--canvas-foreground) enabled:hover:bg-(--canvas-background-overlay) enabled:hover:border-(--canvas-primary-hover) enabled:hover:text-(--canvas-foreground) [transition:opacity_120ms_ease,color_120ms_ease,background-color_120ms_ease,border-color_120ms_ease]";
const CanvasInlineButton = /*#__PURE__*/ forwardRef(({ icon = 'plus', iconSize = 14, className, ...rest }, ref)=>{
    const iconNode = 'string' == typeof icon ? /*#__PURE__*/ jsx(CanvasIcon, {
        icon: icon,
        size: iconSize
    }) : /*#__PURE__*/ isValidElement(icon) ? icon : null;
    return /*#__PURE__*/ jsx(Button, {
        ref: ref,
        variant: "outline",
        size: "3xs",
        icon: true,
        className: cn(CANVAS_INLINE_BUTTON_CLASS, className),
        ...rest,
        children: iconNode
    });
});
CanvasInlineButton.displayName = 'CanvasInlineButton';
export { CanvasInlineButton };
