"use client";

// src/components/ui/tooltip.tsx
import { Tooltip as TooltipPrimitive } from "radix-ui";

// src/lib/utils.ts
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
function cn(...inputs) {
  return twMerge(clsx(inputs));
}

// src/components/ui/tooltip.tsx
import { jsx, jsxs } from "react/jsx-runtime";
function Tooltip({
  ...props
}) {
  return /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
}
function TooltipTrigger({
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    TooltipPrimitive.Trigger,
    {
      "data-slot": "tooltip-trigger",
      suppressHydrationWarning: true,
      className: cn("cursor-pointer", className),
      ...props
    }
  );
}
function TooltipContent({
  className,
  sideOffset = 0,
  children,
  ...props
}) {
  return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
    TooltipPrimitive.Content,
    {
      "data-slot": "tooltip-content",
      sideOffset,
      className: cn(
        "z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
        className
      ),
      ...props,
      children: [
        children,
        /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })
      ]
    }
  ) });
}

// src/components/ui/tip.tsx
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
function Tip({ label, children, side = "top" }) {
  return /* @__PURE__ */ jsxs2(Tooltip, { children: [
    /* @__PURE__ */ jsx2(TooltipTrigger, { asChild: true, children }),
    /* @__PURE__ */ jsx2(TooltipContent, { side, className: "flex flex-wrap items-center gap-1.5", children: label })
  ] });
}

// src/components/ui/drag-handle-grip.tsx
import { jsx as jsx3 } from "react/jsx-runtime";
function DragHandleGripIcon({ className }) {
  return /* @__PURE__ */ jsx3("i", { className: cn("fa-solid fa-grip-dots-vertical shrink-0", className), "aria-hidden": "true" });
}

// src/components/table-properties/sort-card.tsx
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
function DrawerSortCard(props) {
  const { rule, fieldLabel, isPrimary, onRemove, onToggleDir } = props;
  const label = fieldLabel || rule.fieldKey;
  if (!label) return null;
  return /* @__PURE__ */ jsx4("div", { className: "rounded-lg border border-border bg-background overflow-hidden", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 px-3 py-2.5", children: [
    /* @__PURE__ */ jsx4(DragHandleGripIcon, { className: "text-[13px] text-muted-foreground/40" }),
    /* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0", children: [
      /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1.5", children: [
        isPrimary && /* @__PURE__ */ jsx4("span", { className: "text-xs font-bold text-accent-foreground bg-accent rounded px-1 py-0.5 leading-none uppercase tracking-wide shrink-0", children: "Primary" }),
        /* @__PURE__ */ jsx4("p", { className: "text-sm font-medium text-foreground truncate", children: label })
      ] }),
      /* @__PURE__ */ jsxs3(
        "button",
        {
          type: "button",
          "aria-label": `Direction: ${rule.direction === "asc" ? "Ascending" : "Descending"} \u2014 click to toggle`,
          onClick: onToggleDir,
          className: "inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-interactive-hover-foreground transition-colors mt-0.5",
          children: [
            /* @__PURE__ */ jsx4("i", { className: `fa-light ${rule.direction === "asc" ? "fa-arrow-up-a-z" : "fa-arrow-down-a-z"} text-xs`, "aria-hidden": "true" }),
            rule.direction === "asc" ? "Ascending" : "Descending",
            /* @__PURE__ */ jsx4("i", { className: "fa-light fa-chevron-down text-xs", "aria-hidden": "true" })
          ]
        }
      )
    ] }),
    /* @__PURE__ */ jsx4(Tip, { label: `Remove ${label} sort`, side: "top", children: /* @__PURE__ */ jsx4(
      "button",
      {
        type: "button",
        "aria-label": `Remove ${label} sort`,
        onClick: onRemove,
        className: "inline-flex items-center justify-center size-7 rounded text-muted-foreground hover:text-destructive hover:bg-interactive-hover transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring shrink-0",
        children: /* @__PURE__ */ jsx4("i", { className: "fa-light fa-trash text-xs", "aria-hidden": "true" })
      }
    ) })
  ] }) });
}
export {
  DrawerSortCard
};
//# sourceMappingURL=sort-card.js.map