"use client";
import * as React from "react";
import { Badge } from "@/components/ui/badge";
import { Input } from "@/components/ui/input";
import { SettingsFormRow } from "@/components/settings-form-row";
import { DotPattern } from "@exxatdesignux/ui/components/ui/dot-pattern";
import { DragHandleGripIcon } from "@exxatdesignux/ui/components/ui/drag-handle-grip";
import {
HorizontalScrollControls,
HorizontalScrollViewport,
useHorizontalScrollAffordances,
} from "@exxatdesignux/ui/components/ui/horizontal-scroll-controls";
import { HorizontalScrollRegion } from "@exxatdesignux/ui/components/ui/horizontal-scroll-region";
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@exxatdesignux/ui/components/ui/resizable";
import { NestedSecondaryPanelShell } from "@exxatdesignux/ui/components/templates/nested-secondary-panel-shell";
import { cn } from "@/lib/utils";
const CHIPS = [
"Placements", "Students", "Preceptors", "Compliance", "Sites",
"Cohorts", "Evaluations", "Timesheets", "Case logs", "Documents",
];
/* ── dot-pattern ─────────────────────────────────────────────────────── */
export function DotPatternPreview() {
return (
Decorative background, content stays on top
);
}
/* ── drag-handle-grip ────────────────────────────────────────────────── */
export function DragHandleGripPreview() {
const [items, setItems] = React.useState(["Overview", "Placements", "Compliance"]);
const move = (i: number, dir: -1 | 1) =>
setItems((prev) => {
const next = [...prev];
const j = i + dir;
if (j < 0 || j >= next.length) return prev;
[next[i], next[j]] = [next[j], next[i]];
return next;
});
return (
{items.map((label, i) => (
- {
if (e.altKey && e.key === "ArrowUp") { e.preventDefault(); move(i, -1); }
if (e.altKey && e.key === "ArrowDown") { e.preventDefault(); move(i, 1); }
}}
className="flex items-center gap-2 rounded-md border border-border bg-surface-1 px-2 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
>
{label}
))}
- Focus a row, then Alt + Arrow to reorder.
);
}
/* ── horizontal-scroll-controls ──────────────────────────────────────── */
export function HorizontalScrollControlsPreview() {
const ref = React.useRef(null);
const a = useHorizontalScrollAffordances(ref);
return (
{CHIPS.map((c) => (
{c}
))}
{a.overflowing ? (
) : null}
);
}
/* ── horizontal-scroll-region ────────────────────────────────────────── */
export function HorizontalScrollRegionPreview() {
return (
{CHIPS.map((c, i) => (
{c}
))}
{["Library", "Questions", "Clinical skills", "Wound care", "Dressing change"].map((c) => (
{c} /
))}
);
}
/* ── resizable ───────────────────────────────────────────────────────── */
export function ResizablePreview() {
return (
Scope rail
Drag the handle, or focus it and use arrow keys.
);
}
/* ── nested-secondary-panel-shell ────────────────────────────────────── */
function RailItems({ compact }: { compact: boolean }) {
const rows = [
{ icon: "fa-list", label: "All questions" },
{ icon: "fa-star", label: "Favorites" },
{ icon: "fa-folder", label: "Clinical skills" },
];
return (
{rows.map((r, i) => (
-
{compact ? {r.label} : r.label}
))}
);
}
export function NestedSecondaryPanelShellPreview() {
const [compact, setCompact] = React.useState(false);
return (
Hub content. Drag the rail edge to resize.
);
}
/* ── secondary-hub-nav-primitives (schematic: needs router + sidebar) ── */
export function SecondaryHubNavPrimitivesPreview() {
const rows = [
{ icon: "fa-list", label: "All questions", active: true },
{ icon: "fa-star", label: "Favorites" },
{ icon: "fa-folder", label: "Clinical skills" },
];
return (
);
}
/* ── secondary-panel-hub-template (schematic: needs router + shell) ──── */
export function SecondaryPanelHubTemplatePreview() {
return (
Secondary panel
useAutoPanel keeps it open across child routes.
SiteHeader
PageHeader
Bridges, then PrimaryPageTemplate body (toolbar, table, views)
);
}
/* ── settings-form-row ───────────────────────────────────────────────── */
export function SettingsFormRowPreview() {
return (
);
}
/* ── site-header (schematic: needs router, shell, utility-bar contexts) ─ */
export function SiteHeaderPreview() {
return (
trailing slot
);
}