Skip to content

Commit

Permalink
chore: add sidebars block (2/2)
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Nov 25, 2024
1 parent 360e55f commit 99c685e
Show file tree
Hide file tree
Showing 96 changed files with 8,680 additions and 156 deletions.
1,066 changes: 997 additions & 69 deletions apps/www/__registry__/block.ts

Large diffs are not rendered by default.

902 changes: 839 additions & 63 deletions apps/www/__registry__/index.ts

Large diffs are not rendered by default.

Binary file added apps/www/src/public/avatars/shadcn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions apps/www/src/public/r/styles/default/Sidebar01.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"sidebar",
"SearchForm.vue",
"VersionSwitcher.vue",
"collapsible",
"label",
"dropdown-menu"
],
Expand All @@ -22,7 +21,7 @@
},
{
"path": "block/Sidebar01/components/AppSidebar.vue",
"content": "<script setup lang=\"ts\">\nimport SearchForm from '@/registry/new-york/block/Sidebar01/components/SearchForm.vue'\nimport VersionSwitcher from '@/registry/new-york/block/Sidebar01/components/VersionSwitcher.vue'\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from '@/registry/new-york/ui/collapsible'\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n type SidebarProps,\n SidebarRail,\n} from '@/registry/new-york/ui/sidebar'\nimport { ChevronRight } from 'lucide-vue-next'\n\nconst props = defineProps<SidebarProps>()\n\n// This is sample data.\nconst data = {\n versions: ['1.0.1', '1.1.0-alpha', '2.0.0-beta1'],\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</script>\n\n<template>\n <Sidebar v-bind=\"props\">\n <SidebarHeader>\n <VersionSwitcher\n :versions=\"data.versions\"\n :default-version=\"data.versions[0]\"\n />\n <SearchForm />\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup v-for=\"item in data.navMain\" :key=\"item.title\">\n <SidebarGroupLabel>{{ item.title }}</SidebarGroupLabel>\n <SidebarGroupContent>\n <SidebarMenu>\n <SidebarMenuItem v-for=\"childItem in item.items\" :key=\"childItem.title\">\n <SidebarMenuButton as-child :is-active=\"childItem.isActive\">\n <a :href=\"childItem.url\">{{ childItem.title }}</a>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n <SidebarRail />\n </Sidebar>\n</template>\n",
"content": "<script setup lang=\"ts\">\nimport SearchForm from '@/registry/new-york/block/Sidebar01/components/SearchForm.vue'\nimport VersionSwitcher from '@/registry/new-york/block/Sidebar01/components/VersionSwitcher.vue'\n\nimport {\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n type SidebarProps,\n SidebarRail,\n} from '@/registry/new-york/ui/sidebar'\n\nconst props = defineProps<SidebarProps>()\n\n// This is sample data.\nconst data = {\n versions: ['1.0.1', '1.1.0-alpha', '2.0.0-beta1'],\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</script>\n\n<template>\n <Sidebar v-bind=\"props\">\n <SidebarHeader>\n <VersionSwitcher\n :versions=\"data.versions\"\n :default-version=\"data.versions[0]\"\n />\n <SearchForm />\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup v-for=\"item in data.navMain\" :key=\"item.title\">\n <SidebarGroupLabel>{{ item.title }}</SidebarGroupLabel>\n <SidebarGroupContent>\n <SidebarMenu>\n <SidebarMenuItem v-for=\"childItem in item.items\" :key=\"childItem.title\">\n <SidebarMenuButton as-child :is-active=\"childItem.isActive\">\n <a :href=\"childItem.url\">{{ childItem.title }}</a>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n <SidebarRail />\n </Sidebar>\n</template>\n",
"type": "registry:component",
"target": ""
},
Expand Down
2 changes: 1 addition & 1 deletion apps/www/src/public/r/styles/default/Sidebar06.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
{
"path": "block/Sidebar06/components/NavMain.vue",
"content": "<script setup lang=\"ts\">\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/registry/new-york/ui/dropdown-menu'\n\nimport {\n SidebarGroup,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from '@/registry/new-york/ui/sidebar'\nimport { useMediaQuery } from '@vueuse/core'\nimport { type LucideIcon, MoreHorizontal } from 'lucide-vue-next'\n\ndefineProps<{\n items: {\n title: string\n url: string\n icon?: LucideIcon\n isActive?: boolean\n items?: {\n title: string\n url: string\n }[]\n }[]\n}>()\n\nconst isMobile = useMediaQuery('(max-width: 768px)')\n</script>\n\n<template>\n <SidebarGroup>\n <SidebarMenu>\n <DropdownMenu v-for=\"item in items\" :key=\"item.title\">\n <SidebarMenuItem>\n <DropdownMenuTrigger as-child>\n <SidebarMenuButton class=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\">\n {{ item.title }} <MoreHorizontal class=\"ml-auto\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n v-if=\"item.items?.length\"\n :side=\"isMobile ? 'bottom' : 'right'\"\n :align=\"isMobile ? 'end' : 'start'\"\n class=\"min-w-56 rounded-lg\"\n >\n <DropdownMenuItem v-for=\"childItem in item.items\" :key=\"childItem.title\" as-child>\n <a :href=\"childItem.url\">{{ childItem.title }}</a>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </SidebarMenuItem>\n </DropdownMenu>\n </SidebarMenu>\n </SidebarGroup>\n</template>\n",
"content": "<script setup lang=\"ts\">\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@/registry/new-york/ui/dropdown-menu'\n\nimport {\n SidebarGroup,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n} from '@/registry/new-york/ui/sidebar'\nimport { useMediaQuery } from '@vueuse/core'\nimport { type LucideIcon, MoreHorizontal } from 'lucide-vue-next'\n\ndefineProps<{\n items: {\n title: string\n url: string\n icon?: LucideIcon\n isActive?: boolean\n items?: {\n title: string\n url: string\n }[]\n }[]\n}>()\n\nconst isMobile = useMediaQuery('(max-width: 768px)')\n</script>\n\n<template>\n <SidebarGroup>\n <SidebarMenu>\n <DropdownMenu v-for=\"item in items\" :key=\"item.title\">\n <SidebarMenuItem>\n <DropdownMenuTrigger as-child>\n <SidebarMenuButton class=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\">\n {{ item.title }} <MoreHorizontal class=\"ml-auto\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n v-if=\"item.items?.length\"\n :side=\"isMobile ? 'bottom' : 'right'\"\n :align=\"isMobile ? 'end' : 'start'\"\n class=\"min-w-56 rounded-lg\"\n >\n <DropdownMenuItem v-for=\"childItem in item.items\" :key=\"childItem.title\" as-child>\n <a :href=\"childItem.url\">{{ childItem.title }}</a>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </SidebarMenuItem>\n </DropdownMenu>\n </SidebarMenu>\n </SidebarGroup>\n</template>\n",
"type": "registry:component",
"target": ""
},
Expand Down
Loading

0 comments on commit 99c685e

Please sign in to comment.