import { j as e } from "../../node_modules/react/jsx-runtime.js";
import { forwardRef as d } from "react";
import { cva as l } from "../../node_modules/class-variance-authority/dist/index.js";
import { cn as m } from "../../utils/index.js";
const u = l(
  [
    "w-full",
    //full-width
    "rounded-md",
    //rounded-border
    "font-semibold",
    //font semibold
    "focus:outline-none",
    //no outline when is focus
    "disabled:cursor-not-allowed",
    "focus:ring-1",
    "focus:ring-offset-2",
    "text-nowrap"
  ],
  {
    variants: {
      variant: {
        solid: "",
        outline: "border-2",
        ghost: "transition-colors duration-300"
      },
      size: {
        sm: "px-3 py-2 text-sm",
        md: "px-4 py-3 text-base",
        lg: "px-6 py-5 text-lg"
      },
      colorscheme: {
        primary: "text-white"
      },
      fit: {
        content: "w-fit",
        stretch: "w-full"
      }
    },
    compoundVariants: [
      {
        variant: "solid",
        colorscheme: "primary",
        className: "bg-interaction-main-default hover:bg-interaction-main-hover active:bg-interaction-main-active focus:ring-interaction-main-default disabled:bg-interaction-support-disabled-subtle disabled:text-interaction-support-disabled-medium"
      },
      {
        variant: "outline",
        colorscheme: "primary",
        className: "text-interaction-main-default border-interaction-main-default bg-transparent hover:bg-interaction-muted-brand-hover active:bg-interaction-muted-brand-active focus:border-interaction-main-active focus:ring-0 disabled:text-interaction-support-disabled-medium disabled:border-interaction-support-disabled-medium disabled:bg-transparent"
      },
      {
        variant: "ghost",
        colorscheme: "primary",
        className: "text-interaction-main-default bg-transparent hover:bg-interaction-muted-brand-hover active:bg-interaction-muted-brand-active focus:ring-interaction-main-default disabled:text-interaction-support-disabled-medium"
      }
    ],
    defaultVariants: {
      variant: "solid",
      size: "md",
      colorscheme: "primary",
      fit: "content"
    }
  }
), s = d(
  ({ variant: t, size: i, colorscheme: n, fit: a, className: r, ...o }, c) => /* @__PURE__ */ e.jsx(
    "button",
    {
      ref: c,
      className: m(
        u({ variant: t, size: i, colorscheme: n, fit: a, className: r })
      ),
      ...o
    }
  )
), v = d(
  ({ variant: t, size: i, colorscheme: n, className: a, ...r }) => {
    const o = {
      solid: "/vector-white.svg",
      outline: "/vector-red.svg",
      ghost: "/vector-red.svg"
    };
    return /* @__PURE__ */ e.jsxs("div", { className: "flex gap-[3px]", children: [
      /* @__PURE__ */ e.jsx(
        s,
        {
          className: "rounded-l-lg rounded-r-none",
          variant: t,
          size: i,
          ...r
        }
      ),
      /* @__PURE__ */ e.jsx(
        s,
        {
          className: "rounded-r-lg rounded-l-none",
          variant: t,
          size: i,
          ...r,
          children: /* @__PURE__ */ e.jsx("img", { src: o[t || "solid"], alt: "icon" })
        }
      )
    ] });
  }
);
export {
  s as Button,
  v as SplitButton
};
