"use client";

// 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 { Tooltip as TooltipPrimitive } from "radix-ui";
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/ui/toggle-switch.tsx
import { jsx as jsx4 } from "react/jsx-runtime";
function ToggleSwitch({ checked, onChange, id }) {
  return /* @__PURE__ */ jsx4(
    "button",
    {
      id,
      type: "button",
      role: "switch",
      "aria-checked": checked,
      "aria-label": checked ? "On" : "Off",
      onClick: () => onChange(!checked),
      className: cn(
        "relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-input transition-colors",
        "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
        checked ? "bg-[var(--switch-on)]" : "bg-input"
      ),
      children: /* @__PURE__ */ jsx4("span", { className: cn(
        "pointer-events-none inline-block size-4 rounded-full bg-primary-foreground shadow-sm transition-transform",
        checked ? "translate-x-4" : "translate-x-0"
      ) })
    }
  );
}

// src/components/table-properties/column-row.tsx
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
function ColumnRow({
  label,
  isFirst,
  isLast,
  visible,
  onToggleVisible,
  onMoveUp,
  onMoveDown,
  draggable,
  onDragStart,
  onDragOver,
  onDrop,
  onDragEnd,
  isDragging,
  isOver
}) {
  return /* @__PURE__ */ jsxs3(
    "li",
    {
      draggable,
      onDragStart,
      onDragOver,
      onDrop,
      onDragEnd,
      className: cn(
        "flex items-center gap-2 p-2 rounded-lg group hover:bg-interactive-hover-subtle transition-colors cursor-grab active:cursor-grabbing",
        isDragging && "opacity-40",
        isOver && "ring-2 ring-ring bg-accent/30"
      ),
      children: [
        /* @__PURE__ */ jsx5(DragHandleGripIcon, { className: "text-[13px] text-muted-foreground/40 transition-colors group-hover:text-muted-foreground" }),
        /* @__PURE__ */ jsx5("span", { className: "flex-1 text-sm text-foreground", children: label }),
        /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity", children: [
          /* @__PURE__ */ jsx5(Tip, { label: `Move ${label} up`, side: "top", children: /* @__PURE__ */ jsx5(
            "button",
            {
              type: "button",
              "aria-label": `Move ${label} up`,
              disabled: isFirst,
              onClick: onMoveUp,
              className: "inline-flex items-center justify-center size-6 rounded text-muted-foreground hover:text-interactive-hover-foreground hover:bg-interactive-hover disabled:opacity-30 disabled:pointer-events-none transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
              children: /* @__PURE__ */ jsx5("i", { className: "fa-light fa-chevron-up text-xs", "aria-hidden": "true" })
            }
          ) }),
          /* @__PURE__ */ jsx5(Tip, { label: `Move ${label} down`, side: "top", children: /* @__PURE__ */ jsx5(
            "button",
            {
              type: "button",
              "aria-label": `Move ${label} down`,
              disabled: isLast,
              onClick: onMoveDown,
              className: "inline-flex items-center justify-center size-6 rounded text-muted-foreground hover:text-interactive-hover-foreground hover:bg-interactive-hover disabled:opacity-30 disabled:pointer-events-none transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
              children: /* @__PURE__ */ jsx5("i", { className: "fa-light fa-chevron-down text-xs", "aria-hidden": "true" })
            }
          ) })
        ] }),
        /* @__PURE__ */ jsx5(
          ToggleSwitch,
          {
            checked: visible,
            onChange: onToggleVisible
          }
        )
      ]
    }
  );
}
export {
  ColumnRow
};
//# sourceMappingURL=column-row.js.map