"use client";
import { jsx as n, jsxs as k } from "react/jsx-runtime";
import f from "react";
import { ArrowsClockwise as v } from "@phosphor-icons/react";
import { L as z } from "./loader-m5wfmqwgucrr4i5v.js";
import { c as i } from "./cn-ct4n7r74mh8y0f48.js";
import { u as w } from "./link-provider-mn2voeohon7cj9o4.js";
const r = {
  shape: {
    base: {
      classes: "",
      description: "Default rectangular button shape"
    },
    square: {
      classes: "items-center justify-center p-0",
      description: "Square button for icon-only actions"
    },
    circle: {
      classes: "items-center justify-center p-0 rounded-full",
      description: "Circular button for icon-only actions"
    }
  },
  size: {
    xs: {
      classes: "h-5 gap-1 rounded-sm px-1.5 text-xs",
      description: "Extra small button for compact UIs"
    },
    sm: {
      classes: "h-6.5 gap-1 rounded-md px-2 text-xs",
      description: "Small button for secondary actions"
    },
    base: {
      classes: "h-9 gap-1.5 rounded-lg px-3 text-base",
      description: "Default button size"
    },
    lg: {
      classes: "h-10 gap-2 rounded-lg px-4 text-base",
      description: "Large button for primary CTAs"
    }
  },
  compactSize: {
    xs: { classes: "size-3.5" },
    sm: { classes: "size-6.5" },
    base: { classes: "size-9" },
    lg: { classes: "size-10" }
  },
  variant: {
    primary: {
      classes: "bg-kumo-brand !text-white hover:bg-kumo-brand-hover focus:bg-kumo-brand-hover disabled:bg-kumo-brand/50",
      description: "High-emphasis button for primary actions"
    },
    secondary: {
      classes: "bg-kumo-base !text-kumo-default ring not-disabled:hover:border-secondary! not-disabled:hover:bg-kumo-tint disabled:bg-kumo-base/50 disabled:!text-kumo-default/70 ring-kumo-ring data-[state=open]:bg-kumo-base",
      description: "Default button style for most actions"
    },
    ghost: {
      classes: "text-kumo-default hover:bg-kumo-tint shadow-none bg-inherit",
      description: "Minimal button with no background"
    },
    destructive: {
      classes: "bg-kumo-danger !text-white hover:bg-kumo-danger/70",
      description: "Danger button for destructive actions like delete"
    },
    "secondary-destructive": {
      classes: "bg-kumo-base !text-kumo-danger ring not-disabled:hover:border-secondary! not-disabled:hover:bg-kumo-base disabled:bg-kumo-base/50 disabled:!text-kumo-danger/70 ring-kumo-line data-[state=open]:bg-kumo-base",
      description: "Secondary button with destructive text for less prominent dangerous actions"
    },
    outline: {
      classes: "bg-transparent text-kumo-default ring-2 ring-kumo-ring",
      description: "Bordered button with transparent background"
    }
  }
}, g = {
  shape: "base",
  size: "base",
  variant: "secondary"
};
function h({
  variant: s = g.variant,
  size: t = g.size,
  shape: e = g.shape
} = {}) {
  const o = e === "square" || e === "circle";
  return i(
    // Base styles
    "group flex w-max shrink-0 items-center font-medium select-none",
    "border-0 shadow-xs",
    "cursor-pointer",
    // Disabled state
    "disabled:cursor-not-allowed disabled:text-kumo-subtle",
    // Apply variant, size, shape styles from KUMO_BUTTON_VARIANTS
    r.variant[s].classes,
    r.size[t].classes,
    r.shape[e].classes,
    o && r.compactSize[t].classes
  );
}
const x = (s) => s ? f.isValidElement(s) ? s : /* @__PURE__ */ n(s, {}) : null, y = f.forwardRef(
  ({
    children: s,
    className: t,
    disabled: e,
    loading: o,
    shape: c = "base",
    size: a = "base",
    variant: u = "secondary",
    icon: d,
    ...l
  }, b) => {
    const { type: m, ...p } = l;
    return /* @__PURE__ */ k(
      "button",
      {
        ref: b,
        className: i(
          h({ variant: u, size: a, shape: c }),
          "outline-none focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-ring *:in-focus:opacity-100",
          // Focus styles
          e && "cursor-not-allowed opacity-50",
          t
        ),
        disabled: o || e,
        type: m ?? "button",
        ...p,
        children: [
          o && /* @__PURE__ */ n(z, { size: a === "lg" ? 16 : 14 }),
          !o && x(d),
          s
        ]
      }
    );
  }
);
y.displayName = "Button";
const R = ({
  "aria-label": s = "Refresh",
  loading: t,
  ...e
}) => /* @__PURE__ */ n(y, { shape: "square", "aria-label": s, ...e, children: /* @__PURE__ */ n(
  v,
  {
    className: i({
      "animate-refresh": t,
      "size-4.5": e.size === "base" || !e.size,
      "size-4": e.size === "sm",
      "size-5": e.size === "lg"
    })
  }
) }), N = f.forwardRef(
  ({
    children: s,
    className: t,
    external: e,
    href: o,
    shape: c = "base",
    size: a = "base",
    variant: u = "ghost",
    icon: d,
    // linksExternal = false,
    ...l
  }, b) => {
    const m = w(), p = e ? { target: "_blank", rel: "noopener noreferrer" } : {};
    return /* @__PURE__ */ k(
      m,
      {
        ref: b,
        className: i(
          h({ variant: u, size: a, shape: c }),
          "flex items-center no-underline!",
          t
        ),
        href: o,
        to: typeof o == "string" ? o : void 0,
        ...p,
        ...l,
        children: [
          x(d),
          s
        ]
      }
    );
  }
);
N.displayName = "LinkButton";
export {
  y as B,
  N as L,
  R,
  h as b
};
//# sourceMappingURL=button-b1yp3lbrhjr9eg07.js.map
