import { j as a } from "../../node_modules/react/jsx-runtime.js";
import { forwardRef as i } from "react";
import { cva as m } from "../../node_modules/class-variance-authority/dist/index.js";
import { cn as h } from "../../utils/index.js";
import { Icon as d } from "../Icon/index.js";
const u = m(["btn"], {
  variants: {
    variant: {
      solid: "",
      outline: "",
      ghost: ""
    },
    size: {
      xs: "size-xs",
      sm: "size-sm",
      md: "size-md",
      lg: "size-lg"
    },
    colorScheme: {
      primary: "",
      grey: "",
      warn: "",
      critical: "",
      "warn-dark": ""
    },
    fit: {
      content: "w-fit",
      stretch: "w-full justify-center"
    }
  },
  compoundVariants: [
    {
      variant: "solid",
      colorScheme: "primary",
      className: "btn-primary"
    },
    {
      variant: "outline",
      colorScheme: "primary",
      className: "btn-primary-outline"
    },
    {
      variant: "ghost",
      colorScheme: "primary",
      className: "btn-primary-ghost"
    },
    {
      variant: "solid",
      colorScheme: "grey",
      className: "btn-grey"
    },
    {
      variant: "outline",
      colorScheme: "grey",
      className: "btn-grey-outline"
    },
    {
      variant: "ghost",
      colorScheme: "grey",
      className: "btn-grey-ghost"
    },
    {
      variant: "solid",
      colorScheme: "warn",
      className: "btn-warn"
    },
    {
      variant: "outline",
      colorScheme: "warn",
      className: "btn-warn-outline"
    },
    {
      variant: "ghost",
      colorScheme: "warn",
      className: "btn-warn-ghost"
    },
    {
      variant: "solid",
      colorScheme: "critical",
      className: "btn-critical"
    },
    {
      variant: "outline",
      colorScheme: "critical",
      className: "btn-critical-outline"
    },
    {
      variant: "ghost",
      colorScheme: "critical",
      className: "btn-critical-ghost"
    },
    {
      variant: "solid",
      colorScheme: "warn-dark",
      className: "btn-warn-dark"
    },
    {
      variant: "outline",
      colorScheme: "warn-dark",
      className: "btn-warn-dark-outline"
    },
    {
      variant: "ghost",
      colorScheme: "warn-dark",
      className: "btn-warn-dark-ghost"
    }
  ],
  defaultVariants: {
    variant: "solid",
    size: "md",
    colorScheme: "primary",
    fit: "content"
  }
}), c = i(
  ({ variant: r, size: e, colorScheme: n, fit: s, className: o, ...t }, l) => /* @__PURE__ */ a.jsx(
    "button",
    {
      ref: l,
      className: h(
        u({
          variant: r,
          size: e,
          colorScheme: n,
          fit: s,
          className: o
        })
      ),
      ...t
    }
  )
), w = i(
  ({ variant: r, size: e, colorScheme: n, className: s, ...o }, t) => /* @__PURE__ */ a.jsxs("div", { className: "flex gap-[3px]", ref: t, children: [
    /* @__PURE__ */ a.jsx(
      c,
      {
        className: "rounded-l-lg rounded-r-none",
        variant: r,
        size: e,
        ...o
      }
    ),
    /* @__PURE__ */ a.jsx(
      c,
      {
        className: "rounded-r-lg rounded-l-none",
        variant: r,
        size: e,
        ...o,
        children: /* @__PURE__ */ a.jsx(d, { name: "chevron-down", size: "sm" })
      }
    )
  ] })
);
export {
  c as Button,
  w as SplitButton
};
