diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d64b9715f..7b5a43903 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -199,6 +199,7 @@ importers: '@radix-ui/react-hover-card': ^1.0.3 '@radix-ui/react-label': ^2.0.0 '@radix-ui/react-menubar': ^1.0.0 + '@radix-ui/react-navigation-menu': ^1.1.1 '@radix-ui/react-popover': ^1.0.2 '@radix-ui/react-progress': ^1.0.1 '@radix-ui/react-radio-group': ^1.1.0 @@ -249,6 +250,7 @@ importers: '@radix-ui/react-hover-card': 1.0.3_ib3m5ricvtkl2cll7qpr2f6lvq '@radix-ui/react-label': 2.0.0_biqbaboplfbrettd7655fr4n2y '@radix-ui/react-menubar': 1.0.0_ib3m5ricvtkl2cll7qpr2f6lvq + '@radix-ui/react-navigation-menu': 1.1.1_biqbaboplfbrettd7655fr4n2y '@radix-ui/react-popover': 1.0.2_ib3m5ricvtkl2cll7qpr2f6lvq '@radix-ui/react-progress': 1.0.1_biqbaboplfbrettd7655fr4n2y '@radix-ui/react-radio-group': 1.1.0_biqbaboplfbrettd7655fr4n2y @@ -5799,7 +5801,7 @@ packages: react: '*' react-dom: '*' dependencies: - next: 13.1.6_biqbaboplfbrettd7655fr4n2y + next: 13.1.6_7xlrwlvvs7cv2obrs6a5y6oxxq react: 18.2.0 react-dom: 18.2.0_react@18.2.0 dev: false @@ -6203,7 +6205,6 @@ packages: lilconfig: 2.0.6 postcss: 8.4.20 yaml: 1.10.2 - dev: true /postcss-load-config/3.1.4_ra2vnoek4vhbzktaezawwqbin4: resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} @@ -7106,7 +7107,7 @@ packages: peerDependencies: tailwindcss: '>=3.0.0 || insiders' dependencies: - tailwindcss: 3.2.4_ra2vnoek4vhbzktaezawwqbin4 + tailwindcss: 3.2.4_postcss@8.4.20 dev: false /tailwindcss/3.2.4_postcss@8.4.20: @@ -7141,7 +7142,6 @@ packages: resolve: 1.22.1 transitivePeerDependencies: - ts-node - dev: true /tailwindcss/3.2.4_ra2vnoek4vhbzktaezawwqbin4: resolution: {integrity: sha512-AhwtHCKMtR71JgeYDaswmZXhPcW9iuI9Sp2LvZPo9upDZ7231ZJ7eA9RaURbhpXGVlrjX4cFNlB4ieTetEb7hQ==} diff --git a/scripts/sync-templates.sh b/scripts/sync-templates.sh index 344344124..8b625ef9e 100755 --- a/scripts/sync-templates.sh +++ b/scripts/sync-templates.sh @@ -11,6 +11,12 @@ for folder in $GLOB; do cp -r ./apps/www/components/ui $folder/components cd $BASE + if [ -n "$(git status --porcelain)" ]; then + git add . + git commit -m "chore: update template" + git push origin main + fi + NAME=${folder##*/} CLONE_DIR="__${NAME}__clone__" diff --git a/templates/next-template/components/ui/button.tsx b/templates/next-template/components/ui/button.tsx index 2a36d1aef..22914e094 100644 --- a/templates/next-template/components/ui/button.tsx +++ b/templates/next-template/components/ui/button.tsx @@ -9,7 +9,9 @@ const buttonVariants = cva( variants: { variant: { default: - "bg-slate-900 text-white hover:bg-slate-700 dark:bg-slate-300 dark:text-slate-900", + "bg-slate-900 text-white hover:bg-slate-700 dark:bg-slate-50 dark:text-slate-900", + destructive: + "bg-red-500 text-white hover:bg-red-600 dark:hover:bg-red-600", outline: "bg-transparent border border-slate-200 hover:bg-slate-100 dark:border-slate-700 dark:text-slate-100", subtle: diff --git a/templates/next-template/components/ui/navigation-menu.tsx b/templates/next-template/components/ui/navigation-menu.tsx new file mode 100644 index 000000000..292683985 --- /dev/null +++ b/templates/next-template/components/ui/navigation-menu.tsx @@ -0,0 +1,128 @@ +import * as React from "react" +import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu" +import { cva } from "class-variance-authority" +import { ChevronDown } from "lucide-react" + +import { cn } from "@/lib/utils" + +const NavigationMenu = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + {children} + + +)) +NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName + +const NavigationMenuList = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName + +const NavigationMenuItem = NavigationMenuPrimitive.Item + +const navigationMenuTriggerStyle = cva( + "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus:bg-slate-100 disabled:opacity-50 dark:focus:bg-slate-800 disabled:pointer-events-none bg-transparent hover:bg-slate-100 dark:hover:bg-slate-800 dark:text-slate-100 dark:hover:text-slate-100 data-[state=open]:bg-slate-50 dark:data-[state=open]:bg-slate-800 h-10 py-2 px-4 group" +) + +const NavigationMenuTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + {children}{" "} + +)) +NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName + +const NavigationMenuContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName + +const NavigationMenuLink = NavigationMenuPrimitive.Link + +const NavigationMenuViewport = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( +
+ +
+)) +NavigationMenuViewport.displayName = + NavigationMenuPrimitive.Viewport.displayName + +const NavigationMenuIndicator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +
+ +)) +NavigationMenuIndicator.displayName = + NavigationMenuPrimitive.Indicator.displayName + +export { + navigationMenuTriggerStyle, + NavigationMenu, + NavigationMenuList, + NavigationMenuItem, + NavigationMenuContent, + NavigationMenuTrigger, + NavigationMenuLink, + NavigationMenuIndicator, + NavigationMenuViewport, +} diff --git a/templates/next-template/components/ui/tooltip.tsx b/templates/next-template/components/ui/tooltip.tsx index d68afae11..56c2573da 100644 --- a/templates/next-template/components/ui/tooltip.tsx +++ b/templates/next-template/components/ui/tooltip.tsx @@ -6,7 +6,8 @@ import * as TooltipPrimitive from "@radix-ui/react-tooltip" import { cn } from "@/lib/utils" const TooltipProvider = TooltipPrimitive.Provider -const Tooltip = TooltipPrimitive.Root + +const Tooltip = ({ ...props }) => Tooltip.displayName = TooltipPrimitive.Tooltip.displayName const TooltipTrigger = TooltipPrimitive.Trigger @@ -27,4 +28,4 @@ const TooltipContent = React.forwardRef< )) TooltipContent.displayName = TooltipPrimitive.Content.displayName -export { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } +export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } diff --git a/templates/next-template/package.json b/templates/next-template/package.json index a81d7bca0..0a6df543d 100644 --- a/templates/next-template/package.json +++ b/templates/next-template/package.json @@ -24,6 +24,7 @@ "@radix-ui/react-hover-card": "^1.0.3", "@radix-ui/react-label": "^2.0.0", "@radix-ui/react-menubar": "^1.0.0", + "@radix-ui/react-navigation-menu": "^1.1.1", "@radix-ui/react-popover": "^1.0.2", "@radix-ui/react-progress": "^1.0.1", "@radix-ui/react-radio-group": "^1.1.0",