import type { Meta, StoryObj } from '@storybook/react'; import { AudioWaveform, BadgeCheck, Bell, BookOpen, Bot, ChevronRight, ChevronsUpDown, Command, CreditCard, Folder, Forward, Frame, GalleryVerticalEnd, LogOut, // biome-ignore lint/suspicious/noShadowRestrictedNames: "icon name" Map, MoreHorizontal, PieChart, Plus, Settings2, Sparkles, SquareTerminal, Trash2, } from 'lucide-react'; import { Avatar, AvatarFallback, AvatarImage, } from '@konobangu/design-system/components/ui/avatar'; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from '@konobangu/design-system/components/ui/breadcrumb'; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@konobangu/design-system/components/ui/collapsible'; import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from '@konobangu/design-system/components/ui/dropdown-menu'; import { Separator } from '@konobangu/design-system/components/ui/separator'; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, } from '@konobangu/design-system/components/ui/sidebar'; import { useState } from 'react'; const meta: Meta = { title: 'ui/Sidebar', component: Sidebar, tags: ['autodocs'], argTypes: {}, }; export default meta; type Story = StoryObj; const data = { user: { name: 'shadcn', email: 'm@example.com', avatar: '/avatars/shadcn.jpg', }, teams: [ { name: 'Acme Inc', logo: GalleryVerticalEnd, plan: 'Enterprise', }, { name: 'Acme Corp.', logo: AudioWaveform, plan: 'Startup', }, { name: 'Evil Corp.', logo: Command, plan: 'Free', }, ], navMain: [ { title: 'Playground', url: '#', icon: SquareTerminal, isActive: true, items: [ { title: 'History', url: '#', }, { title: 'Starred', url: '#', }, { title: 'Settings', url: '#', }, ], }, { title: 'Models', url: '#', icon: Bot, items: [ { title: 'Genesis', url: '#', }, { title: 'Explorer', url: '#', }, { title: 'Quantum', url: '#', }, ], }, { title: 'Documentation', url: '#', icon: BookOpen, items: [ { title: 'Introduction', url: '#', }, { title: 'Get Started', url: '#', }, { title: 'Tutorials', url: '#', }, { title: 'Changelog', url: '#', }, ], }, { title: 'Settings', url: '#', icon: Settings2, items: [ { title: 'General', url: '#', }, { title: 'Team', url: '#', }, { title: 'Billing', url: '#', }, { title: 'Limits', url: '#', }, ], }, ], projects: [ { name: 'Design Engineering', url: '#', icon: Frame, }, { name: 'Sales & Marketing', url: '#', icon: PieChart, }, { name: 'Travel', url: '#', icon: Map, }, ], }; export const Base: Story = { render: () => { const [activeTeam, setActiveTeam] = useState(data.teams[0]); return (
{activeTeam.name} {activeTeam.plan}
Teams {data.teams.map((team, index) => ( setActiveTeam(team)} className="gap-2 p-2" >
{team.name} ⌘{index + 1}
))}
Add team
Platform {data.navMain.map((item) => ( {item.icon && } {item.title} {item.items?.map((subItem) => ( {subItem.title} ))} ))} Projects {data.projects.map((item) => ( {item.name} More View Project Share Project Delete Project ))} More CN
{data.user.name} {data.user.email}
CN
{data.user.name} {data.user.email}
Upgrade to Pro Account Billing Notifications Log out
Building Your Application Data Fetching
); }, args: {}, };