"use client";
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
import { cva } from 'class-variance-authority';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsx } from 'react/jsx-runtime';

function cn(...inputs) {
  return twMerge(clsx(inputs));
}
var toolbarVariants = cva("flex items-center gap-[var(--gap-xs,0.25rem)] rounded-md border border-border bg-card p-[var(--space-1,0.25rem)]", {
  variants: {
    orientation: {
      horizontal: "flex-row",
      vertical: "flex-col items-stretch"
    }
  },
  defaultVariants: { orientation: "horizontal" }
});
var toolbarItemBaseClasses = [
  "inline-flex items-center justify-center gap-[var(--gap-xs,0.25rem)] rounded-sm",
  "px-[var(--space-2,0.5rem)] h-[var(--control-height-sm,2.25rem)] text-sm font-medium",
  "text-foreground/80 hover:text-foreground hover:bg-accent",
  "transition-all duration-[var(--duration-normal,200ms)] ease-out",
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
  "disabled:pointer-events-none disabled:opacity-50",
  "data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
  "active:scale-[0.98]",
  "[&_svg]:size-4 [&_svg]:shrink-0"
].join(" ");
function Toolbar({ className, orientation = "horizontal", ref, ...props }) {
  return /* @__PURE__ */ jsx(
    ToolbarPrimitive.Root,
    {
      ref,
      orientation,
      className: cn(toolbarVariants({ orientation }), className),
      ...props
    }
  );
}
function ToolbarButton({
  className,
  ref,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    ToolbarPrimitive.Button,
    {
      ref,
      className: cn(toolbarItemBaseClasses, className),
      ...props
    }
  );
}
function ToolbarLink({
  className,
  ref,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    ToolbarPrimitive.Link,
    {
      ref,
      className: cn(toolbarItemBaseClasses, "underline-offset-4 hover:underline", className),
      ...props
    }
  );
}
function ToolbarToggleGroup({
  className,
  ref,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    ToolbarPrimitive.ToggleGroup,
    {
      ref,
      className: cn("flex items-center gap-[var(--gap-xs,0.25rem)]", className),
      ...props
    }
  );
}
function ToolbarToggleItem({
  className,
  ref,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    ToolbarPrimitive.ToggleItem,
    {
      ref,
      className: cn(toolbarItemBaseClasses, className),
      ...props
    }
  );
}
function ToolbarSeparator({
  className,
  ref,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    ToolbarPrimitive.Separator,
    {
      ref,
      className: cn(
        "shrink-0 bg-border",
        "data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-px data-[orientation=horizontal]:mx-[var(--space-1,0.25rem)]",
        "data-[orientation=vertical]:w-4 data-[orientation=vertical]:h-px data-[orientation=vertical]:my-[var(--space-1,0.25rem)]",
        className
      ),
      ...props
    }
  );
}

export { Toolbar, ToolbarButton, ToolbarLink, ToolbarSeparator, ToolbarToggleGroup, ToolbarToggleItem, toolbarVariants };
//# sourceMappingURL=toolbar.js.map
//# sourceMappingURL=toolbar.js.map