diff --git a/apps/www/.vitepress/theme/config/docs.ts b/apps/www/.vitepress/theme/config/docs.ts index d3e1e941..1e976337 100644 --- a/apps/www/.vitepress/theme/config/docs.ts +++ b/apps/www/.vitepress/theme/config/docs.ts @@ -219,13 +219,11 @@ export const docsConfig: DocsConfig = { href: '/docs/components/menubar', items: [], }, - // { - // title: "Navigation Menu", - // href: "#", - // label: "Soon", - // disabled: true, - // items: [] - // }, + { + title: 'Navigation Menu', + href: '/docs/components/navigation-menu', + items: [], + }, { title: 'Popover', href: '/docs/components/popover', @@ -241,13 +239,11 @@ export const docsConfig: DocsConfig = { href: '/docs/components/radio-group', items: [], }, - // { - // title: "Scroll Area", - // href: "#", - // label: "Soon", - // disabled: true, - // items: [] - // }, + { + title: 'Scroll Area', + href: '/docs/components/scroll-area', + items: [], + }, { title: 'Select', href: '/docs/components/select', diff --git a/apps/www/.vitepress/theme/styles/vp-doc.css b/apps/www/.vitepress/theme/styles/vp-doc.css index fe34f209..168f70c6 100644 --- a/apps/www/.vitepress/theme/styles/vp-doc.css +++ b/apps/www/.vitepress/theme/styles/vp-doc.css @@ -138,26 +138,26 @@ * Lists * -------------------------------------------------------------------------- */ -.vp-doc ul, -.vp-doc ol { +.vp-doc ul:not(:where(.preview *)), +.vp-doc ol:not(:where(.preview *)) { padding-left: 1.25rem; margin: 16px 0; } -.vp-doc ul { +.vp-doc ul:not(:where(.preview *)) { list-style: disc; } -.vp-doc ol { +.vp-doc ol:not(:where(.preview *)) { list-style: decimal; } -.vp-doc li + li { +.vp-doc li + li:not(:where(.preview *)) { margin-top: 8px; } -.vp-doc li > ol, -.vp-doc li > ul { +.vp-doc li > ol:not(:where(.preview *)), +.vp-doc li > ul:not(:where(.preview *)) { margin: 8px 0 0; } diff --git a/apps/www/src/content/docs/components/navigation-menu.md b/apps/www/src/content/docs/components/navigation-menu.md new file mode 100644 index 00000000..3e103b96 --- /dev/null +++ b/apps/www/src/content/docs/components/navigation-menu.md @@ -0,0 +1,61 @@ +--- +title: Navigation Menu +description: A collection of links for navigating websites. +source: https://github.com/radix-vue/shadcn-vue/tree/main/apps/www/src/lib/registry/default/ui/navigation-menu +primitive: https://www.radix-vue.com/components/navigation-menu.html +--- + + + +<<< ../../../lib/registry/default/examples/NavigationMenuDemo.vue + + + + + +## Installation + +```bash +npx shadcn-vue@latest add navigation-menu +``` + + + +1. Install `radix-vue`: + +```bash +npm install radix-vue +``` + +2. Copy and paste the component source files linked at the top of this page into your project. + + +## Usage + +```vue + + + + + + + Item One + + Link + + + + + +``` \ No newline at end of file diff --git a/apps/www/src/lib/registry/default/examples/NavigationMenuDemo.vue b/apps/www/src/lib/registry/default/examples/NavigationMenuDemo.vue new file mode 100644 index 00000000..de8b0a22 --- /dev/null +++ b/apps/www/src/lib/registry/default/examples/NavigationMenuDemo.vue @@ -0,0 +1,110 @@ + + + + + + + Getting started + + + + + + + + shadcn/ui + + + Beautifully designed components built with Radix UI and + Tailwind CSS. + + + + + + Re-usable components built using Radix UI and Tailwind CSS. + + + How to install dependencies and structure your app. + + + Styles for headings, paragraphs, lists...etc + + + + + + Components + + + + {{ component.description }} + + + + + + + Documentation + + + + + diff --git a/apps/www/src/lib/registry/default/examples/NavigationMenuDemoItem.vue b/apps/www/src/lib/registry/default/examples/NavigationMenuDemoItem.vue new file mode 100644 index 00000000..deeb0f25 --- /dev/null +++ b/apps/www/src/lib/registry/default/examples/NavigationMenuDemoItem.vue @@ -0,0 +1,27 @@ + + + + + + + {{ title }} + + + + + + + diff --git a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenu.vue b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenu.vue index 74a65c7a..39d79fb2 100644 --- a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenu.vue +++ b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenu.vue @@ -3,8 +3,8 @@ import { NavigationMenuRoot, type NavigationMenuRootEmits, type NavigationMenuRootProps, - NavigationMenuViewport, } from 'radix-vue' +import NavigationMenuViewport from './NavigationMenuViewport.vue' import { cn } from '@/lib/utils' const props = defineProps() @@ -15,19 +15,10 @@ const emits = defineEmits() - - - + diff --git a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuContent.vue b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuContent.vue index e2a48c49..6e981811 100644 --- a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuContent.vue +++ b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuContent.vue @@ -4,7 +4,7 @@ import { type NavigationMenuContentEmits, type NavigationMenuContentProps, } from 'radix-vue' -import { cn } from '@/lib/utils' +import { cn, useEmitAsProps } from '@/lib/utils' const props = defineProps() @@ -13,10 +13,10 @@ const emits = defineEmits() +import { NavigationMenuIndicator, type NavigationMenuIndicatorProps } from 'radix-vue' +import { cn } from '@/lib/utils' + +const props = defineProps() + + + + + + + diff --git a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuLink.vue b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuLink.vue index 19e5812e..d2d83e2b 100644 --- a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuLink.vue +++ b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuLink.vue @@ -4,14 +4,14 @@ import { type NavigationMenuLinkEmits, type NavigationMenuLinkProps, } from 'radix-vue' +import { useEmitAsProps } from '@/lib/utils' const props = defineProps() - const emits = defineEmits() - + diff --git a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuListItem.vue b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuListItem.vue deleted file mode 100644 index 356aaaa9..00000000 --- a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuListItem.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - {{ props.title }} - - - - - - - - diff --git a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuTrigger.vue b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuTrigger.vue index 3a7f514c..08634ccd 100644 --- a/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuTrigger.vue +++ b/apps/www/src/lib/registry/default/ui/navigation-menu/NavigationMenuTrigger.vue @@ -3,27 +3,19 @@ import { NavigationMenuTrigger, type NavigationMenuTriggerProps, } from 'radix-vue' -import { cva } from 'class-variance-authority' import { ChevronDown } from 'lucide-vue-next' -import { computed } from 'vue' +import { navigationMenuTriggerStyle } from '.' import { cn } from '@/lib/utils' const props = defineProps() - -const navigationMenuTriggerStyle = computed(() => { - return cva( - 'group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-outline-hover hover:text-foreground focus:bg-outline-hover focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-outline-hover data-[state=open]:bg-outline-hover', - ) -}) - {{ " " }} +import { + NavigationMenuViewport, + type NavigationMenuViewportProps, +} from 'radix-vue' +import { cn } from '@/lib/utils' + +const props = defineProps() + + + + + + + diff --git a/apps/www/src/lib/registry/default/ui/navigation-menu/index.ts b/apps/www/src/lib/registry/default/ui/navigation-menu/index.ts index 38f20da2..1aca4227 100644 --- a/apps/www/src/lib/registry/default/ui/navigation-menu/index.ts +++ b/apps/www/src/lib/registry/default/ui/navigation-menu/index.ts @@ -1,7 +1,12 @@ +import { cva } from 'class-variance-authority' + export { default as NavigationMenu } from './NavigationMenu.vue' export { default as NavigationMenuList } from './NavigationMenuList.vue' export { default as NavigationMenuItem } from './NavigationMenuItem.vue' export { default as NavigationMenuTrigger } from './NavigationMenuTrigger.vue' export { default as NavigationMenuContent } from './NavigationMenuContent.vue' export { default as NavigationMenuLink } from './NavigationMenuLink.vue' -export { default as NavigationMenuListItem } from './NavigationMenuListItem.vue' + +export const navigationMenuTriggerStyle = cva( + 'group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50', +) diff --git a/apps/www/src/lib/registry/default/ui/select/Select.vue b/apps/www/src/lib/registry/default/ui/select/Select.vue index 4c8d371a..9ea04703 100644 --- a/apps/www/src/lib/registry/default/ui/select/Select.vue +++ b/apps/www/src/lib/registry/default/ui/select/Select.vue @@ -1,9 +1,14 @@ - +
+ Beautifully designed components built with Radix UI and + Tailwind CSS. +
+ +
- -