import type { ComponentProps, ReactNode } from "react";
import { cn } from "../lib/cn";
/**
* Width-, height-, and overflow-safe page frame for workspace content surfaces.
*
* Scroll ownership and column width are deliberately split:
* - Outer (`data-slot="content-page"`) is the full-width flex child that owns
* vertical scroll + overscroll containment inside the fixed app canvas.
* - Inner (`data-slot="content-page-inner"`) is the centered max-width column.
*
* Putting `overflow-y-auto` on the max-width box itself left gutters outside
* the scrollport; wheel there scrolled the document and shoved the whole app
* up (empty band + floating DevTools). Never merge those two again.
*
* The `min-w-0` chain is intentional: pages live inside a flex shell and must
* be allowed to shrink before a long untrusted name can widen the viewport.
*/
export function ContentPage({
className,
width = "wide",
children,
...props
}: ComponentProps<"div"> & { width?: "standard" | "wide" }) {
return (
{children}
);
}
/** A bordered content region with consistent density and no implicit width. */
export function ContentSurface({ className, ...props }: ComponentProps<"section">) {
return (
);
}
/** Compact title/description/action row used inside content surfaces. */
export function ContentSurfaceHeader({
title,
description,
actions,
className,
}: {
title: ReactNode;
description?: ReactNode | undefined;
actions?: ReactNode | undefined;
className?: string | undefined;
}) {
return (
{title}
{description ? (
{description}
) : null}
{actions ? (
{actions}
) : null}
);
}
/** Responsive form layout: one column first, opt-in columns as space permits. */
export function FormGrid({
className,
columns = "two",
...props
}: ComponentProps<"div"> & { columns?: "two" | "three" }) {
return (
);
}
/** Accessible form-field stack shared by native and custom form controls. */
export function FormField({
label,
hint,
className,
children,
...props
}: Omit, "children"> & {
label: ReactNode;
hint?: ReactNode | undefined;
children: ReactNode;
}) {
return (
);
}
/**
* Contained horizontal overflow for genuinely tabular or wide data.
* This is the only element that scrolls; it never widens the page itself.
*/
export function DataScroller({ className, ...props }: ComponentProps<"div">) {
return (
);
}