mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-02 17:08:39 +00:00
* feat: add phosphor icons to base ui * feat_ add phosphor to blocks * feat: add phosphor to radix blocks * feat: add phosphor to radix ui * feat: add phosphor to radix example * feat: add missing phosphor icons * fix: rename broken icons * chore: format files * fix: add missing phosphor icons * chore: build registry --------- Co-authored-by: shadcn <m@shadcn.com>
22 lines
8.1 KiB
JSON
22 lines
8.1 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "sidebar-floating-example",
|
|
"title": "Sidebar (Floating)",
|
|
"registryDependencies": [
|
|
"button",
|
|
"card",
|
|
"dropdown-menu",
|
|
"field",
|
|
"item",
|
|
"sidebar",
|
|
"example"
|
|
],
|
|
"files": [
|
|
{
|
|
"path": "registry/base-nova/examples/sidebar-floating-example.tsx",
|
|
"content": "\"use client\"\n\nimport { Button } from \"@/registry/bases/base/ui/button\"\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/registry/bases/base/ui/card\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/registry/bases/base/ui/dropdown-menu\"\nimport { Field } from \"@/registry/bases/base/ui/field\"\nimport {\n Item,\n ItemContent,\n ItemDescription,\n ItemTitle,\n} from \"@/registry/bases/base/ui/item\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarProvider,\n SidebarRail,\n SidebarTrigger,\n} from \"@/registry/bases/base/ui/sidebar\"\nimport { IconPlaceholder } from \"@/app/(create)/components/icon-placeholder\"\n\nexport default function SidebarFloatingExample() {\n const data = {\n navMain: [\n {\n title: \"Getting Started\",\n url: \"#\",\n items: [\n {\n title: \"Installation\",\n url: \"#\",\n },\n {\n title: \"Project Structure\",\n url: \"#\",\n },\n ],\n },\n {\n title: \"Building Your Application\",\n url: \"#\",\n items: [\n {\n title: \"Routing\",\n url: \"#\",\n },\n {\n title: \"Data Fetching\",\n url: \"#\",\n isActive: true,\n },\n {\n title: \"Rendering\",\n url: \"#\",\n },\n {\n title: \"Caching\",\n url: \"#\",\n },\n {\n title: \"Styling\",\n url: \"#\",\n },\n {\n title: \"Optimizing\",\n url: \"#\",\n },\n {\n title: \"Configuring\",\n url: \"#\",\n },\n {\n title: \"Testing\",\n url: \"#\",\n },\n {\n title: \"Authentication\",\n url: \"#\",\n },\n {\n title: \"Deploying\",\n url: \"#\",\n },\n {\n title: \"Upgrading\",\n url: \"#\",\n },\n {\n title: \"Examples\",\n url: \"#\",\n },\n ],\n },\n {\n title: \"API Reference\",\n url: \"#\",\n items: [\n {\n title: \"Components\",\n url: \"#\",\n },\n {\n title: \"File Conventions\",\n url: \"#\",\n },\n {\n title: \"Functions\",\n url: \"#\",\n },\n {\n title: \"next.config.js Options\",\n url: \"#\",\n },\n {\n title: \"CLI\",\n url: \"#\",\n },\n {\n title: \"Edge Runtime\",\n url: \"#\",\n },\n ],\n },\n {\n title: \"Architecture\",\n url: \"#\",\n items: [\n {\n title: \"Accessibility\",\n url: \"#\",\n },\n {\n title: \"Fast Refresh\",\n url: \"#\",\n },\n {\n title: \"Next.js Compiler\",\n url: \"#\",\n },\n {\n title: \"Supported Browsers\",\n url: \"#\",\n },\n {\n title: \"Turbopack\",\n url: \"#\",\n },\n ],\n },\n ],\n }\n\n return (\n <SidebarProvider className=\"bg-background\">\n <Sidebar variant=\"floating\">\n <SidebarHeader>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton size=\"lg\" render={<a href=\"#\" />}>\n <Item className=\"p-0\" size=\"xs\">\n <ItemContent>\n <ItemTitle className=\"text-sm\">Documentation</ItemTitle>\n <ItemDescription>v1.0.0</ItemDescription>\n </ItemContent>\n </Item>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup>\n <SidebarMenu>\n {data.navMain.map((item) => (\n <DropdownMenu key={item.title}>\n <SidebarMenuItem>\n <DropdownMenuTrigger\n render={\n <SidebarMenuButton className=\"data-popup-open:bg-sidebar-accent data-popup-open:text-sidebar-accent-foreground\" />\n }\n >\n {item.title}{\" \"}\n <IconPlaceholder\n lucide=\"MoreHorizontalIcon\"\n tabler=\"IconDots\"\n hugeicons=\"MoreHorizontalCircle01Icon\"\n phosphor=\"DotsThreeOutlineIcon\"\n className=\"ml-auto\"\n />\n </DropdownMenuTrigger>\n {item.items?.length ? (\n <DropdownMenuContent side=\"right\" align=\"start\">\n <DropdownMenuGroup>\n {item.items.map((subItem) => (\n <DropdownMenuItem\n render={<a href={subItem.url} />}\n key={subItem.title}\n >\n {subItem.title}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </DropdownMenuContent>\n ) : null}\n </SidebarMenuItem>\n </DropdownMenu>\n ))}\n </SidebarMenu>\n </SidebarGroup>\n </SidebarContent>\n <SidebarFooter>\n <SidebarGroup>\n <Card size=\"sm\" className=\"-mx-2\">\n <CardHeader>\n <CardTitle className=\"text-sm\">\n Subscribe to our newsletter\n </CardTitle>\n <CardDescription>\n Opt-in to receive updates and news about the sidebar.\n </CardDescription>\n </CardHeader>\n <CardContent>\n <form>\n <Field>\n <SidebarInput type=\"email\" placeholder=\"Email\" />\n <Button\n className=\"bg-sidebar-primary text-sidebar-primary-foreground w-full\"\n size=\"sm\"\n >\n Subscribe\n </Button>\n </Field>\n </form>\n </CardContent>\n </Card>\n </SidebarGroup>\n </SidebarFooter>\n <SidebarRail />\n </Sidebar>\n <SidebarInset>\n <header className=\"flex h-16 shrink-0 items-center gap-2 border-b px-4\">\n <SidebarTrigger className=\"-ml-1\" />\n </header>\n <div className=\"flex flex-1 flex-col gap-4 p-4\">\n <div className=\"grid auto-rows-min gap-4 md:grid-cols-3\">\n <div className=\"bg-muted/50 aspect-video rounded-xl\" />\n <div className=\"bg-muted/50 aspect-video rounded-xl\" />\n <div className=\"bg-muted/50 aspect-video rounded-xl\" />\n </div>\n <div className=\"bg-muted/50 min-h-[100vh] flex-1 rounded-xl md:min-h-min\" />\n </div>\n </SidebarInset>\n </SidebarProvider>\n )\n}\n",
|
|
"type": "registry:example"
|
|
}
|
|
],
|
|
"type": "registry:example"
|
|
} |