@tioelvis/next-template 2.2.4 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tioelvis/next-template",
3
- "version": "2.2.4",
3
+ "version": "2.2.7",
4
4
  "description": "CLI to scaffold a Next.js + Tailwind project using shadcn/ui components",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,6 +43,7 @@
43
43
  "@radix-ui/react-hover-card": "^1.1.14",
44
44
  "@radix-ui/react-label": "^2.1.7",
45
45
  "@radix-ui/react-menubar": "^1.1.15",
46
+ "@radix-ui/react-navigation-menu": "^1.2.13",
46
47
  "@radix-ui/react-slot": "^1.2.3",
47
48
  "@tailwindcss/postcss": "^4.1.11",
48
49
  "@tanstack/react-query": "^5.83.0",
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": ["@radix-ui/react-navigation-menu"],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": []
6
+ }
@@ -0,0 +1,164 @@
1
+ import * as React from "react";
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
+ import { cva } from "class-variance-authority";
4
+ import { ChevronDownIcon } from "lucide-react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function NavigationMenu({
9
+ className,
10
+ children,
11
+ viewport = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
14
+ viewport?: boolean;
15
+ }) {
16
+ return (
17
+ <NavigationMenuPrimitive.Root
18
+ data-slot="navigation-menu"
19
+ data-viewport={viewport}
20
+ className={cn(
21
+ "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
22
+ className
23
+ )}
24
+ {...props}>
25
+ {children}
26
+ {viewport && <NavigationMenuViewport />}
27
+ </NavigationMenuPrimitive.Root>
28
+ );
29
+ }
30
+
31
+ function NavigationMenuList({
32
+ className,
33
+ ...props
34
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
35
+ return (
36
+ <NavigationMenuPrimitive.List
37
+ data-slot="navigation-menu-list"
38
+ className={cn(
39
+ "group flex flex-1 list-none items-center justify-center gap-1",
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ );
45
+ }
46
+
47
+ function NavigationMenuItem({
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
51
+ return (
52
+ <NavigationMenuPrimitive.Item
53
+ data-slot="navigation-menu-item"
54
+ className={cn("relative", className)}
55
+ {...props}
56
+ />
57
+ );
58
+ }
59
+
60
+ const navigationMenuTriggerStyle = cva(
61
+ "group inline-flex h-9 w-max cursor-pointer items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
62
+ );
63
+
64
+ function NavigationMenuTrigger({
65
+ className,
66
+ children,
67
+ ...props
68
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
69
+ return (
70
+ <NavigationMenuPrimitive.Trigger
71
+ data-slot="navigation-menu-trigger"
72
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
73
+ {...props}>
74
+ {children}{" "}
75
+ <ChevronDownIcon
76
+ className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
77
+ aria-hidden="true"
78
+ />
79
+ </NavigationMenuPrimitive.Trigger>
80
+ );
81
+ }
82
+
83
+ function NavigationMenuContent({
84
+ className,
85
+ ...props
86
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
87
+ return (
88
+ <NavigationMenuPrimitive.Content
89
+ data-slot="navigation-menu-content"
90
+ className={cn(
91
+ "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out 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 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
92
+ "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
93
+ className
94
+ )}
95
+ {...props}
96
+ />
97
+ );
98
+ }
99
+
100
+ function NavigationMenuViewport({
101
+ className,
102
+ ...props
103
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
104
+ return (
105
+ <div
106
+ className={cn(
107
+ "absolute top-full left-0 isolate z-50 flex justify-center"
108
+ )}>
109
+ <NavigationMenuPrimitive.Viewport
110
+ data-slot="navigation-menu-viewport"
111
+ className={cn(
112
+ "origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
113
+ className
114
+ )}
115
+ {...props}
116
+ />
117
+ </div>
118
+ );
119
+ }
120
+
121
+ function NavigationMenuLink({
122
+ className,
123
+ ...props
124
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
125
+ return (
126
+ <NavigationMenuPrimitive.Link
127
+ data-slot="navigation-menu-link"
128
+ className={cn(
129
+ "data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
130
+ className
131
+ )}
132
+ {...props}
133
+ />
134
+ );
135
+ }
136
+
137
+ function NavigationMenuIndicator({
138
+ className,
139
+ ...props
140
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
141
+ return (
142
+ <NavigationMenuPrimitive.Indicator
143
+ data-slot="navigation-menu-indicator"
144
+ className={cn(
145
+ "data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
146
+ className
147
+ )}
148
+ {...props}>
149
+ <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
150
+ </NavigationMenuPrimitive.Indicator>
151
+ );
152
+ }
153
+
154
+ export {
155
+ NavigationMenu,
156
+ NavigationMenuList,
157
+ NavigationMenuItem,
158
+ NavigationMenuContent,
159
+ NavigationMenuTrigger,
160
+ NavigationMenuLink,
161
+ NavigationMenuIndicator,
162
+ NavigationMenuViewport,
163
+ navigationMenuTriggerStyle,
164
+ };
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": [],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": ["button"]
6
+ }
@@ -0,0 +1,124 @@
1
+ import * as React from "react";
2
+ import {
3
+ ChevronLeftIcon,
4
+ ChevronRightIcon,
5
+ MoreHorizontalIcon,
6
+ } from "lucide-react";
7
+
8
+ import { cn } from "@/lib/utils";
9
+ import { Button, buttonVariants } from "@/components/ui/button";
10
+
11
+ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
12
+ return (
13
+ <nav
14
+ role="navigation"
15
+ aria-label="pagination"
16
+ data-slot="pagination"
17
+ className={cn("mx-auto flex w-full justify-center", className)}
18
+ {...props}
19
+ />
20
+ );
21
+ }
22
+
23
+ function PaginationContent({
24
+ className,
25
+ ...props
26
+ }: React.ComponentProps<"ul">) {
27
+ return (
28
+ <ul
29
+ data-slot="pagination-content"
30
+ className={cn("flex flex-row items-center gap-1", className)}
31
+ {...props}
32
+ />
33
+ );
34
+ }
35
+
36
+ function PaginationItem({ ...props }: React.ComponentProps<"li">) {
37
+ return <li data-slot="pagination-item" {...props} />;
38
+ }
39
+
40
+ type PaginationLinkProps = {
41
+ isActive?: boolean;
42
+ } & Pick<React.ComponentProps<typeof Button>, "size"> &
43
+ React.ComponentProps<"a">;
44
+
45
+ function PaginationLink({
46
+ className,
47
+ isActive,
48
+ size = "icon",
49
+ ...props
50
+ }: PaginationLinkProps) {
51
+ return (
52
+ <a
53
+ aria-current={isActive ? "page" : undefined}
54
+ data-slot="pagination-link"
55
+ data-active={isActive}
56
+ className={cn(
57
+ buttonVariants({
58
+ variant: isActive ? "outline" : "ghost",
59
+ size,
60
+ }),
61
+ className
62
+ )}
63
+ {...props}
64
+ />
65
+ );
66
+ }
67
+
68
+ function PaginationPrevious({
69
+ className,
70
+ ...props
71
+ }: React.ComponentProps<typeof PaginationLink>) {
72
+ return (
73
+ <PaginationLink
74
+ aria-label="Go to previous page"
75
+ size="default"
76
+ className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
77
+ {...props}>
78
+ <ChevronLeftIcon />
79
+ <span className="hidden sm:block">Previous</span>
80
+ </PaginationLink>
81
+ );
82
+ }
83
+
84
+ function PaginationNext({
85
+ className,
86
+ ...props
87
+ }: React.ComponentProps<typeof PaginationLink>) {
88
+ return (
89
+ <PaginationLink
90
+ aria-label="Go to next page"
91
+ size="default"
92
+ className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
93
+ {...props}>
94
+ <span className="hidden sm:block">Next</span>
95
+ <ChevronRightIcon />
96
+ </PaginationLink>
97
+ );
98
+ }
99
+
100
+ function PaginationEllipsis({
101
+ className,
102
+ ...props
103
+ }: React.ComponentProps<"span">) {
104
+ return (
105
+ <span
106
+ aria-hidden
107
+ data-slot="pagination-ellipsis"
108
+ className={cn("flex size-9 items-center justify-center", className)}
109
+ {...props}>
110
+ <MoreHorizontalIcon className="size-4" />
111
+ <span className="sr-only">More pages</span>
112
+ </span>
113
+ );
114
+ }
115
+
116
+ export {
117
+ Pagination,
118
+ PaginationContent,
119
+ PaginationLink,
120
+ PaginationItem,
121
+ PaginationPrevious,
122
+ PaginationNext,
123
+ PaginationEllipsis,
124
+ };
@@ -0,0 +1,6 @@
1
+ {
2
+ "dependencies": [""],
3
+ "dev_dependence": [],
4
+ "hooks": [],
5
+ "supports": ["button"]
6
+ }
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Popover({
9
+ ...props
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />;
12
+ }
13
+
14
+ function PopoverTrigger({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
18
+ return (
19
+ <PopoverPrimitive.Trigger
20
+ data-slot="popover-trigger"
21
+ className={cn("cursor-pointer", className)}
22
+ {...props}
23
+ />
24
+ );
25
+ }
26
+
27
+ function PopoverContent({
28
+ className,
29
+ align = "center",
30
+ sideOffset = 4,
31
+ ...props
32
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
33
+ return (
34
+ <PopoverPrimitive.Portal>
35
+ <PopoverPrimitive.Content
36
+ data-slot="popover-content"
37
+ align={align}
38
+ sideOffset={sideOffset}
39
+ className={cn(
40
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ </PopoverPrimitive.Portal>
46
+ );
47
+ }
48
+
49
+ function PopoverAnchor({
50
+ ...props
51
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
52
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
53
+ }
54
+
55
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
package/src/constants.js CHANGED
@@ -63,6 +63,8 @@ const COMPONENTS = [
63
63
  "input-otp",
64
64
  "label",
65
65
  "menubar",
66
+ "navigation-menu",
67
+ "pagination",
66
68
  ];
67
69
 
68
70
  export {