import "./components/ui/tidal.css"; import { useState } from "react"; import { LayoutGrid, Folder, Activity, Settings2, ArrowUpRight, ArrowDownLeft, Layers } from "lucide-react"; import { TidalSidebar, TidalSidebarAction, TidalSidebarGroup } from "./components/ui/sidebar"; import "./components/ui/sidebar.css"; function tidalExampleAvatarDataUri(seed: unknown) { const text = String(seed).replace(/[^a-z0-9]/gi, "").slice(-2) || "UI"; const palette = ["#333333", "#555555", "#777777", "#999999", "#bbbbbb"]; const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length]; const svg = ``; return `data:image/svg+xml,${encodeURIComponent(svg)}`; } function tidalExampleImageDataUri(label: string) { const safeLabel = label.replace(/[<>&]/g, "").slice(0, 28) || "Sample image"; const svg = `${safeLabel}`; return `data:image/svg+xml,${encodeURIComponent(svg)}`; } const tidalExampleStyles = ".tidal-scope .sidebar-specimen{width:100%;max-width:960px;box-shadow:0 24px 46px -32px #00000033;border-radius:var(--t-radius-card)}.tidal-scope .sidebar-demo-header{display:flex;justify-content:space-between;gap:12px;min-height:64px;align-items:center;padding:15px 24px;border-bottom:1px solid var(--t-border);font-size:11px;color:var(--t-muted)}.tidal-scope .sidebar-demo-header>span:last-child{font-size:11px;border:1px solid var(--t-border);border-radius:5px;padding:3px 6px}.tidal-scope .sidebar-demo-body{padding:28px;min-width:0}.tidal-scope .sidebar-demo-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:25px}.tidal-scope .sidebar-demo-title p{margin:0 0 5px;font-size:11px;letter-spacing:1px;color:var(--t-muted)}.tidal-scope .sidebar-demo-title h3{font-size:27px;font-weight:500;letter-spacing:-1px;line-height:1.2;margin:0}.tidal-scope .sidebar-demo-view-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;border:1px solid var(--t-border);color:var(--t-muted)}.tidal-scope .sidebar-demo-summary{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:25px}.tidal-scope .sidebar-demo-summary>span{display:flex;flex-direction:column;font-size:11px;color:var(--t-muted);gap:4px;border-top:1px solid var(--t-border);padding-top:15px}.tidal-scope .sidebar-demo-summary strong{font-size:30px;line-height:1.2;font-weight:400;color:var(--t-ink);letter-spacing:-1px}.tidal-scope .sidebar-demo-projects>header{display:flex;justify-content:space-between;font-size:11px;color:var(--t-muted);padding-bottom:8px}.tidal-scope .sidebar-demo-project{display:flex;align-items:center;gap:10px;min-width:0;padding:14px 0;border-top:1px solid var(--t-border)}.tidal-scope .sidebar-demo-project-icon{display:grid;place-items:center;width:33px;height:35px;flex:none;border:1px solid var(--t-border);border-radius:8px;background:var(--t-subtle);color:var(--t-muted)}.tidal-scope .sidebar-demo-project>span:nth-child(2){display:flex;flex-direction:column;flex:1;min-width:0;gap:3px}.tidal-scope .sidebar-demo-project strong{font-weight:500;font-size:11px;overflow-wrap:anywhere}.tidal-scope .sidebar-demo-project small{font-size:11px;color:var(--t-muted)}.tidal-scope .sidebar-demo-project-meter{display:flex;flex-direction:column;gap:5px;text-align:end;flex:none;width:52px;font-size:11px;font-variant-numeric:tabular-nums;color:var(--t-muted)}.tidal-scope .sidebar-demo-project-meter>i{height:3px;background:var(--t-wash);border-radius:3px;overflow:hidden}.tidal-scope .sidebar-demo-project-meter>i>i{display:block;height:100%;border-radius:inherit;background:var(--t-ink);transform-origin:left}.tidal-scope .sidebar-demo-note{font-size:11px;line-height:1.6;color:var(--t-muted);margin:20px 0 0}.tidal-scope .sidebar-demo-activity{list-style:none;margin:0;padding:0}.tidal-scope .sidebar-demo-activity>li{display:flex;gap:12px;padding:15px 0;border-top:1px solid var(--t-border);align-items:start}.tidal-scope .sidebar-demo-activity>li>span{font-size:11px;color:var(--t-muted)}.tidal-scope .sidebar-demo-activity p{margin:0;font-size:11px;overflow-wrap:anywhere}.tidal-scope .sidebar-demo-activity small{display:block;margin-top:4px;font-size:11px;color:var(--t-muted)}.tidal-scope .sidebar-demo-settings p{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;padding:14px 0;margin:0;border-bottom:1px solid var(--t-border);font-size:11px}.tidal-scope .sidebar-demo-settings strong{font-weight:500}.tidal-scope .sidebar-demo-settings span{color:var(--t-muted)}.tidal-scope .sidebar-demo-profile{padding:20px 0}.tidal-scope .sidebar-demo-profile img{width:64px;height:64px;border-radius:16px}.tidal-scope .sidebar-demo-profile h4{font-size:18px;font-weight:500;margin:12px 0 4px}.tidal-scope .sidebar-demo-profile p{font-size:11px;color:var(--t-muted);margin:0}\n@keyframes sidebar-demo-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}@keyframes sidebar-demo-bar{from{transform:scaleX(0)}to{transform:scaleX(1)}}@media(prefers-reduced-motion:no-preference){.tidal-scope .sidebar-demo-title{animation:sidebar-demo-in 380ms var(--t-ease-out) both}.tidal-scope .sidebar-demo-summary{animation:sidebar-demo-in 420ms var(--t-ease-out) 50ms both}.tidal-scope .sidebar-demo-project{animation:sidebar-demo-in 420ms var(--t-ease-out) both}.tidal-scope .sidebar-demo-project:nth-child(2){animation-delay:90ms}.tidal-scope .sidebar-demo-project:nth-child(3){animation-delay:145ms}.tidal-scope .sidebar-demo-project:nth-child(4){animation-delay:200ms}.tidal-scope .sidebar-demo-project-meter>i>i{animation:sidebar-demo-bar 650ms var(--t-ease-out) 180ms both}}"; const views = [{label:"Overview",icon:LayoutGrid},{label:"Projects",icon:Folder},{label:"Activity",icon:Activity},{label:"Settings",icon:Settings2}]; const projects = [{name:"Website",detail:"Design review",progress:72},{name:"Mobile app",detail:"In development",progress:48},{name:"Brand assets",detail:"Ready to share",progress:100}]; export function SidebarDemo(){ const [view,setView]=useState("Overview"); return
} navigation={<>{views.slice(0,3).map(({label,icon:Icon})=>} badge={label==="Projects"?3:undefined} active={view===label} onClick={()=>setView(label)}/>)}} active={view==="Settings"} onClick={()=>setView("Settings")}/>} disabled/>} footer={} active={view==="Profile"} onClick={()=>setView("Profile")}/> }>
WorkspaceLocal sample

WORKSPACE

{view}

{view==="Overview"||view==="Projects"?<>
3Active projects1Ready for review
ProjectsProgress
{projects.map(p=>
{p.name}{p.detail}{p.progress}%