"use client" import * as React from "react" import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { TablePropertiesDrawer } from "@/components/table-properties" import type { ActiveFilter, FilterFieldDef, SortRule, } from "@/components/table-properties/types" import { Tip } from "@/components/ui/tip" import { FloatingSheetPanel, FloatingSheetPanelBody, FloatingSheetPanelContent, FloatingSheetPanelHeader, FloatingSheetPanelToolbar, FloatingSheetPanelWorkflowFooter, type FloatingSheetSize, } from "@/lib/floating-sheet-panel" function Copy({ children }: { children: React.ReactNode }) { return

{children}

} /** Enough content to push the body into scroll, so the header border shows. */ function LongCopy() { return (
{Array.from({ length: 28 }, (_, index) => (

Row {index + 1}. Scroll this body and the header grows a bottom border, so the title stays separated from the content moving under it.

))}
) } function OpenButton({ onClick, children }: { onClick: () => void; children: React.ReactNode }) { return ( ) } /** Toolbar, header, scrolling body, and workflow footer in one rail. */ export function FloatingSheetAnatomyPreview() { const [open, setOpen] = React.useState(false) return (
setOpen(true)}>Open rail setOpen(false)} primaryLabel="Export" onPrimary={() => setOpen(false)} />
) } const SIZES = [ { size: "sm", label: "Small", width: "24rem" }, { size: "md", label: "Medium", width: "32rem" }, { size: "lg", label: "Large", width: "40rem" }, ] as const satisfies readonly { size: FloatingSheetSize; label: string; width: string }[] export function FloatingSheetSizePreview() { const [open, setOpen] = React.useState(null) const active = SIZES.find(preset => preset.size === open) return (
{SIZES.map(preset => ( setOpen(preset.size)}> {preset.label} {preset.width} ))} { if (!next) setOpen(null) }} > Change the size from the toolbar menu, or drag the inner edge for a width in between. Either choice is remembered for this rail.
) } const RECORDS = ["Avery Chen", "Jordan Lee", "Sam Rivera", "Priya Nair"] /** Record stepping plus a filled right-hand actions cluster. */ export function FloatingSheetToolbarPreview() { const [open, setOpen] = React.useState(false) const [index, setIndex] = React.useState(0) const [starred, setStarred] = React.useState(false) return (
setOpen(true)}>Open record 0 ? () => setIndex(n => n - 1) : undefined} onNext={index < RECORDS.length - 1 ? () => setIndex(n => n + 1) : undefined} previousLabel="Previous student" nextLabel="Next student" actions={ <>