@vendure/dashboard 3.3.6-master-202507030648 → 3.3.6-master-202507030835

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.
Files changed (67) hide show
  1. package/dist/plugin/vite-plugin-vendure-dashboard.js +1 -1
  2. package/package.json +40 -27
  3. package/src/app/routes/_authenticated/_collections/collections.graphql.ts +32 -0
  4. package/src/app/routes/_authenticated/_collections/collections.tsx +153 -133
  5. package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +1 -1
  6. package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +34 -1
  7. package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +430 -0
  8. package/src/app/routes/_authenticated/_collections/components/move-single-collection.tsx +33 -0
  9. package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +8 -3
  10. package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +1 -1
  11. package/src/app/routes/_authenticated/_products/products_.$id.tsx +1 -1
  12. package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +1 -1
  13. package/src/lib/components/data-input/money-input.tsx +2 -9
  14. package/src/lib/components/data-table/data-table.tsx +1 -1
  15. package/src/lib/components/shared/form-field-wrapper.tsx +22 -13
  16. package/src/lib/components/shared/paginated-list-data-table.tsx +1 -1
  17. package/src/lib/components/ui/accordion.tsx +50 -45
  18. package/src/lib/components/ui/alert-dialog.tsx +122 -93
  19. package/src/lib/components/ui/alert.tsx +54 -48
  20. package/src/lib/components/ui/aspect-ratio.tsx +9 -0
  21. package/src/lib/components/ui/avatar.tsx +53 -0
  22. package/src/lib/components/ui/badge.tsx +37 -29
  23. package/src/lib/components/ui/breadcrumb.tsx +89 -82
  24. package/src/lib/components/ui/button.tsx +52 -51
  25. package/src/lib/components/ui/calendar.tsx +196 -435
  26. package/src/lib/components/ui/card.tsx +78 -33
  27. package/src/lib/components/ui/carousel.tsx +241 -0
  28. package/src/lib/components/ui/chart.tsx +351 -0
  29. package/src/lib/components/ui/checkbox.tsx +28 -23
  30. package/src/lib/components/ui/collapsible.tsx +0 -2
  31. package/src/lib/components/ui/command.tsx +159 -114
  32. package/src/lib/components/ui/context-menu.tsx +252 -0
  33. package/src/lib/components/ui/dialog.tsx +115 -90
  34. package/src/lib/components/ui/drawer.tsx +133 -0
  35. package/src/lib/components/ui/dropdown-menu.tsx +207 -170
  36. package/src/lib/components/ui/form.tsx +138 -114
  37. package/src/lib/components/ui/hover-card.tsx +32 -26
  38. package/src/lib/components/ui/input-otp.tsx +77 -0
  39. package/src/lib/components/ui/input.tsx +17 -15
  40. package/src/lib/components/ui/label.tsx +19 -16
  41. package/src/lib/components/ui/menubar.tsx +274 -0
  42. package/src/lib/components/ui/navigation-menu.tsx +168 -0
  43. package/src/lib/components/ui/pagination.tsx +108 -87
  44. package/src/lib/components/ui/popover.tsx +36 -28
  45. package/src/lib/components/ui/progress.tsx +29 -0
  46. package/src/lib/components/ui/radio-group.tsx +45 -0
  47. package/src/lib/components/ui/resizable.tsx +54 -0
  48. package/src/lib/components/ui/scroll-area.tsx +48 -40
  49. package/src/lib/components/ui/select.tsx +151 -129
  50. package/src/lib/components/ui/separator.tsx +22 -20
  51. package/src/lib/components/ui/sheet.tsx +110 -91
  52. package/src/lib/components/ui/sidebar.tsx +652 -622
  53. package/src/lib/components/ui/skeleton.tsx +10 -10
  54. package/src/lib/components/ui/slider.tsx +63 -0
  55. package/src/lib/components/ui/sonner.tsx +7 -11
  56. package/src/lib/components/ui/switch.tsx +27 -22
  57. package/src/lib/components/ui/table.tsx +96 -64
  58. package/src/lib/components/ui/tabs.tsx +56 -38
  59. package/src/lib/components/ui/textarea.tsx +14 -14
  60. package/src/lib/components/ui/toggle-group.tsx +73 -0
  61. package/src/lib/components/ui/toggle.tsx +45 -0
  62. package/src/lib/components/ui/tooltip.tsx +45 -37
  63. package/src/lib/framework/component-registry/component-registry.tsx +5 -3
  64. package/src/lib/framework/page/detail-page.tsx +28 -17
  65. package/src/lib/framework/page/list-page.tsx +1 -1
  66. package/src/lib/index.ts +5 -6
  67. package/vite/vite-plugin-vendure-dashboard.ts +1 -1
@@ -0,0 +1,274 @@
1
+ import * as React from "react"
2
+ import * as MenubarPrimitive from "@radix-ui/react-menubar"
3
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/vdb/lib/utils"
6
+
7
+ function Menubar({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof MenubarPrimitive.Root>) {
11
+ return (
12
+ <MenubarPrimitive.Root
13
+ data-slot="menubar"
14
+ className={cn(
15
+ "bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ function MenubarMenu({
24
+ ...props
25
+ }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
26
+ return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
27
+ }
28
+
29
+ function MenubarGroup({
30
+ ...props
31
+ }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
32
+ return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
33
+ }
34
+
35
+ function MenubarPortal({
36
+ ...props
37
+ }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
38
+ return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
39
+ }
40
+
41
+ function MenubarRadioGroup({
42
+ ...props
43
+ }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
44
+ return (
45
+ <MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
46
+ )
47
+ }
48
+
49
+ function MenubarTrigger({
50
+ className,
51
+ ...props
52
+ }: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
53
+ return (
54
+ <MenubarPrimitive.Trigger
55
+ data-slot="menubar-trigger"
56
+ className={cn(
57
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
58
+ className
59
+ )}
60
+ {...props}
61
+ />
62
+ )
63
+ }
64
+
65
+ function MenubarContent({
66
+ className,
67
+ align = "start",
68
+ alignOffset = -4,
69
+ sideOffset = 8,
70
+ ...props
71
+ }: React.ComponentProps<typeof MenubarPrimitive.Content>) {
72
+ return (
73
+ <MenubarPortal>
74
+ <MenubarPrimitive.Content
75
+ data-slot="menubar-content"
76
+ align={align}
77
+ alignOffset={alignOffset}
78
+ sideOffset={sideOffset}
79
+ className={cn(
80
+ "bg-popover text-popover-foreground data-[state=open]:animate-in 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 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",
81
+ className
82
+ )}
83
+ {...props}
84
+ />
85
+ </MenubarPortal>
86
+ )
87
+ }
88
+
89
+ function MenubarItem({
90
+ className,
91
+ inset,
92
+ variant = "default",
93
+ ...props
94
+ }: React.ComponentProps<typeof MenubarPrimitive.Item> & {
95
+ inset?: boolean
96
+ variant?: "default" | "destructive"
97
+ }) {
98
+ return (
99
+ <MenubarPrimitive.Item
100
+ data-slot="menubar-item"
101
+ data-inset={inset}
102
+ data-variant={variant}
103
+ className={cn(
104
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
105
+ className
106
+ )}
107
+ {...props}
108
+ />
109
+ )
110
+ }
111
+
112
+ function MenubarCheckboxItem({
113
+ className,
114
+ children,
115
+ checked,
116
+ ...props
117
+ }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>) {
118
+ return (
119
+ <MenubarPrimitive.CheckboxItem
120
+ data-slot="menubar-checkbox-item"
121
+ className={cn(
122
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
123
+ className
124
+ )}
125
+ checked={checked}
126
+ {...props}
127
+ >
128
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
129
+ <MenubarPrimitive.ItemIndicator>
130
+ <CheckIcon className="size-4" />
131
+ </MenubarPrimitive.ItemIndicator>
132
+ </span>
133
+ {children}
134
+ </MenubarPrimitive.CheckboxItem>
135
+ )
136
+ }
137
+
138
+ function MenubarRadioItem({
139
+ className,
140
+ children,
141
+ ...props
142
+ }: React.ComponentProps<typeof MenubarPrimitive.RadioItem>) {
143
+ return (
144
+ <MenubarPrimitive.RadioItem
145
+ data-slot="menubar-radio-item"
146
+ className={cn(
147
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
148
+ className
149
+ )}
150
+ {...props}
151
+ >
152
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
153
+ <MenubarPrimitive.ItemIndicator>
154
+ <CircleIcon className="size-2 fill-current" />
155
+ </MenubarPrimitive.ItemIndicator>
156
+ </span>
157
+ {children}
158
+ </MenubarPrimitive.RadioItem>
159
+ )
160
+ }
161
+
162
+ function MenubarLabel({
163
+ className,
164
+ inset,
165
+ ...props
166
+ }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
167
+ inset?: boolean
168
+ }) {
169
+ return (
170
+ <MenubarPrimitive.Label
171
+ data-slot="menubar-label"
172
+ data-inset={inset}
173
+ className={cn(
174
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
175
+ className
176
+ )}
177
+ {...props}
178
+ />
179
+ )
180
+ }
181
+
182
+ function MenubarSeparator({
183
+ className,
184
+ ...props
185
+ }: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
186
+ return (
187
+ <MenubarPrimitive.Separator
188
+ data-slot="menubar-separator"
189
+ className={cn("bg-border -mx-1 my-1 h-px", className)}
190
+ {...props}
191
+ />
192
+ )
193
+ }
194
+
195
+ function MenubarShortcut({
196
+ className,
197
+ ...props
198
+ }: React.ComponentProps<"span">) {
199
+ return (
200
+ <span
201
+ data-slot="menubar-shortcut"
202
+ className={cn(
203
+ "text-muted-foreground ml-auto text-xs tracking-widest",
204
+ className
205
+ )}
206
+ {...props}
207
+ />
208
+ )
209
+ }
210
+
211
+ function MenubarSub({
212
+ ...props
213
+ }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
214
+ return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
215
+ }
216
+
217
+ function MenubarSubTrigger({
218
+ className,
219
+ inset,
220
+ children,
221
+ ...props
222
+ }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
223
+ inset?: boolean
224
+ }) {
225
+ return (
226
+ <MenubarPrimitive.SubTrigger
227
+ data-slot="menubar-sub-trigger"
228
+ data-inset={inset}
229
+ className={cn(
230
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",
231
+ className
232
+ )}
233
+ {...props}
234
+ >
235
+ {children}
236
+ <ChevronRightIcon className="ml-auto h-4 w-4" />
237
+ </MenubarPrimitive.SubTrigger>
238
+ )
239
+ }
240
+
241
+ function MenubarSubContent({
242
+ className,
243
+ ...props
244
+ }: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
245
+ return (
246
+ <MenubarPrimitive.SubContent
247
+ data-slot="menubar-sub-content"
248
+ className={cn(
249
+ "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 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
250
+ className
251
+ )}
252
+ {...props}
253
+ />
254
+ )
255
+ }
256
+
257
+ export {
258
+ Menubar,
259
+ MenubarPortal,
260
+ MenubarMenu,
261
+ MenubarTrigger,
262
+ MenubarContent,
263
+ MenubarGroup,
264
+ MenubarSeparator,
265
+ MenubarLabel,
266
+ MenubarItem,
267
+ MenubarShortcut,
268
+ MenubarCheckboxItem,
269
+ MenubarRadioGroup,
270
+ MenubarRadioItem,
271
+ MenubarSub,
272
+ MenubarSubTrigger,
273
+ MenubarSubContent,
274
+ }
@@ -0,0 +1,168 @@
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 "@/vdb/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
+ >
26
+ {children}
27
+ {viewport && <NavigationMenuViewport />}
28
+ </NavigationMenuPrimitive.Root>
29
+ )
30
+ }
31
+
32
+ function NavigationMenuList({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
36
+ return (
37
+ <NavigationMenuPrimitive.List
38
+ data-slot="navigation-menu-list"
39
+ className={cn(
40
+ "group flex flex-1 list-none items-center justify-center gap-1",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ )
46
+ }
47
+
48
+ function NavigationMenuItem({
49
+ className,
50
+ ...props
51
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
52
+ return (
53
+ <NavigationMenuPrimitive.Item
54
+ data-slot="navigation-menu-item"
55
+ className={cn("relative", className)}
56
+ {...props}
57
+ />
58
+ )
59
+ }
60
+
61
+ const navigationMenuTriggerStyle = cva(
62
+ "group inline-flex h-9 w-max 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:pointer-events-none 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"
63
+ )
64
+
65
+ function NavigationMenuTrigger({
66
+ className,
67
+ children,
68
+ ...props
69
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
70
+ return (
71
+ <NavigationMenuPrimitive.Trigger
72
+ data-slot="navigation-menu-trigger"
73
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
74
+ {...props}
75
+ >
76
+ {children}{" "}
77
+ <ChevronDownIcon
78
+ className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
79
+ aria-hidden="true"
80
+ />
81
+ </NavigationMenuPrimitive.Trigger>
82
+ )
83
+ }
84
+
85
+ function NavigationMenuContent({
86
+ className,
87
+ ...props
88
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
89
+ return (
90
+ <NavigationMenuPrimitive.Content
91
+ data-slot="navigation-menu-content"
92
+ className={cn(
93
+ "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",
94
+ "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",
95
+ className
96
+ )}
97
+ {...props}
98
+ />
99
+ )
100
+ }
101
+
102
+ function NavigationMenuViewport({
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
106
+ return (
107
+ <div
108
+ className={cn(
109
+ "absolute top-full left-0 isolate z-50 flex justify-center"
110
+ )}
111
+ >
112
+ <NavigationMenuPrimitive.Viewport
113
+ data-slot="navigation-menu-viewport"
114
+ className={cn(
115
+ "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)]",
116
+ className
117
+ )}
118
+ {...props}
119
+ />
120
+ </div>
121
+ )
122
+ }
123
+
124
+ function NavigationMenuLink({
125
+ className,
126
+ ...props
127
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
128
+ return (
129
+ <NavigationMenuPrimitive.Link
130
+ data-slot="navigation-menu-link"
131
+ className={cn(
132
+ "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",
133
+ className
134
+ )}
135
+ {...props}
136
+ />
137
+ )
138
+ }
139
+
140
+ function NavigationMenuIndicator({
141
+ className,
142
+ ...props
143
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
144
+ return (
145
+ <NavigationMenuPrimitive.Indicator
146
+ data-slot="navigation-menu-indicator"
147
+ className={cn(
148
+ "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",
149
+ className
150
+ )}
151
+ {...props}
152
+ >
153
+ <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
154
+ </NavigationMenuPrimitive.Indicator>
155
+ )
156
+ }
157
+
158
+ export {
159
+ NavigationMenu,
160
+ NavigationMenuList,
161
+ NavigationMenuItem,
162
+ NavigationMenuContent,
163
+ NavigationMenuTrigger,
164
+ NavigationMenuLink,
165
+ NavigationMenuIndicator,
166
+ NavigationMenuViewport,
167
+ navigationMenuTriggerStyle,
168
+ }
@@ -1,106 +1,127 @@
1
- import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
2
- import * as React from 'react';
1
+ import * as React from "react"
2
+ import {
3
+ ChevronLeftIcon,
4
+ ChevronRightIcon,
5
+ MoreHorizontalIcon,
6
+ } from "lucide-react"
3
7
 
4
- import { Button, buttonVariants } from '@/vdb/components/ui/button.js';
5
- import { cn } from '@/vdb/lib/utils.js';
8
+ import { cn } from "@/vdb/lib/utils"
9
+ import { Button, buttonVariants } from "@/vdb/components/ui/button"
6
10
 
7
- function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
8
- return (
9
- <nav
10
- role="navigation"
11
- aria-label="pagination"
12
- data-slot="pagination"
13
- className={cn('mx-auto flex w-full justify-center', className)}
14
- {...props}
15
- />
16
- );
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
+ )
17
21
  }
18
22
 
19
- function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
20
- return (
21
- <ul
22
- data-slot="pagination-content"
23
- className={cn('flex flex-row items-center gap-1', className)}
24
- {...props}
25
- />
26
- );
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
+ )
27
34
  }
28
35
 
29
- function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
30
- return <li data-slot="pagination-item" {...props} />;
36
+ function PaginationItem({ ...props }: React.ComponentProps<"li">) {
37
+ return <li data-slot="pagination-item" {...props} />
31
38
  }
32
39
 
33
40
  type PaginationLinkProps = {
34
- isActive?: boolean;
35
- } & Pick<React.ComponentProps<typeof Button>, 'size'> &
36
- React.ComponentProps<'a'>;
41
+ isActive?: boolean
42
+ } & Pick<React.ComponentProps<typeof Button>, "size"> &
43
+ React.ComponentProps<"a">
37
44
 
38
- function PaginationLink({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) {
39
- return (
40
- <a
41
- aria-current={isActive ? 'page' : undefined}
42
- data-slot="pagination-link"
43
- data-active={isActive}
44
- className={cn(
45
- buttonVariants({
46
- variant: isActive ? 'outline' : 'ghost',
47
- size,
48
- }),
49
- className,
50
- )}
51
- {...props}
52
- />
53
- );
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
+ )
54
66
  }
55
67
 
56
- function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
57
- return (
58
- <PaginationLink
59
- aria-label="Go to previous page"
60
- size="default"
61
- className={cn('gap-1 px-2.5 sm:pl-2.5', className)}
62
- {...props}
63
- >
64
- <ChevronLeftIcon />
65
- <span className="hidden sm:block">Previous</span>
66
- </PaginationLink>
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
+ >
79
+ <ChevronLeftIcon />
80
+ <span className="hidden sm:block">Previous</span>
81
+ </PaginationLink>
82
+ )
68
83
  }
69
84
 
70
- function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
71
- return (
72
- <PaginationLink
73
- aria-label="Go to next page"
74
- size="default"
75
- className={cn('gap-1 px-2.5 sm:pr-2.5', className)}
76
- {...props}
77
- >
78
- <span className="hidden sm:block">Next</span>
79
- <ChevronRightIcon />
80
- </PaginationLink>
81
- );
85
+ function PaginationNext({
86
+ className,
87
+ ...props
88
+ }: React.ComponentProps<typeof PaginationLink>) {
89
+ return (
90
+ <PaginationLink
91
+ aria-label="Go to next page"
92
+ size="default"
93
+ className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
94
+ {...props}
95
+ >
96
+ <span className="hidden sm:block">Next</span>
97
+ <ChevronRightIcon />
98
+ </PaginationLink>
99
+ )
82
100
  }
83
101
 
84
- function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
85
- return (
86
- <span
87
- aria-hidden
88
- data-slot="pagination-ellipsis"
89
- className={cn('flex size-9 items-center justify-center', className)}
90
- {...props}
91
- >
92
- <MoreHorizontalIcon className="size-4" />
93
- <span className="sr-only">More pages</span>
94
- </span>
95
- );
102
+ function PaginationEllipsis({
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<"span">) {
106
+ return (
107
+ <span
108
+ aria-hidden
109
+ data-slot="pagination-ellipsis"
110
+ className={cn("flex size-9 items-center justify-center", className)}
111
+ {...props}
112
+ >
113
+ <MoreHorizontalIcon className="size-4" />
114
+ <span className="sr-only">More pages</span>
115
+ </span>
116
+ )
96
117
  }
97
118
 
98
119
  export {
99
- Pagination,
100
- PaginationContent,
101
- PaginationEllipsis,
102
- PaginationItem,
103
- PaginationLink,
104
- PaginationNext,
105
- PaginationPrevious,
106
- };
120
+ Pagination,
121
+ PaginationContent,
122
+ PaginationLink,
123
+ PaginationItem,
124
+ PaginationPrevious,
125
+ PaginationNext,
126
+ PaginationEllipsis,
127
+ }