"use client";

// src/components/ui/resizable.tsx
import { GripVertical } from "lucide-react";
import { Group, Panel, Separator } from "react-resizable-panels";

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

// src/components/ui/resizable.tsx
import { jsx } from "react/jsx-runtime";
function ResizablePanelGroup({
  direction = "horizontal",
  className,
  ...props
}) {
  return /* @__PURE__ */ jsx(
    Group,
    {
      orientation: direction,
      className: cn(
        "flex size-full",
        direction === "vertical" && "flex-col",
        className
      ),
      ...props
    }
  );
}
var ResizablePanel = Panel;
function ResizableHandle({ withHandle, className, ...props }) {
  return /* @__PURE__ */ jsx(
    Separator,
    {
      className: cn(
        // Base — horizontal handle (between side-by-side panels)
        "relative flex w-1 shrink-0 cursor-col-resize items-center justify-center bg-border/60",
        "transition-colors hover:bg-border active:bg-primary/30",
        "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
        // Vertical handle (between stacked panels)
        "data-[orientation=vertical]:h-1 data-[orientation=vertical]:w-full data-[orientation=vertical]:cursor-row-resize data-[orientation=vertical]:flex-row",
        className
      ),
      ...props,
      children: withHandle && /* @__PURE__ */ jsx("div", { className: "z-10 flex h-5 w-3.5 items-center justify-center rounded-sm border border-border bg-background shadow-sm", children: /* @__PURE__ */ jsx(GripVertical, { className: "size-3 text-muted-foreground" }) })
    }
  );
}

// src/components/ui/list-page-view-frame.tsx
import { jsx as jsx2 } from "react/jsx-runtime";
var LIST_PAGE_VIEW_FRAME_GUTTER = "mx-4 mb-6 lg:mx-6";
var LIST_PAGE_VIEW_FRAME_MAX_WIDE = "max-w-7xl";
function ListPageViewFrame({
  children,
  className,
  maxWidthClassName,
  gutterClassName = LIST_PAGE_VIEW_FRAME_GUTTER,
  ...rest
}) {
  return /* @__PURE__ */ jsx2("div", { className: cn(gutterClassName, className), ...rest, children: maxWidthClassName ? /* @__PURE__ */ jsx2("div", { className: cn("mx-auto w-full min-w-0", maxWidthClassName), children }) : children });
}

// src/components/data-views/list-page-split-hub-chrome.tsx
import { jsx as jsx3 } from "react/jsx-runtime";
var LIST_PAGE_SPLIT_HUB_HEIGHT_STYLE = {
  height: "calc(100vh - 280px)",
  minHeight: 420
};
var SURFACE_CLASS = "flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border bg-card";
function ListPageSplitHubChrome({
  children,
  "aria-label": ariaLabel,
  gutterClassName = LIST_PAGE_VIEW_FRAME_GUTTER,
  maxWidthClassName = LIST_PAGE_VIEW_FRAME_MAX_WIDE,
  surfaceStyle,
  surfaceClassName
}) {
  return /* @__PURE__ */ jsx3(
    ListPageViewFrame,
    {
      gutterClassName,
      maxWidthClassName,
      className: "flex min-h-0 flex-1 flex-col",
      children: /* @__PURE__ */ jsx3(
        "div",
        {
          className: cn(SURFACE_CLASS, surfaceClassName),
          style: { ...LIST_PAGE_SPLIT_HUB_HEIGHT_STYLE, ...surfaceStyle },
          "aria-label": ariaLabel,
          children
        }
      )
    }
  );
}

// src/components/data-views/list-page-split-hub-tokens.ts
var LIST_PAGE_SPLIT_RESIZABLE_HANDLE_CLASS = "w-1 bg-border/40 hover:bg-brand/20 transition-colors";
var LIST_PAGE_SPLIT_MILLER_COLUMN_PANEL_CLASS = "flex min-h-0 min-w-0 flex-col bg-card";
var LIST_PAGE_SPLIT_MILLER_DETAIL_PANEL_CLASS = "flex min-h-0 min-w-0 flex-col bg-card";

// src/components/data-views/list-page-tree-panel-shell.tsx
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
function ListPageTreePanelShell({
  resizableGroupId,
  tree,
  details,
  ariaLabel,
  treePanelId = "tree",
  detailsPanelId = "details",
  treeDefaultSize = "40%",
  treeMinSize = "20%",
  treeMaxSize = "60%",
  detailsDefaultSize = "60%",
  detailsMinSize = "30%",
  gutterClassName = LIST_PAGE_VIEW_FRAME_GUTTER,
  maxWidthClassName = LIST_PAGE_VIEW_FRAME_MAX_WIDE
}) {
  return /* @__PURE__ */ jsx4(
    ListPageSplitHubChrome,
    {
      "aria-label": ariaLabel,
      gutterClassName,
      maxWidthClassName,
      children: /* @__PURE__ */ jsxs(ResizablePanelGroup, { id: resizableGroupId, direction: "horizontal", className: "h-full min-h-0 w-full flex-1", children: [
        /* @__PURE__ */ jsx4(
          ResizablePanel,
          {
            id: treePanelId,
            defaultSize: treeDefaultSize,
            minSize: treeMinSize,
            maxSize: treeMaxSize,
            className: LIST_PAGE_SPLIT_MILLER_COLUMN_PANEL_CLASS,
            children: tree
          }
        ),
        /* @__PURE__ */ jsx4(ResizableHandle, { withHandle: true, className: LIST_PAGE_SPLIT_RESIZABLE_HANDLE_CLASS }),
        /* @__PURE__ */ jsx4(
          ResizablePanel,
          {
            id: detailsPanelId,
            defaultSize: detailsDefaultSize,
            minSize: detailsMinSize,
            className: LIST_PAGE_SPLIT_MILLER_DETAIL_PANEL_CLASS,
            children: details
          }
        )
      ] })
    }
  );
}
export {
  ListPageTreePanelShell
};
//# sourceMappingURL=list-page-tree-panel-shell.js.map