gvf3n4ygn-test
Version:
CLI for SIGMA-UI components.
44 lines • 7.09 kB
JSON
{
"name": "navigation-menu",
"dependencies": [],
"registryDependencies": [],
"files": [
{
"name": "NavigationMenu.vue",
"content": "<script setup lang=\"ts\">\nimport {\n NavigationMenuRoot,\n type NavigationMenuRootEmits,\n type NavigationMenuRootProps,\n useForwardPropsEmits,\n} from 'radix-vue';\nimport NavigationMenuViewport from './NavigationMenuViewport.vue';\nimport { cn } from '@ui/utils';\n\nconst props = defineProps<NavigationMenuRootProps>();\nconst emits = defineEmits<NavigationMenuRootEmits>();\n\nconst forwarded = useForwardPropsEmits(props, emits);\n</script>\n\n<template>\n <NavigationMenuRoot\n v-bind=\"forwarded\"\n :class=\"cn('relative z-10 flex max-w-max flex-1 items-center justify-center', $attrs.class ?? '')\"\n >\n <slot />\n <NavigationMenuViewport />\n </NavigationMenuRoot>\n</template>\n"
},
{
"name": "NavigationMenuContent.vue",
"content": "<script setup lang=\"ts\">\nimport {\n NavigationMenuContent,\n type NavigationMenuContentEmits,\n type NavigationMenuContentProps,\n useForwardPropsEmits,\n} from 'radix-vue';\nimport { cn } from '@ui/utils';\n\nconst props = defineProps<NavigationMenuContentProps>();\nconst emits = defineEmits<NavigationMenuContentEmits>();\n\nconst forwarded = useForwardPropsEmits(props, emits);\n</script>\n\n<template>\n <NavigationMenuContent\n v-bind=\"forwarded\"\n :class=\"cn(\n 'left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion^=from-]:blur-0 data-[motion^=to-]:blur-md data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto',\n $attrs.class ?? '',\n )\"\n >\n <slot />\n </NavigationMenuContent>\n</template>\n"
},
{
"name": "NavigationMenuIndicator.vue",
"content": "<script setup lang=\"ts\">\nimport { NavigationMenuIndicator, type NavigationMenuIndicatorProps, useForwardProps } from 'radix-vue';\nimport { cn } from '@ui/utils';\n\nconst props = defineProps<NavigationMenuIndicatorProps>();\n\nconst forwardedProps = useForwardProps(props);\n</script>\n\n<template>\n <NavigationMenuIndicator\n v-bind=\"forwardedProps\"\n :class=\"cn('top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in', $attrs.class ?? '')\"\n >\n <div class=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuIndicator>\n</template>\n"
},
{
"name": "NavigationMenuItem.vue",
"content": "<script setup lang=\"ts\">\nimport { NavigationMenuItem, type NavigationMenuItemProps } from 'radix-vue';\n\nconst props = defineProps<NavigationMenuItemProps>();\n</script>\n\n<template>\n <NavigationMenuItem v-bind=\"props\">\n <slot />\n </NavigationMenuItem>\n</template>\n"
},
{
"name": "NavigationMenuLink.vue",
"content": "<script setup lang=\"ts\">\nimport {\n NavigationMenuLink,\n type NavigationMenuLinkEmits,\n type NavigationMenuLinkProps,\n useForwardPropsEmits,\n} from 'radix-vue';\n\nconst props = defineProps<NavigationMenuLinkProps>();\nconst emits = defineEmits<NavigationMenuLinkEmits>();\n\nconst forwarded = useForwardPropsEmits(props, emits);\n</script>\n\n<template>\n <NavigationMenuLink v-bind=\"forwarded\">\n <slot />\n </NavigationMenuLink>\n</template>\n"
},
{
"name": "NavigationMenuList.vue",
"content": "<script setup lang=\"ts\">\nimport { NavigationMenuList, type NavigationMenuListProps, useForwardProps } from 'radix-vue';\nimport { cn } from '@ui/utils';\n\nconst props = defineProps<NavigationMenuListProps>();\n\nconst forwardedProps = useForwardProps(props);\n</script>\n\n<template>\n <NavigationMenuList\n v-bind=\"forwardedProps\"\n :class=\"\n cn(\n 'group flex flex-1 list-none items-center justify-center gap-x-1',\n $attrs.class ?? '',\n )\n \"\n >\n <slot />\n </NavigationMenuList>\n</template>\n"
},
{
"name": "NavigationMenuTrigger.vue",
"content": "<script setup lang=\"ts\">\nimport {\n NavigationMenuTrigger,\n type NavigationMenuTriggerProps,\n useForwardProps,\n} from 'radix-vue';\nimport { ChevronDownIcon } from 'lucide-vue-next';\nimport { navigationMenuTriggerStyle } from '.';\nimport { cn } from '@ui/utils';\n\nconst props = defineProps<NavigationMenuTriggerProps>();\n\nconst forwardedProps = useForwardProps(props);\n</script>\n\n<template>\n <NavigationMenuTrigger\n v-bind=\"forwardedProps\"\n :class=\"cn(navigationMenuTriggerStyle(), 'group', $attrs.class ?? '')\"\n >\n <slot />\n <ChevronDownIcon\n class=\"relative top-px ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuTrigger>\n</template>\n"
},
{
"name": "NavigationMenuViewport.vue",
"content": "<script setup lang=\"ts\">\nimport {\n NavigationMenuViewport,\n type NavigationMenuViewportProps,\n useForwardProps,\n} from 'radix-vue';\nimport { cn } from '@ui/utils';\n\nconst props = defineProps<NavigationMenuViewportProps>();\n\nconst forwardedProps = useForwardProps(props);\n</script>\n\n<template>\n <div class=\"absolute left-0 top-full flex justify-center\">\n <NavigationMenuViewport\n v-bind=\"forwardedProps\"\n :class=\"\n cn(\n 'origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-(--radix-navigation-menu-viewport-width)',\n $attrs.class ?? '',\n )\n \"\n />\n </div>\n</template>\n"
},
{
"name": "index.ts",
"content": "import { cva } from 'class-variance-authority';\n\nexport { default as NavigationMenu } from './NavigationMenu.vue';\nexport { default as NavigationMenuList } from './NavigationMenuList.vue';\nexport { default as NavigationMenuItem } from './NavigationMenuItem.vue';\nexport { default as NavigationMenuTrigger } from './NavigationMenuTrigger.vue';\nexport { default as NavigationMenuContent } from './NavigationMenuContent.vue';\nexport { default as NavigationMenuLink } from './NavigationMenuLink.vue';\n\nexport const navigationMenuTriggerStyle = cva(\n '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',\n);\n"
}
],
"type": "components:ui"
}