import "./components/ui/tidal.css"; import { useState } from "react"; import { TidalTransferList, type TidalTransferItem } from "./components/ui/transfer-list"; import "./components/ui/transfer-list.css"; import "./components/ui/checkbox.css"; const tidalExampleStyles = ".tidal-scope .transfer-list-demo {\n display: grid;\n width: 100%;\n max-width: 900px;\n min-width: 0;\n gap: 14px;\n}\n\n.tidal-scope .transfer-list-demo-status {\n min-width: 0;\n min-height: 22px;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n overflow-wrap: anywhere;\n}"; const INITIAL_AVAILABLE: readonly TidalTransferItem[] = [ { id: "kickoff-notes", label: "Kickoff notes", description: "Decisions and open questions from the first review.", }, { id: "research-summary", label: "Research summary", description: "Interview themes and supporting observations.", }, { id: "brand-checklist", label: "Brand checklist", description: "Approved names, marks and editorial rules.", }, { id: "budget-approval", label: "Budget approval", description: "Locked while finance completes its review.", disabled: true, }, ]; const INITIAL_PACKET: readonly TidalTransferItem[] = [ { id: "launch-brief", label: "Launch brief", description: "Audience, rollout sequence and owner notes.", }, { id: "accessibility-audit", label: "Accessibility audit", description: "Keyboard and screen-reader findings.", }, ]; export function TransferListDemo() { const [available, setAvailable] = useState([ ...INITIAL_AVAILABLE, ]); const [packet, setPacket] = useState([ ...INITIAL_PACKET, ]); const [availableSelected, setAvailableSelected] = useState([ "research-summary", ]); const [packetSelected, setPacketSelected] = useState([]); const [status, setStatus] = useState( "Sample records change only in this preview.", ); function move( ids: readonly string[], direction: "to-packet" | "to-available", ) { const source = direction === "to-packet" ? available : packet; const moved = source.filter((item) => ids.includes(item.id)); if (!moved.length) return; if (direction === "to-packet") { setAvailable(source.filter((item) => !ids.includes(item.id))); setPacket((current) => [...current, ...moved]); setAvailableSelected([]); } else { setPacket(source.filter((item) => !ids.includes(item.id))); setAvailable((current) => [...current, ...moved]); setPacketSelected([]); } setStatus( `${moved.length} ${moved.length === 1 ? "record" : "records"} moved ${ direction === "to-packet" ? "into the release packet" : "to available" }. Local sample only.`, ); } return (
setAvailableSelected([...ids])} onDestinationSelectionChange={(ids) => setPacketSelected([...ids])} onMoveToDestination={(ids) => move(ids, "to-packet")} onMoveToSource={(ids) => move(ids, "to-available")} labels={{ moveSelectedToDestination: "Add selected", moveAllToDestination: "Add all", moveSelectedToSource: "Remove selected", moveAllToSource: "Remove all", actions: "Release packet actions", }} /> {status}
); } export default function AgentExample() { return (
); }