@arolariu/components 0.0.31 → 0.0.33
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/LICENSE +21 -0
- package/changelog.md +14 -0
- package/dist/cjs/components/ui/alert-dialog.cjs.map +1 -1
- package/dist/cjs/components/ui/alert.cjs +1 -1
- package/dist/cjs/components/ui/alert.cjs.map +1 -1
- package/dist/cjs/components/ui/aspect-ratio.cjs.map +1 -1
- package/dist/cjs/components/ui/avatar.cjs.map +1 -1
- package/dist/cjs/components/ui/badge.cjs.map +1 -1
- package/dist/cjs/components/ui/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/ui/button.cjs.map +1 -1
- package/dist/cjs/components/ui/calendar.cjs.map +1 -1
- package/dist/cjs/components/ui/card.cjs.map +1 -1
- package/dist/cjs/components/ui/carousel.cjs.map +1 -1
- package/dist/cjs/components/ui/chart.cjs.map +1 -1
- package/dist/cjs/components/ui/checkbox.cjs.map +1 -1
- package/dist/cjs/components/ui/collapsible.cjs.map +1 -1
- package/dist/cjs/components/ui/command.cjs.map +1 -1
- package/dist/cjs/components/ui/context-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/drawer.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/form.cjs.map +1 -1
- package/dist/cjs/components/ui/hover-card.cjs.map +1 -1
- package/dist/cjs/components/ui/input-otp.cjs.map +1 -1
- package/dist/cjs/components/ui/input.cjs.map +1 -1
- package/dist/cjs/components/ui/label.cjs.map +1 -1
- package/dist/cjs/components/ui/menubar.cjs.map +1 -1
- package/dist/cjs/components/ui/navigation-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/pagination.cjs.map +1 -1
- package/dist/cjs/components/ui/popover.cjs.map +1 -1
- package/dist/cjs/components/ui/progress.cjs.map +1 -1
- package/dist/cjs/components/ui/radio-group.cjs.map +1 -1
- package/dist/cjs/components/ui/resizable.cjs.map +1 -1
- package/dist/cjs/components/ui/scroll-area.cjs.map +1 -1
- package/dist/cjs/components/ui/select.cjs.map +1 -1
- package/dist/cjs/components/ui/separator.cjs.map +1 -1
- package/dist/cjs/components/ui/sheet.cjs.map +1 -1
- package/dist/cjs/components/ui/sidebar.cjs.map +1 -1
- package/dist/cjs/components/ui/skeleton.cjs.map +1 -1
- package/dist/cjs/components/ui/slider.cjs.map +1 -1
- package/dist/cjs/components/ui/sonner.cjs +1 -1
- package/dist/cjs/components/ui/sonner.cjs.map +1 -1
- package/dist/cjs/components/ui/switch.cjs.map +1 -1
- package/dist/cjs/components/ui/table.cjs.map +1 -1
- package/dist/cjs/components/ui/tabs.cjs.map +1 -1
- package/dist/cjs/components/ui/textarea.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle.cjs.map +1 -1
- package/dist/cjs/components/ui/tooltip.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.css +1 -0
- package/dist/cjs/node_modules/sonner/dist/index.cjs +1 -1
- package/dist/cjs/node_modules/sonner/dist/index.cjs.map +1 -1
- package/dist/esm/components/ui/alert-dialog.js.map +1 -1
- package/dist/esm/components/ui/alert.js +8 -8
- package/dist/esm/components/ui/alert.js.map +1 -1
- package/dist/esm/components/ui/aspect-ratio.js.map +1 -1
- package/dist/esm/components/ui/avatar.js.map +1 -1
- package/dist/esm/components/ui/badge.js.map +1 -1
- package/dist/esm/components/ui/breadcrumb.js.map +1 -1
- package/dist/esm/components/ui/button.js.map +1 -1
- package/dist/esm/components/ui/calendar.js.map +1 -1
- package/dist/esm/components/ui/card.js.map +1 -1
- package/dist/esm/components/ui/carousel.js.map +1 -1
- package/dist/esm/components/ui/chart.js.map +1 -1
- package/dist/esm/components/ui/checkbox.js.map +1 -1
- package/dist/esm/components/ui/collapsible.js.map +1 -1
- package/dist/esm/components/ui/command.js.map +1 -1
- package/dist/esm/components/ui/context-menu.js.map +1 -1
- package/dist/esm/components/ui/drawer.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
- package/dist/esm/components/ui/form.js.map +1 -1
- package/dist/esm/components/ui/hover-card.js.map +1 -1
- package/dist/esm/components/ui/input-otp.js.map +1 -1
- package/dist/esm/components/ui/input.js.map +1 -1
- package/dist/esm/components/ui/label.js.map +1 -1
- package/dist/esm/components/ui/menubar.js.map +1 -1
- package/dist/esm/components/ui/navigation-menu.js.map +1 -1
- package/dist/esm/components/ui/pagination.js.map +1 -1
- package/dist/esm/components/ui/popover.js.map +1 -1
- package/dist/esm/components/ui/progress.js.map +1 -1
- package/dist/esm/components/ui/radio-group.js.map +1 -1
- package/dist/esm/components/ui/resizable.js.map +1 -1
- package/dist/esm/components/ui/scroll-area.js.map +1 -1
- package/dist/esm/components/ui/select.js.map +1 -1
- package/dist/esm/components/ui/separator.js.map +1 -1
- package/dist/esm/components/ui/sheet.js.map +1 -1
- package/dist/esm/components/ui/sidebar.js.map +1 -1
- package/dist/esm/components/ui/skeleton.js.map +1 -1
- package/dist/esm/components/ui/slider.js.map +1 -1
- package/dist/esm/components/ui/sonner.js +3 -1
- package/dist/esm/components/ui/sonner.js.map +1 -1
- package/dist/esm/components/ui/switch.js.map +1 -1
- package/dist/esm/components/ui/table.js.map +1 -1
- package/dist/esm/components/ui/tabs.js.map +1 -1
- package/dist/esm/components/ui/textarea.js.map +1 -1
- package/dist/esm/components/ui/toggle-group.js.map +1 -1
- package/dist/esm/components/ui/toggle.js.map +1 -1
- package/dist/esm/components/ui/tooltip.js.map +1 -1
- package/dist/esm/index.css +1 -0
- package/dist/esm/index.js +296 -293
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/node_modules/sonner/dist/index.js +4 -4
- package/dist/esm/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +300 -0
- package/dist/types/components/ui/alert.d.ts.map +1 -1
- package/dist/types/components/ui/form.d.ts.map +1 -1
- package/dist/types/components/ui/sonner.d.ts +2 -2
- package/dist/types/components/ui/sonner.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/package.json +77 -45
- package/src/components/ui/alert-dialog.tsx +160 -160
- package/src/components/ui/alert.tsx +2 -0
- package/src/components/ui/aspect-ratio.tsx +12 -12
- package/src/components/ui/avatar.tsx +52 -52
- package/src/components/ui/badge.tsx +47 -47
- package/src/components/ui/breadcrumb.tsx +116 -116
- package/src/components/ui/button.tsx +60 -60
- package/src/components/ui/calendar.tsx +75 -75
- package/src/components/ui/card.tsx +79 -79
- package/src/components/ui/carousel.tsx +240 -240
- package/src/components/ui/chart.tsx +352 -352
- package/src/components/ui/checkbox.tsx +31 -31
- package/src/components/ui/collapsible.tsx +34 -34
- package/src/components/ui/command.tsx +176 -176
- package/src/components/ui/context-menu.tsx +254 -254
- package/src/components/ui/drawer.tsx +137 -137
- package/src/components/ui/dropdown-menu.tsx +259 -259
- package/src/components/ui/form.tsx +173 -173
- package/src/components/ui/hover-card.tsx +41 -41
- package/src/components/ui/input-otp.tsx +77 -77
- package/src/components/ui/input.tsx +22 -22
- package/src/components/ui/label.tsx +23 -23
- package/src/components/ui/menubar.tsx +278 -278
- package/src/components/ui/navigation-menu.tsx +170 -170
- package/src/components/ui/pagination.tsx +128 -128
- package/src/components/ui/popover.tsx +47 -47
- package/src/components/ui/progress.tsx +30 -30
- package/src/components/ui/radio-group.tsx +44 -44
- package/src/components/ui/resizable.tsx +55 -55
- package/src/components/ui/scroll-area.tsx +57 -57
- package/src/components/ui/select.tsx +183 -183
- package/src/components/ui/separator.tsx +27 -27
- package/src/components/ui/sheet.tsx +144 -144
- package/src/components/ui/sidebar.tsx +725 -725
- package/src/components/ui/skeleton.tsx +17 -17
- package/src/components/ui/slider.tsx +62 -62
- package/src/components/ui/sonner.tsx +2 -2
- package/src/components/ui/switch.tsx +30 -30
- package/src/components/ui/table.tsx +118 -118
- package/src/components/ui/tabs.tsx +65 -65
- package/src/components/ui/textarea.tsx +19 -19
- package/src/components/ui/toggle-group.tsx +72 -72
- package/src/components/ui/toggle.tsx +46 -46
- package/src/components/ui/tooltip.tsx +60 -60
- package/src/index.css +3 -107
- package/src/index.ts +3 -1
- package/tailwind.config.mjs +67 -0
- package/tsconfig.json +4 -1
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
5
|
-
import { cva } from "class-variance-authority";
|
|
6
|
-
import { ChevronDownIcon } from "lucide-react";
|
|
7
|
-
import { cn } from "./../../lib/utils";
|
|
8
|
-
|
|
9
|
-
function NavigationMenu({
|
|
10
|
-
className,
|
|
11
|
-
children,
|
|
12
|
-
viewport = true,
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
15
|
-
viewport?: boolean;
|
|
16
|
-
}) {
|
|
17
|
-
return (
|
|
18
|
-
<NavigationMenuPrimitive.Root
|
|
19
|
-
data-slot="navigation-menu"
|
|
20
|
-
data-viewport={viewport}
|
|
21
|
-
className={cn(
|
|
22
|
-
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
>
|
|
27
|
-
{children}
|
|
28
|
-
{viewport && <NavigationMenuViewport />}
|
|
29
|
-
</NavigationMenuPrimitive.Root>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function NavigationMenuList({
|
|
34
|
-
className,
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
37
|
-
return (
|
|
38
|
-
<NavigationMenuPrimitive.List
|
|
39
|
-
data-slot="navigation-menu-list"
|
|
40
|
-
className={cn(
|
|
41
|
-
"group flex flex-1 list-none items-center justify-center gap-1",
|
|
42
|
-
className
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function NavigationMenuItem({
|
|
50
|
-
className,
|
|
51
|
-
...props
|
|
52
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
53
|
-
return (
|
|
54
|
-
<NavigationMenuPrimitive.Item
|
|
55
|
-
data-slot="navigation-menu-item"
|
|
56
|
-
className={cn("relative", className)}
|
|
57
|
-
{...props}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const navigationMenuTriggerStyle = cva(
|
|
63
|
-
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-white px-4 py-2 text-sm font-medium hover:bg-neutral-100 hover:text-neutral-900 focus:bg-neutral-100 focus:text-neutral-900 disabled:pointer-events-none disabled:opacity-50 data-[active=true]:bg-neutral-100/50 data-[state=open]:bg-neutral-100/50 data-[active=true]:text-neutral-900 ring-neutral-950/10 dark:ring-neutral-950/20 dark:outline-ring/40 outline-ring/50 transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[active=true]:bg-neutral-800/50 dark:data-[state=open]:bg-neutral-800/50 dark:data-[active=true]:text-neutral-50 dark:ring-neutral-300/10 dark:dark:ring-neutral-300/20"
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
function NavigationMenuTrigger({
|
|
67
|
-
className,
|
|
68
|
-
children,
|
|
69
|
-
...props
|
|
70
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
71
|
-
return (
|
|
72
|
-
<NavigationMenuPrimitive.Trigger
|
|
73
|
-
data-slot="navigation-menu-trigger"
|
|
74
|
-
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
75
|
-
{...props}
|
|
76
|
-
>
|
|
77
|
-
{children}
|
|
78
|
-
{""}
|
|
79
|
-
<ChevronDownIcon
|
|
80
|
-
className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
81
|
-
aria-hidden="true"
|
|
82
|
-
/>
|
|
83
|
-
</NavigationMenuPrimitive.Trigger>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function NavigationMenuContent({
|
|
88
|
-
className,
|
|
89
|
-
...props
|
|
90
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
91
|
-
return (
|
|
92
|
-
<NavigationMenuPrimitive.Content
|
|
93
|
-
data-slot="navigation-menu-content"
|
|
94
|
-
className={cn(
|
|
95
|
-
"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",
|
|
96
|
-
"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",
|
|
97
|
-
className
|
|
98
|
-
)}
|
|
99
|
-
{...props}
|
|
100
|
-
/>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function NavigationMenuViewport({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
108
|
-
return (
|
|
109
|
-
<div
|
|
110
|
-
className={cn(
|
|
111
|
-
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
112
|
-
)}
|
|
113
|
-
>
|
|
114
|
-
<NavigationMenuPrimitive.Viewport
|
|
115
|
-
data-slot="navigation-menu-viewport"
|
|
116
|
-
className={cn(
|
|
117
|
-
"origin-top-center bg-white text-neutral-950 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 border-neutral-200 shadow md:w-[var(--radix-navigation-menu-viewport-width)] dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
118
|
-
className
|
|
119
|
-
)}
|
|
120
|
-
{...props}
|
|
121
|
-
/>
|
|
122
|
-
</div>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function NavigationMenuLink({
|
|
127
|
-
className,
|
|
128
|
-
...props
|
|
129
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
130
|
-
return (
|
|
131
|
-
<NavigationMenuPrimitive.Link
|
|
132
|
-
data-slot="navigation-menu-link"
|
|
133
|
-
className={cn(
|
|
134
|
-
"hover:bg-neutral-100 hover:text-neutral-900 focus:bg-neutral-100 focus:text-neutral-900 data-[active=true]:bg-neutral-100/50 data-[active=true]:text-neutral-900 ring-neutral-950/10 dark:ring-neutral-950/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-neutral-500 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[active=true]:bg-neutral-800/50 dark:data-[active=true]:text-neutral-50 dark:ring-neutral-300/10 dark:dark:ring-neutral-300/20 dark:[&_svg:not([class*='text-'])]:text-neutral-400",
|
|
135
|
-
className
|
|
136
|
-
)}
|
|
137
|
-
{...props}
|
|
138
|
-
/>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function NavigationMenuIndicator({
|
|
143
|
-
className,
|
|
144
|
-
...props
|
|
145
|
-
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
146
|
-
return (
|
|
147
|
-
<NavigationMenuPrimitive.Indicator
|
|
148
|
-
data-slot="navigation-menu-indicator"
|
|
149
|
-
className={cn(
|
|
150
|
-
"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",
|
|
151
|
-
className
|
|
152
|
-
)}
|
|
153
|
-
{...props}
|
|
154
|
-
>
|
|
155
|
-
<div className="bg-neutral-200 relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md dark:bg-neutral-800" />
|
|
156
|
-
</NavigationMenuPrimitive.Indicator>
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export {
|
|
161
|
-
NavigationMenu,
|
|
162
|
-
NavigationMenuList,
|
|
163
|
-
NavigationMenuItem,
|
|
164
|
-
NavigationMenuContent,
|
|
165
|
-
NavigationMenuTrigger,
|
|
166
|
-
NavigationMenuLink,
|
|
167
|
-
NavigationMenuIndicator,
|
|
168
|
-
NavigationMenuViewport,
|
|
169
|
-
navigationMenuTriggerStyle,
|
|
170
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
7
|
+
import { cn } from "./../../lib/utils";
|
|
8
|
+
|
|
9
|
+
function NavigationMenu({
|
|
10
|
+
className,
|
|
11
|
+
children,
|
|
12
|
+
viewport = true,
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
15
|
+
viewport?: boolean;
|
|
16
|
+
}) {
|
|
17
|
+
return (
|
|
18
|
+
<NavigationMenuPrimitive.Root
|
|
19
|
+
data-slot="navigation-menu"
|
|
20
|
+
data-viewport={viewport}
|
|
21
|
+
className={cn(
|
|
22
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
{viewport && <NavigationMenuViewport />}
|
|
29
|
+
</NavigationMenuPrimitive.Root>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function NavigationMenuList({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
37
|
+
return (
|
|
38
|
+
<NavigationMenuPrimitive.List
|
|
39
|
+
data-slot="navigation-menu-list"
|
|
40
|
+
className={cn(
|
|
41
|
+
"group flex flex-1 list-none items-center justify-center gap-1",
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function NavigationMenuItem({
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
53
|
+
return (
|
|
54
|
+
<NavigationMenuPrimitive.Item
|
|
55
|
+
data-slot="navigation-menu-item"
|
|
56
|
+
className={cn("relative", className)}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const navigationMenuTriggerStyle = cva(
|
|
63
|
+
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-white px-4 py-2 text-sm font-medium hover:bg-neutral-100 hover:text-neutral-900 focus:bg-neutral-100 focus:text-neutral-900 disabled:pointer-events-none disabled:opacity-50 data-[active=true]:bg-neutral-100/50 data-[state=open]:bg-neutral-100/50 data-[active=true]:text-neutral-900 ring-neutral-950/10 dark:ring-neutral-950/20 dark:outline-ring/40 outline-ring/50 transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[active=true]:bg-neutral-800/50 dark:data-[state=open]:bg-neutral-800/50 dark:data-[active=true]:text-neutral-50 dark:ring-neutral-300/10 dark:dark:ring-neutral-300/20"
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
function NavigationMenuTrigger({
|
|
67
|
+
className,
|
|
68
|
+
children,
|
|
69
|
+
...props
|
|
70
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
71
|
+
return (
|
|
72
|
+
<NavigationMenuPrimitive.Trigger
|
|
73
|
+
data-slot="navigation-menu-trigger"
|
|
74
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
75
|
+
{...props}
|
|
76
|
+
>
|
|
77
|
+
{children}
|
|
78
|
+
{""}
|
|
79
|
+
<ChevronDownIcon
|
|
80
|
+
className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
81
|
+
aria-hidden="true"
|
|
82
|
+
/>
|
|
83
|
+
</NavigationMenuPrimitive.Trigger>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function NavigationMenuContent({
|
|
88
|
+
className,
|
|
89
|
+
...props
|
|
90
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
91
|
+
return (
|
|
92
|
+
<NavigationMenuPrimitive.Content
|
|
93
|
+
data-slot="navigation-menu-content"
|
|
94
|
+
className={cn(
|
|
95
|
+
"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",
|
|
96
|
+
"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",
|
|
97
|
+
className
|
|
98
|
+
)}
|
|
99
|
+
{...props}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function NavigationMenuViewport({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
108
|
+
return (
|
|
109
|
+
<div
|
|
110
|
+
className={cn(
|
|
111
|
+
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
112
|
+
)}
|
|
113
|
+
>
|
|
114
|
+
<NavigationMenuPrimitive.Viewport
|
|
115
|
+
data-slot="navigation-menu-viewport"
|
|
116
|
+
className={cn(
|
|
117
|
+
"origin-top-center bg-white text-neutral-950 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 border-neutral-200 shadow md:w-[var(--radix-navigation-menu-viewport-width)] dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
118
|
+
className
|
|
119
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function NavigationMenuLink({
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
130
|
+
return (
|
|
131
|
+
<NavigationMenuPrimitive.Link
|
|
132
|
+
data-slot="navigation-menu-link"
|
|
133
|
+
className={cn(
|
|
134
|
+
"hover:bg-neutral-100 hover:text-neutral-900 focus:bg-neutral-100 focus:text-neutral-900 data-[active=true]:bg-neutral-100/50 data-[active=true]:text-neutral-900 ring-neutral-950/10 dark:ring-neutral-950/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-neutral-500 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4 dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[active=true]:bg-neutral-800/50 dark:data-[active=true]:text-neutral-50 dark:ring-neutral-300/10 dark:dark:ring-neutral-300/20 dark:[&_svg:not([class*='text-'])]:text-neutral-400",
|
|
135
|
+
className
|
|
136
|
+
)}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function NavigationMenuIndicator({
|
|
143
|
+
className,
|
|
144
|
+
...props
|
|
145
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
146
|
+
return (
|
|
147
|
+
<NavigationMenuPrimitive.Indicator
|
|
148
|
+
data-slot="navigation-menu-indicator"
|
|
149
|
+
className={cn(
|
|
150
|
+
"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",
|
|
151
|
+
className
|
|
152
|
+
)}
|
|
153
|
+
{...props}
|
|
154
|
+
>
|
|
155
|
+
<div className="bg-neutral-200 relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md dark:bg-neutral-800" />
|
|
156
|
+
</NavigationMenuPrimitive.Indicator>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
NavigationMenu,
|
|
162
|
+
NavigationMenuList,
|
|
163
|
+
NavigationMenuItem,
|
|
164
|
+
NavigationMenuContent,
|
|
165
|
+
NavigationMenuTrigger,
|
|
166
|
+
NavigationMenuLink,
|
|
167
|
+
NavigationMenuIndicator,
|
|
168
|
+
NavigationMenuViewport,
|
|
169
|
+
navigationMenuTriggerStyle,
|
|
170
|
+
};
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
ChevronLeftIcon,
|
|
6
|
-
ChevronRightIcon,
|
|
7
|
-
MoreHorizontalIcon,
|
|
8
|
-
} from "lucide-react";
|
|
9
|
-
import { cn } from "./../../lib/utils";
|
|
10
|
-
import { Button, buttonVariants } from "./button";
|
|
11
|
-
|
|
12
|
-
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
13
|
-
return (
|
|
14
|
-
<nav
|
|
15
|
-
role="navigation"
|
|
16
|
-
aria-label="pagination"
|
|
17
|
-
data-slot="pagination"
|
|
18
|
-
className={cn("mx-auto flex w-full justify-center", className)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function PaginationContent({
|
|
25
|
-
className,
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<"ul">) {
|
|
28
|
-
return (
|
|
29
|
-
<ul
|
|
30
|
-
data-slot="pagination-content"
|
|
31
|
-
className={cn("flex flex-row items-center gap-1", className)}
|
|
32
|
-
{...props}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
38
|
-
return <li data-slot="pagination-item" {...props} />;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
type PaginationLinkProps = {
|
|
42
|
-
isActive?: boolean;
|
|
43
|
-
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
44
|
-
React.ComponentProps<"a">;
|
|
45
|
-
|
|
46
|
-
function PaginationLink({
|
|
47
|
-
className,
|
|
48
|
-
isActive,
|
|
49
|
-
size = "icon",
|
|
50
|
-
...props
|
|
51
|
-
}: PaginationLinkProps) {
|
|
52
|
-
return (
|
|
53
|
-
<a
|
|
54
|
-
aria-current={isActive ? "page" : undefined}
|
|
55
|
-
data-slot="pagination-link"
|
|
56
|
-
data-active={isActive}
|
|
57
|
-
className={cn(
|
|
58
|
-
buttonVariants({
|
|
59
|
-
variant: isActive ? "outline" : "ghost",
|
|
60
|
-
size,
|
|
61
|
-
}),
|
|
62
|
-
className
|
|
63
|
-
)}
|
|
64
|
-
{...props}
|
|
65
|
-
/>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function PaginationPrevious({
|
|
70
|
-
className,
|
|
71
|
-
...props
|
|
72
|
-
}: React.ComponentProps<typeof PaginationLink>) {
|
|
73
|
-
return (
|
|
74
|
-
<PaginationLink
|
|
75
|
-
aria-label="Go to previous page"
|
|
76
|
-
size="default"
|
|
77
|
-
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
78
|
-
{...props}
|
|
79
|
-
>
|
|
80
|
-
<ChevronLeftIcon />
|
|
81
|
-
<span className="hidden sm:block">Previous</span>
|
|
82
|
-
</PaginationLink>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function PaginationNext({
|
|
87
|
-
className,
|
|
88
|
-
...props
|
|
89
|
-
}: React.ComponentProps<typeof PaginationLink>) {
|
|
90
|
-
return (
|
|
91
|
-
<PaginationLink
|
|
92
|
-
aria-label="Go to next page"
|
|
93
|
-
size="default"
|
|
94
|
-
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
95
|
-
{...props}
|
|
96
|
-
>
|
|
97
|
-
<span className="hidden sm:block">Next</span>
|
|
98
|
-
<ChevronRightIcon />
|
|
99
|
-
</PaginationLink>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function PaginationEllipsis({
|
|
104
|
-
className,
|
|
105
|
-
...props
|
|
106
|
-
}: React.ComponentProps<"span">) {
|
|
107
|
-
return (
|
|
108
|
-
<span
|
|
109
|
-
aria-hidden
|
|
110
|
-
data-slot="pagination-ellipsis"
|
|
111
|
-
className={cn("flex size-9 items-center justify-center", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
>
|
|
114
|
-
<MoreHorizontalIcon className="size-4" />
|
|
115
|
-
<span className="sr-only">More pages</span>
|
|
116
|
-
</span>
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export {
|
|
121
|
-
Pagination,
|
|
122
|
-
PaginationContent,
|
|
123
|
-
PaginationLink,
|
|
124
|
-
PaginationItem,
|
|
125
|
-
PaginationPrevious,
|
|
126
|
-
PaginationNext,
|
|
127
|
-
PaginationEllipsis,
|
|
128
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
ChevronLeftIcon,
|
|
6
|
+
ChevronRightIcon,
|
|
7
|
+
MoreHorizontalIcon,
|
|
8
|
+
} from "lucide-react";
|
|
9
|
+
import { cn } from "./../../lib/utils";
|
|
10
|
+
import { Button, buttonVariants } from "./button";
|
|
11
|
+
|
|
12
|
+
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
13
|
+
return (
|
|
14
|
+
<nav
|
|
15
|
+
role="navigation"
|
|
16
|
+
aria-label="pagination"
|
|
17
|
+
data-slot="pagination"
|
|
18
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function PaginationContent({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<"ul">) {
|
|
28
|
+
return (
|
|
29
|
+
<ul
|
|
30
|
+
data-slot="pagination-content"
|
|
31
|
+
className={cn("flex flex-row items-center gap-1", className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
38
|
+
return <li data-slot="pagination-item" {...props} />;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type PaginationLinkProps = {
|
|
42
|
+
isActive?: boolean;
|
|
43
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
44
|
+
React.ComponentProps<"a">;
|
|
45
|
+
|
|
46
|
+
function PaginationLink({
|
|
47
|
+
className,
|
|
48
|
+
isActive,
|
|
49
|
+
size = "icon",
|
|
50
|
+
...props
|
|
51
|
+
}: PaginationLinkProps) {
|
|
52
|
+
return (
|
|
53
|
+
<a
|
|
54
|
+
aria-current={isActive ? "page" : undefined}
|
|
55
|
+
data-slot="pagination-link"
|
|
56
|
+
data-active={isActive}
|
|
57
|
+
className={cn(
|
|
58
|
+
buttonVariants({
|
|
59
|
+
variant: isActive ? "outline" : "ghost",
|
|
60
|
+
size,
|
|
61
|
+
}),
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function PaginationPrevious({
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
73
|
+
return (
|
|
74
|
+
<PaginationLink
|
|
75
|
+
aria-label="Go to previous page"
|
|
76
|
+
size="default"
|
|
77
|
+
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
78
|
+
{...props}
|
|
79
|
+
>
|
|
80
|
+
<ChevronLeftIcon />
|
|
81
|
+
<span className="hidden sm:block">Previous</span>
|
|
82
|
+
</PaginationLink>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function PaginationNext({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
90
|
+
return (
|
|
91
|
+
<PaginationLink
|
|
92
|
+
aria-label="Go to next page"
|
|
93
|
+
size="default"
|
|
94
|
+
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
95
|
+
{...props}
|
|
96
|
+
>
|
|
97
|
+
<span className="hidden sm:block">Next</span>
|
|
98
|
+
<ChevronRightIcon />
|
|
99
|
+
</PaginationLink>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function PaginationEllipsis({
|
|
104
|
+
className,
|
|
105
|
+
...props
|
|
106
|
+
}: React.ComponentProps<"span">) {
|
|
107
|
+
return (
|
|
108
|
+
<span
|
|
109
|
+
aria-hidden
|
|
110
|
+
data-slot="pagination-ellipsis"
|
|
111
|
+
className={cn("flex size-9 items-center justify-center", className)}
|
|
112
|
+
{...props}
|
|
113
|
+
>
|
|
114
|
+
<MoreHorizontalIcon className="size-4" />
|
|
115
|
+
<span className="sr-only">More pages</span>
|
|
116
|
+
</span>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
Pagination,
|
|
122
|
+
PaginationContent,
|
|
123
|
+
PaginationLink,
|
|
124
|
+
PaginationItem,
|
|
125
|
+
PaginationPrevious,
|
|
126
|
+
PaginationNext,
|
|
127
|
+
PaginationEllipsis,
|
|
128
|
+
};
|