import { jsx as o, jsxs as _, Fragment as w } from "react/jsx-runtime";
import { cn as z } from "../../utils/cn.js";
import { Icon as B } from "../icon/icon.js";
const I = {
  lg: 'gap-1 py-1 pl-2.5 pr-2.5 [&_svg]:size-3.5 text-sm tracking-[-0.1px] data-[shape="rounded"]:rounded-[8px]',
  md: 'gap-1 py-0.5 pl-2 pr-2 [&_svg]:size-3.5 text-sm tracking-[-0.1px] data-[shape="rounded"]:rounded-[8px]',
  sm: 'gap-[3px] py-0.5 pl-1.5 pr-1.5 [&_svg]:size-3 text-xs data-[shape="rounded"]:rounded-[6px]',
  xs: 'gap-0.5 py-0 pl-1 pr-1 [&_svg]:size-2.5 text-xs data-[shape="rounded"]:rounded-[4px]'
}, $ = {
  gray: "[--color-bg:#F5F5F5] dark:[--color-bg:#262727] [--color-text:#78787A] dark:[--color-text:#D7D7D7] [--color-bg-disabled:#F5F5F5] dark:[--color-bg-disabled:#262727] [--color-text-disabled:#E9E9EA] dark:[--color-text-disabled:#3C3C3D]",
  blue: "[--color-bg:#E3EAFD] dark:[--color-bg:#07296A] [--color-text:#133A9A] dark:[--color-text:#7196F4] [--color-bg-disabled:#F0F4FE] dark:[--color-bg-disabled:#03153A] [--color-text-disabled:rgba(51,104,240,0.50)] dark:[--color-text-disabled:rgba(51,104,240,0.30)]",
  green: "[--color-bg:#D1FAE4] dark:[--color-bg:#0F4C2C] [--color-text:#166E3F] dark:[--color-text:#6AE1A1] [--color-bg-disabled:#EDFDF4] dark:[--color-bg-disabled:#072213] [--color-text-disabled:rgba(38,189,108,0.50)] dark:[--color-text-disabled:rgba(38,189,108,0.30)]",
  yellow: "[--color-bg:#FEF9C3] dark:[--color-bg:#713F12] [--color-text:#A16207] dark:[--color-text:#FDE047] [--color-bg-disabled:#FEFCE8] dark:[--color-bg-disabled:#422006] [--color-text-disabled:#FEF08A] dark:[--color-text-disabled:#854D0E]",
  orange: "[--color-bg:#FDEAD8] dark:[--color-bg:#613105] [--color-text:#AE590A] dark:[--color-text:#F8B577] [--color-bg-disabled:#FEF4EC] dark:[--color-bg-disabled:#301903] [--color-text-disabled:rgba(244,142,47,0.50)] dark:[--color-text-disabled:rgba(244,142,47,0.30)]",
  red: "[--color-bg:#FCE5E4] dark:[--color-bg:#64120D] [--color-text:#9A1C13] dark:[--color-text:#F08B85] [--color-bg-disabled:#FDF2F1] dark:[--color-bg-disabled:#360A07] [--color-text-disabled:rgba(230,72,61,0.50)] dark:[--color-text-disabled:rgba(230,72,61,0.30)]",
  purple: "[--color-bg:#ECDFFB] dark:[--color-bg:#3A0F71] [--color-text:#5314A3] dark:[--color-text:#B78AF0] [--color-bg-disabled:#ECDFFB] dark:[--color-bg-disabled:#3A0F71] [--color-text-disabled:rgba(135,61,230,0.50)] dark:[--color-text-disabled:rgba(135,61,230,0.30)]",
  white: "[--color-bg:rgba(255,255,255,0.95)] dark:[--color-bg:rgba(255,255,255,0.95)] [--color-text:rgba(11,12,14,0.60)] dark:[--color-text:rgba(11,12,14,0.60)] [--color-bg-disabled:rgba(255,255,255,0.08)] dark:[--color-bg-disabled:rgba(255,255,255,0.24)] [--color-text-disabled:#E9E9EA] dark:[--color-text-disabled:#3C3C3D]",
  surface: "[--color-bg:rgba(255,255,255,0.95)] dark:[--color-bg:#262727] [--color-text:#78787A] dark:[--color-text:#D7D7D7] [--color-bg-disabled:rgba(255,255,255,0.95)] dark:[--color-bg-disabled:#262727] [--color-text-disabled:#E9E9EA] dark:[--color-text-disabled:#3C3C3D]",
  "white-destructive": "[--color-bg:rgba(255,255,255,0.95)] dark:[--color-bg:rgba(255,255,255,0.95)] [--color-text:#E6483D] dark:[--color-text:#E6483D] [--color-bg-disabled:rgba(255,255,255,0.08)] dark:[--color-bg-disabled:rgba(255,255,255,0.24)] [--color-text-disabled:rgba(230,72,61,0.30)] dark:[--color-text-disabled:rgba(230,72,61,0.40)]",
  "surface-destructive": "[--color-bg:rgba(255,255,255,0.95)] dark:[--color-bg:#262727] [--color-text:#E6483D] dark:[--color-text:#E6483D] [--color-bg-disabled:rgba(255,255,255,0.95)] dark:[--color-bg-disabled:#262727] [--color-text-disabled:rgba(230,72,61,0.30)] dark:[--color-text-disabled:rgba(230,72,61,0.40)]"
}, P = ({
  children: s,
  className: n,
  color: g = "gray",
  shape: x = "rounded",
  variant: p,
  stroke: k,
  disabled: r = !1,
  size: u = "md",
  leadIcon: F,
  tailIcon: E,
  icon: m,
  iconType: D,
  iconLibrary: A = "fontawesome",
  onClick: a,
  href: d
}) => {
  const v = p ?? (k ? "outline" : "solid"), f = E ?? m, b = (t, C) => {
    if (!t)
      return null;
    const i = typeof t == "string", h = i ? /* @__PURE__ */ o(
      B,
      {
        className: "shrink-0",
        icon: t,
        iconLibrary: A,
        iconType: D,
        overrideColor: !0,
        overrideSize: !0
      }
    ) : t;
    return /* @__PURE__ */ o(
      "span",
      {
        "data-component-part": `${C}-icon`,
        "data-icon-type": i ? "string" : "inline",
        children: h
      }
    );
  }, y = !!(a || d), e = (
    // biome-ignore lint/style/noNestedTernary: ignore
    d && !r ? "a" : a && !r ? "button" : "span"
  ), l = {
    "data-shape": x,
    "data-variant": v,
    "data-disabled": r || void 0,
    className: z(
      "relative inline-flex w-fit items-center font-medium data-disabled:cursor-not-allowed",
      "data-[shape='pill']:rounded-full",
      "data-[variant='outline']:outline-1 data-[variant='outline']:outline-[rgba(11,12,14,0.08)] data-[variant='outline']:outline-solid data-[variant='outline']:-outline-offset-1 dark:data-[variant='outline']:outline-[rgba(255,255,255,0.14)]",
      "bg-(--color-bg) text-(--color-text) data-disabled:bg-(--color-bg-disabled) data-disabled:text-(--color-text-disabled)",
      '[&_[data-component-part$="-icon"][data-icon-type="string"]_svg]:bg-(--color-text) data-disabled:[&_[data-component-part$="-icon"][data-icon-type="string"]_svg]:bg-(--color-text-disabled)',
      '[&_[data-component-part$="-icon"][data-icon-type="inline"]_svg]:fill-current',
      I[u],
      $[g],
      y && !r && "cursor-pointer transition-opacity hover:opacity-80",
      e === "button" && "border-0",
      n
    )
  }, c = /* @__PURE__ */ _(w, { children: [
    b(F, "lead"),
    s,
    b(f, "tail")
  ] });
  return e === "a" ? /* @__PURE__ */ o("a", { ...l, href: d, onClick: a, children: c }) : e === "button" ? /* @__PURE__ */ o("button", { ...l, onClick: a, type: "button", children: c }) : /* @__PURE__ */ o("span", { ...l, children: c });
};
export {
  P as Badge
};
