mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
Upstream sync from shadcn-ui/ui (1686 commits since last merge base). Key changes: - packages/shadcn upgraded to 4.1.0 (CLI font transformers, scaffold from github, chart colors) - apps/v4 replaces apps/www as the primary docs/registry app - Font system: 25+ heading font registries, font markers utility, @supports override - Chart improvements: recharts v3 compat, radial chart fixes - templates/ updated with monorepo variants (astro, vite, react-router, start) - skills/shadcn AI skill definitions added - deprecated/ removed (auth, auth-firebase, cli, www) Preserved Hanzo-only paths: app/, pkg/, demo/, docs/, template/next/
225 lines
5.1 KiB
TypeScript
225 lines
5.1 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
|
|
import { SearchForm } from "@/registry/bases/base/blocks/sidebar-02/components/search-form"
|
|
import { VersionSwitcher } from "@/registry/bases/base/blocks/sidebar-02/components/version-switcher"
|
|
import {
|
|
Collapsible,
|
|
CollapsibleContent,
|
|
CollapsibleTrigger,
|
|
} from "@/registry/bases/base/ui/collapsible"
|
|
import {
|
|
Sidebar,
|
|
SidebarContent,
|
|
SidebarGroup,
|
|
SidebarGroupContent,
|
|
SidebarGroupLabel,
|
|
SidebarHeader,
|
|
SidebarMenu,
|
|
SidebarMenuButton,
|
|
SidebarMenuItem,
|
|
SidebarRail,
|
|
} from "@/registry/bases/base/ui/sidebar"
|
|
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
|
|
|
|
// This is sample data.
|
|
const data = {
|
|
versions: ["1.0.1", "1.1.0-alpha", "2.0.0-beta1"],
|
|
navMain: [
|
|
{
|
|
title: "Getting Started",
|
|
url: "#",
|
|
items: [
|
|
{
|
|
title: "Installation",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Project Structure",
|
|
url: "#",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: "Build Your Application",
|
|
url: "#",
|
|
items: [
|
|
{
|
|
title: "Routing",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Data Fetching",
|
|
url: "#",
|
|
isActive: true,
|
|
},
|
|
{
|
|
title: "Rendering",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Caching",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Styling",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Optimizing",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Configuring",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Testing",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Authentication",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Deploying",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Upgrading",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Examples",
|
|
url: "#",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: "API Reference",
|
|
url: "#",
|
|
items: [
|
|
{
|
|
title: "Components",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "File Conventions",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Functions",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "next.config.js Options",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "CLI",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Edge Runtime",
|
|
url: "#",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: "Architecture",
|
|
url: "#",
|
|
items: [
|
|
{
|
|
title: "Accessibility",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Fast Refresh",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Next.js Compiler",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Supported Browsers",
|
|
url: "#",
|
|
},
|
|
{
|
|
title: "Turbopack",
|
|
url: "#",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: "Community",
|
|
url: "#",
|
|
items: [
|
|
{
|
|
title: "Contribution Guide",
|
|
url: "#",
|
|
},
|
|
],
|
|
},
|
|
],
|
|
}
|
|
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|
return (
|
|
<Sidebar {...props}>
|
|
<SidebarHeader>
|
|
<VersionSwitcher
|
|
versions={data.versions}
|
|
defaultVersion={data.versions[0]}
|
|
/>
|
|
<SearchForm />
|
|
</SidebarHeader>
|
|
<SidebarContent className="gap-0">
|
|
{/* We create a collapsible SidebarGroup for each parent. */}
|
|
{data.navMain.map((item) => (
|
|
<Collapsible
|
|
key={item.title}
|
|
title={item.title}
|
|
defaultOpen
|
|
className="group/collapsible"
|
|
>
|
|
<SidebarGroup>
|
|
<SidebarGroupLabel
|
|
className="group/label text-sm text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
|
|
render={<CollapsibleTrigger />}
|
|
>
|
|
{item.title}{" "}
|
|
<IconPlaceholder
|
|
lucide="ChevronRightIcon"
|
|
tabler="IconChevronRight"
|
|
hugeicons="ArrowRight01Icon"
|
|
phosphor="CaretRightIcon"
|
|
remixicon="RiArrowRightSLine"
|
|
className="ml-auto transition-transform group-data-open/collapsible:rotate-90"
|
|
/>
|
|
</SidebarGroupLabel>
|
|
<CollapsibleContent>
|
|
<SidebarGroupContent>
|
|
<SidebarMenu>
|
|
{item.items.map((item) => (
|
|
<SidebarMenuItem key={item.title}>
|
|
<SidebarMenuButton
|
|
isActive={item.isActive}
|
|
render={<a href={item.url} />}
|
|
>
|
|
{item.title}
|
|
</SidebarMenuButton>
|
|
</SidebarMenuItem>
|
|
))}
|
|
</SidebarMenu>
|
|
</SidebarGroupContent>
|
|
</CollapsibleContent>
|
|
</SidebarGroup>
|
|
</Collapsible>
|
|
))}
|
|
</SidebarContent>
|
|
<SidebarRail />
|
|
</Sidebar>
|
|
)
|
|
}
|