{"name":"sidebar-09","description":"Collapsible nested sidebars.","registryDependencies":["@herocn/sidebar","@herocn/breadcrumb","@herocn/separator","@herocn/collapsible","@herocn/dropdown-menu","@herocn/avatar","@herocn/switch","@herocn/label"],"files":[{"path":"page.tsx","content":"import { AppSidebar } from \"@/components/app-sidebar\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbPage,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { Separator } from \"@/components/ui/separator\";\nimport {\n\tSidebarInset,\n\tSidebarProvider,\n\tSidebarTrigger,\n} from \"@/components/ui/sidebar\";\n\nexport default function Page() {\n\treturn (\n\t\t<SidebarProvider\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t\"--sidebar-width\": \"350px\",\n\t\t\t\t} as React.CSSProperties\n\t\t\t}\n\t\t>\n\t\t\t<AppSidebar />\n\t\t\t<SidebarInset>\n\t\t\t\t<header className=\"sticky top-0 flex shrink-0 items-center gap-2 border-b bg-background p-4\">\n\t\t\t\t\t<SidebarTrigger className=\"-ml-1\" />\n\t\t\t\t\t<Separator\n\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\tclassName=\"mr-2 data-vertical:h-4 data-vertical:self-auto\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Breadcrumb>\n\t\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t\t<BreadcrumbItem className=\"hidden md:block\">\n\t\t\t\t\t\t\t\t<BreadcrumbLink href=\"#\">All Inboxes</BreadcrumbLink>\n\t\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbSeparator className=\"hidden md:block\" />\n\t\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t\t<BreadcrumbPage>Inbox</BreadcrumbPage>\n\t\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t\t</Breadcrumb>\n\t\t\t\t</header>\n\t\t\t\t<div className=\"flex flex-1 flex-col gap-4 p-4\">\n\t\t\t\t\t{Array.from({ length: 24 }).map((_, index) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\tclassName=\"aspect-video h-12 w-full rounded-lg bg-muted/50\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</SidebarInset>\n\t\t</SidebarProvider>\n\t);\n}\n","type":"registry:page","target":"app/dashboard/page.tsx"},{"path":"components/app-sidebar.tsx","content":"\"use client\";\n\nimport {\n\tArchiveXIcon,\n\tFileIcon,\n\tInboxIcon,\n\tSendIcon,\n\tTerminalIcon,\n\tTrash2Icon,\n} from \"lucide-react\";\n\nimport * as React from \"react\";\n\nimport { NavUser } from \"@/components/nav-user\";\nimport { Label } from \"@/components/ui/label\";\nimport {\n\tSidebar,\n\tSidebarContent,\n\tSidebarFooter,\n\tSidebarGroup,\n\tSidebarGroupContent,\n\tSidebarHeader,\n\tSidebarInput,\n\tSidebarMenu,\n\tSidebarMenuButton,\n\tSidebarMenuItem,\n\tuseSidebar,\n} from \"@/components/ui/sidebar\";\nimport { Switch } from \"@/components/ui/switch\";\n\n// This is sample data\nconst data = {\n\tuser: {\n\t\tname: \"Maqed\",\n\t\temail: \"maqed@example.com\",\n\t\tavatar: \"https://github.com/maqed.png\",\n\t},\n\tnavMain: [\n\t\t{\n\t\t\ttitle: \"Inbox\",\n\t\t\turl: \"#\",\n\t\t\ticon: <InboxIcon />,\n\t\t\tisActive: true,\n\t\t},\n\t\t{\n\t\t\ttitle: \"Drafts\",\n\t\t\turl: \"#\",\n\t\t\ticon: <FileIcon />,\n\t\t\tisActive: false,\n\t\t},\n\t\t{\n\t\t\ttitle: \"Sent\",\n\t\t\turl: \"#\",\n\t\t\ticon: <SendIcon />,\n\t\t\tisActive: false,\n\t\t},\n\t\t{\n\t\t\ttitle: \"Junk\",\n\t\t\turl: \"#\",\n\t\t\ticon: <ArchiveXIcon />,\n\t\t\tisActive: false,\n\t\t},\n\t\t{\n\t\t\ttitle: \"Trash\",\n\t\t\turl: \"#\",\n\t\t\ticon: <Trash2Icon />,\n\t\t\tisActive: false,\n\t\t},\n\t],\n\tmails: [\n\t\t{\n\t\t\tname: \"William Smith\",\n\t\t\temail: \"williamsmith@example.com\",\n\t\t\tsubject: \"Meeting Tomorrow\",\n\t\t\tdate: \"09:34 AM\",\n\t\t\tteaser:\n\t\t\t\t\"Hi team, just a reminder about our meeting tomorrow at 10 AM.\\nPlease come prepared with your project updates.\",\n\t\t},\n\t\t{\n\t\t\tname: \"Alice Smith\",\n\t\t\temail: \"alicesmith@example.com\",\n\t\t\tsubject: \"Re: Project Update\",\n\t\t\tdate: \"Yesterday\",\n\t\t\tteaser:\n\t\t\t\t\"Thanks for the update. The progress looks great so far.\\nLet's schedule a call to discuss the next steps.\",\n\t\t},\n\t\t{\n\t\t\tname: \"Bob Johnson\",\n\t\t\temail: \"bobjohnson@example.com\",\n\t\t\tsubject: \"Weekend Plans\",\n\t\t\tdate: \"2 days ago\",\n\t\t\tteaser:\n\t\t\t\t\"Hey everyone! I'm thinking of organizing a team outing this weekend.\\nWould you be interested in a hiking trip or a beach day?\",\n\t\t},\n\t\t{\n\t\t\tname: \"Emily Davis\",\n\t\t\temail: \"emilydavis@example.com\",\n\t\t\tsubject: \"Re: Question about Budget\",\n\t\t\tdate: \"2 days ago\",\n\t\t\tteaser:\n\t\t\t\t\"I've reviewed the budget numbers you sent over.\\nCan we set up a quick call to discuss some potential adjustments?\",\n\t\t},\n\t\t{\n\t\t\tname: \"Michael Wilson\",\n\t\t\temail: \"michaelwilson@example.com\",\n\t\t\tsubject: \"Important Announcement\",\n\t\t\tdate: \"1 week ago\",\n\t\t\tteaser:\n\t\t\t\t\"Please join us for an all-hands meeting this Friday at 3 PM.\\nWe have some exciting news to share about the company's future.\",\n\t\t},\n\t\t{\n\t\t\tname: \"Sarah Brown\",\n\t\t\temail: \"sarahbrown@example.com\",\n\t\t\tsubject: \"Re: Feedback on Proposal\",\n\t\t\tdate: \"1 week ago\",\n\t\t\tteaser:\n\t\t\t\t\"Thank you for sending over the proposal. I've reviewed it and have some thoughts.\\nCould we schedule a meeting to discuss my feedback in detail?\",\n\t\t},\n\t\t{\n\t\t\tname: \"David Lee\",\n\t\t\temail: \"davidlee@example.com\",\n\t\t\tsubject: \"New Project Idea\",\n\t\t\tdate: \"1 week ago\",\n\t\t\tteaser:\n\t\t\t\t\"I've been brainstorming and came up with an interesting project concept.\\nDo you have time this week to discuss its potential impact and feasibility?\",\n\t\t},\n\t\t{\n\t\t\tname: \"Olivia Wilson\",\n\t\t\temail: \"oliviawilson@example.com\",\n\t\t\tsubject: \"Vacation Plans\",\n\t\t\tdate: \"1 week ago\",\n\t\t\tteaser:\n\t\t\t\t\"Just a heads up that I'll be taking a two-week vacation next month.\\nI'll make sure all my projects are up to date before I leave.\",\n\t\t},\n\t\t{\n\t\t\tname: \"James Martin\",\n\t\t\temail: \"jamesmartin@example.com\",\n\t\t\tsubject: \"Re: Conference Registration\",\n\t\t\tdate: \"1 week ago\",\n\t\t\tteaser:\n\t\t\t\t\"I've completed the registration for the upcoming tech conference.\\nLet me know if you need any additional information from my end.\",\n\t\t},\n\t\t{\n\t\t\tname: \"Sophia White\",\n\t\t\temail: \"sophiawhite@example.com\",\n\t\t\tsubject: \"Team Dinner\",\n\t\t\tdate: \"1 week ago\",\n\t\t\tteaser:\n\t\t\t\t\"To celebrate our recent project success, I'd like to organize a team dinner.\\nAre you available next Friday evening? Please let me know your preferences.\",\n\t\t},\n\t],\n};\nexport function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {\n\t// Note: I'm using state to show active item.\n\t// IRL you should use the url/router.\n\tconst [activeItem, setActiveItem] = React.useState(data.navMain[0]);\n\tconst [mails, setMails] = React.useState(data.mails);\n\tconst { setOpen } = useSidebar();\n\treturn (\n\t\t<Sidebar\n\t\t\tcollapsible=\"icon\"\n\t\t\tclassName=\"overflow-hidden *:data-[sidebar=sidebar]:flex-row\"\n\t\t\t{...props}\n\t\t>\n\t\t\t{/* This is the first sidebar */}\n\t\t\t{/* We disable collapsible and adjust width to icon. */}\n\t\t\t{/* This will make the sidebar appear as icons. */}\n\t\t\t<Sidebar\n\t\t\t\tcollapsible=\"none\"\n\t\t\t\tclassName=\"w-[calc(var(--sidebar-width-icon)+1px)]! border-r\"\n\t\t\t>\n\t\t\t\t<SidebarHeader>\n\t\t\t\t\t<SidebarMenu>\n\t\t\t\t\t\t<SidebarMenuItem>\n\t\t\t\t\t\t\t<SidebarMenuButton\n\t\t\t\t\t\t\t\tsize=\"lg\"\n\t\t\t\t\t\t\t\tclassName=\"md:h-8 md:p-0\"\n\t\t\t\t\t\t\t\trender={<a href=\"#\" />}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n\t\t\t\t\t\t\t\t\t<TerminalIcon className=\"size-4\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div className=\"grid flex-1 text-left text-sm leading-tight\">\n\t\t\t\t\t\t\t\t\t<span className=\"truncate font-medium\">Acme Inc</span>\n\t\t\t\t\t\t\t\t\t<span className=\"truncate text-xs\">Enterprise</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</SidebarMenuButton>\n\t\t\t\t\t\t</SidebarMenuItem>\n\t\t\t\t\t</SidebarMenu>\n\t\t\t\t</SidebarHeader>\n\t\t\t\t<SidebarContent>\n\t\t\t\t\t<SidebarGroup>\n\t\t\t\t\t\t<SidebarGroupContent className=\"px-1.5 md:px-0\">\n\t\t\t\t\t\t\t<SidebarMenu>\n\t\t\t\t\t\t\t\t{data.navMain.map((item) => (\n\t\t\t\t\t\t\t\t\t<SidebarMenuItem key={item.title}>\n\t\t\t\t\t\t\t\t\t\t<SidebarMenuButton\n\t\t\t\t\t\t\t\t\t\t\ttooltip={{\n\t\t\t\t\t\t\t\t\t\t\t\tchildren: item.title,\n\t\t\t\t\t\t\t\t\t\t\t\thidden: false,\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetActiveItem(item);\n\t\t\t\t\t\t\t\t\t\t\t\tconst mail = data.mails.sort(() => Math.random() - 0.5);\n\t\t\t\t\t\t\t\t\t\t\t\tsetMails(\n\t\t\t\t\t\t\t\t\t\t\t\t\tmail.slice(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMath.max(5, Math.floor(Math.random() * 10) + 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tsetOpen(true);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tisActive={activeItem?.title === item.title}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"px-2.5 md:px-2\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{item.icon}\n\t\t\t\t\t\t\t\t\t\t\t<span>{item.title}</span>\n\t\t\t\t\t\t\t\t\t\t</SidebarMenuButton>\n\t\t\t\t\t\t\t\t\t</SidebarMenuItem>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</SidebarMenu>\n\t\t\t\t\t\t</SidebarGroupContent>\n\t\t\t\t\t</SidebarGroup>\n\t\t\t\t</SidebarContent>\n\t\t\t\t<SidebarFooter>\n\t\t\t\t\t<NavUser user={data.user} />\n\t\t\t\t</SidebarFooter>\n\t\t\t</Sidebar>\n\n\t\t\t{/* This is the second sidebar */}\n\t\t\t{/* We disable collapsible and let it fill remaining space */}\n\t\t\t<Sidebar collapsible=\"none\" className=\"hidden flex-1 md:flex\">\n\t\t\t\t<SidebarHeader className=\"gap-3.5 border-b p-4\">\n\t\t\t\t\t<div className=\"flex w-full items-center justify-between\">\n\t\t\t\t\t\t<div className=\"font-medium text-base text-foreground\">\n\t\t\t\t\t\t\t{activeItem?.title}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Label className=\"flex items-center gap-2 text-sm\">\n\t\t\t\t\t\t\t<span>Unreads</span>\n\t\t\t\t\t\t\t<Switch className=\"shadow-none\" />\n\t\t\t\t\t\t</Label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<SidebarInput placeholder=\"Type to search...\" />\n\t\t\t\t</SidebarHeader>\n\t\t\t\t<SidebarContent>\n\t\t\t\t\t<SidebarGroup className=\"px-0\">\n\t\t\t\t\t\t<SidebarGroupContent>\n\t\t\t\t\t\t\t{mails.map((mail) => (\n\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t\t\t\t\tkey={mail.email}\n\t\t\t\t\t\t\t\t\tclassName=\"flex flex-col items-start gap-2 whitespace-nowrap border-b p-4 text-sm leading-tight last:border-b-0 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div className=\"flex w-full items-center gap-2\">\n\t\t\t\t\t\t\t\t\t\t<span>{mail.name}</span>{\" \"}\n\t\t\t\t\t\t\t\t\t\t<span className=\"ml-auto text-xs\">{mail.date}</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span className=\"font-medium\">{mail.subject}</span>\n\t\t\t\t\t\t\t\t\t<span className=\"line-clamp-2 w-[260px] whitespace-break-spaces text-xs\">\n\t\t\t\t\t\t\t\t\t\t{mail.teaser}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SidebarGroupContent>\n\t\t\t\t\t</SidebarGroup>\n\t\t\t\t</SidebarContent>\n\t\t\t</Sidebar>\n\t\t</Sidebar>\n\t);\n}\n","type":"registry:component","target":"components/app-sidebar.tsx"},{"path":"components/nav-user.tsx","content":"\"use client\";\n\nimport {\n\tBadgeCheckIcon,\n\tBellIcon,\n\tChevronsUpDownIcon,\n\tCreditCardIcon,\n\tLogOutIcon,\n\tSparklesIcon,\n} from \"lucide-react\";\n\nimport {\n\tAvatar,\n\tAvatarFallback,\n\tAvatarImage,\n} from \"@/components/ui/avatar\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuGroup,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport {\n\tSidebarMenu,\n\tSidebarMenuButton,\n\tSidebarMenuItem,\n\tuseSidebar,\n} from \"@/components/ui/sidebar\";\n\nexport function NavUser({\n\tuser,\n}: {\n\tuser: {\n\t\tname: string;\n\t\temail: string;\n\t\tavatar: string;\n\t};\n}) {\n\tconst { isMobile } = useSidebar();\n\treturn (\n\t\t<SidebarMenu>\n\t\t\t<SidebarMenuItem>\n\t\t\t\t<DropdownMenu>\n\t\t\t\t\t<DropdownMenuTrigger\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<SidebarMenuButton\n\t\t\t\t\t\t\t\tsize=\"lg\"\n\t\t\t\t\t\t\t\tclassName=\"data-open:bg-sidebar-accent data-open:text-sidebar-accent-foreground md:h-8 md:p-0\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t\t<AvatarImage src={user.avatar} alt={user.name} />\n\t\t\t\t\t\t\t<AvatarFallback>CN</AvatarFallback>\n\t\t\t\t\t\t</Avatar>\n\t\t\t\t\t\t<div className=\"grid flex-1 text-left text-sm leading-tight\">\n\t\t\t\t\t\t\t<span className=\"truncate font-medium\">{user.name}</span>\n\t\t\t\t\t\t\t<span className=\"truncate text-xs\">{user.email}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<ChevronsUpDownIcon className=\"ml-auto size-4\" />\n\t\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t\t<DropdownMenuContent\n\t\t\t\t\t\tclassName=\"min-w-56\"\n\t\t\t\t\t\tside={isMobile ? \"bottom\" : \"right\"}\n\t\t\t\t\t\talign=\"end\"\n\t\t\t\t\t\tsideOffset={4}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownMenuLabel className=\"p-0 font-normal\">\n\t\t\t\t\t\t\t<div className=\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\">\n\t\t\t\t\t\t\t\t<Avatar>\n\t\t\t\t\t\t\t\t\t<AvatarImage src={user.avatar} alt={user.name} />\n\t\t\t\t\t\t\t\t\t<AvatarFallback>CN</AvatarFallback>\n\t\t\t\t\t\t\t\t</Avatar>\n\t\t\t\t\t\t\t\t<div className=\"grid flex-1 text-left text-sm leading-tight\">\n\t\t\t\t\t\t\t\t\t<span className=\"truncate font-medium\">{user.name}</span>\n\t\t\t\t\t\t\t\t\t<span className=\"truncate text-xs\">{user.email}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</DropdownMenuLabel>\n\t\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t\t<DropdownMenuGroup>\n\t\t\t\t\t\t\t<DropdownMenuItem>\n\t\t\t\t\t\t\t\t<SparklesIcon />\n\t\t\t\t\t\t\t\tUpgrade to Pro\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t</DropdownMenuGroup>\n\t\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t\t<DropdownMenuGroup>\n\t\t\t\t\t\t\t<DropdownMenuItem>\n\t\t\t\t\t\t\t\t<BadgeCheckIcon />\n\t\t\t\t\t\t\t\tAccount\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t\t<DropdownMenuItem>\n\t\t\t\t\t\t\t\t<CreditCardIcon />\n\t\t\t\t\t\t\t\tBilling\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t\t<DropdownMenuItem>\n\t\t\t\t\t\t\t\t<BellIcon />\n\t\t\t\t\t\t\t\tNotifications\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t</DropdownMenuGroup>\n\t\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t\t<DropdownMenuItem>\n\t\t\t\t\t\t\t<LogOutIcon />\n\t\t\t\t\t\t\tLog out\n\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t</DropdownMenuContent>\n\t\t\t\t</DropdownMenu>\n\t\t\t</SidebarMenuItem>\n\t\t</SidebarMenu>\n\t);\n}\n","type":"registry:component","target":"components/nav-user.tsx"}],"categories":["sidebar","dashboard"],"type":"registry:block"}