ui-arreya-components 0.0.1

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 (87) hide show
  1. package/.storybook/main.ts +18 -0
  2. package/.storybook/preview.ts +16 -0
  3. package/.storybook/vitest.setup.ts +9 -0
  4. package/README.md +54 -0
  5. package/components.json +21 -0
  6. package/dist/styles.css +3 -0
  7. package/dist/ui.cjs.js +31 -0
  8. package/dist/ui.es.js +3060 -0
  9. package/dist/ui.umd.js +31 -0
  10. package/eslint.config.js +28 -0
  11. package/package.json +120 -0
  12. package/postcss.config.js +6 -0
  13. package/scripts/template.sh +57 -0
  14. package/src/components/feature/login-form.stories.tsx +35 -0
  15. package/src/components/feature/login-form.tsx +97 -0
  16. package/src/components/index.ts +1 -0
  17. package/src/components/ui/accordion.stories.tsx.disabled +36 -0
  18. package/src/components/ui/accordion.tsx +55 -0
  19. package/src/components/ui/alert-dialog.stories.tsx +46 -0
  20. package/src/components/ui/alert-dialog.tsx +139 -0
  21. package/src/components/ui/alert.stories.tsx +45 -0
  22. package/src/components/ui/alert.tsx +59 -0
  23. package/src/components/ui/aspect-ratio.stories.tsx +24 -0
  24. package/src/components/ui/aspect-ratio.tsx +5 -0
  25. package/src/components/ui/avatar.stories.tsx +29 -0
  26. package/src/components/ui/avatar.tsx +48 -0
  27. package/src/components/ui/badge.stories.tsx +43 -0
  28. package/src/components/ui/badge.tsx +36 -0
  29. package/src/components/ui/breadcrumb.stories.tsx +146 -0
  30. package/src/components/ui/breadcrumb.tsx +115 -0
  31. package/src/components/ui/button.stories.tsx +87 -0
  32. package/src/components/ui/button.tsx +57 -0
  33. package/src/components/ui/card.stories.tsx +99 -0
  34. package/src/components/ui/card.tsx +76 -0
  35. package/src/components/ui/carousel.stories.tsx +47 -0
  36. package/src/components/ui/carousel.tsx +260 -0
  37. package/src/components/ui/chart.tsx +363 -0
  38. package/src/components/ui/checkbox.tsx +28 -0
  39. package/src/components/ui/collapsible.tsx +9 -0
  40. package/src/components/ui/context-menu.tsx +198 -0
  41. package/src/components/ui/dialog.tsx +120 -0
  42. package/src/components/ui/drawer.tsx +116 -0
  43. package/src/components/ui/dropdown-menu.stories.tsx +92 -0
  44. package/src/components/ui/dropdown-menu.tsx +199 -0
  45. package/src/components/ui/form.tsx +176 -0
  46. package/src/components/ui/hover-card.tsx +27 -0
  47. package/src/components/ui/index.ts +1 -0
  48. package/src/components/ui/input-otp.tsx +69 -0
  49. package/src/components/ui/input.tsx +22 -0
  50. package/src/components/ui/label.tsx +24 -0
  51. package/src/components/ui/menubar.tsx +254 -0
  52. package/src/components/ui/navigation-menu.tsx +128 -0
  53. package/src/components/ui/pagination.tsx +117 -0
  54. package/src/components/ui/popover.tsx +31 -0
  55. package/src/components/ui/progress.tsx +26 -0
  56. package/src/components/ui/radio-group.tsx +42 -0
  57. package/src/components/ui/resizable.tsx +43 -0
  58. package/src/components/ui/scroll-area.tsx +46 -0
  59. package/src/components/ui/select.tsx +157 -0
  60. package/src/components/ui/separator.tsx +29 -0
  61. package/src/components/ui/sheet.tsx +140 -0
  62. package/src/components/ui/sidebar.tsx +771 -0
  63. package/src/components/ui/skeleton.tsx +15 -0
  64. package/src/components/ui/slider.tsx +26 -0
  65. package/src/components/ui/sonner.tsx +29 -0
  66. package/src/components/ui/switch.tsx +27 -0
  67. package/src/components/ui/table.tsx +120 -0
  68. package/src/components/ui/tabs.tsx +53 -0
  69. package/src/components/ui/textarea.tsx +22 -0
  70. package/src/components/ui/toast.tsx +127 -0
  71. package/src/components/ui/toaster.tsx +33 -0
  72. package/src/components/ui/toggle-group.tsx +59 -0
  73. package/src/components/ui/toggle.tsx +43 -0
  74. package/src/components/ui/tooltip.tsx +30 -0
  75. package/src/hooks/use-mobile.tsx +19 -0
  76. package/src/hooks/use-toast.ts +194 -0
  77. package/src/index.css +3484 -0
  78. package/src/index.ts +1 -0
  79. package/src/lib/types.ts +5 -0
  80. package/src/lib/utils.ts +6 -0
  81. package/src/styles/tailwind.css +86 -0
  82. package/tailwind.config.js +96 -0
  83. package/tsconfig.app.json +30 -0
  84. package/tsconfig.json +13 -0
  85. package/tsconfig.node.json +24 -0
  86. package/vite.config.ts +33 -0
  87. package/vitest.workspace.ts +32 -0
@@ -0,0 +1,27 @@
1
+ import * as React from "react"
2
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ const HoverCard = HoverCardPrimitive.Root
7
+
8
+ const HoverCardTrigger = HoverCardPrimitive.Trigger
9
+
10
+ const HoverCardContent = React.forwardRef<
11
+ React.ElementRef<typeof HoverCardPrimitive.Content>,
12
+ React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
13
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
+ <HoverCardPrimitive.Content
15
+ ref={ref}
16
+ align={align}
17
+ sideOffset={sideOffset}
18
+ className={cn(
19
+ "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-hover-card-content-transform-origin]",
20
+ className
21
+ )}
22
+ {...props}
23
+ />
24
+ ))
25
+ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName
26
+
27
+ export { HoverCard, HoverCardTrigger, HoverCardContent }
@@ -0,0 +1 @@
1
+ export * from './accordion'
@@ -0,0 +1,69 @@
1
+ import * as React from "react"
2
+ import { OTPInput, OTPInputContext } from "input-otp"
3
+ import { Minus } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const InputOTP = React.forwardRef<
8
+ React.ElementRef<typeof OTPInput>,
9
+ React.ComponentPropsWithoutRef<typeof OTPInput>
10
+ >(({ className, containerClassName, ...props }, ref) => (
11
+ <OTPInput
12
+ ref={ref}
13
+ containerClassName={cn(
14
+ "flex items-center gap-2 has-[:disabled]:opacity-50",
15
+ containerClassName
16
+ )}
17
+ className={cn("disabled:cursor-not-allowed", className)}
18
+ {...props}
19
+ />
20
+ ))
21
+ InputOTP.displayName = "InputOTP"
22
+
23
+ const InputOTPGroup = React.forwardRef<
24
+ React.ElementRef<"div">,
25
+ React.ComponentPropsWithoutRef<"div">
26
+ >(({ className, ...props }, ref) => (
27
+ <div ref={ref} className={cn("flex items-center", className)} {...props} />
28
+ ))
29
+ InputOTPGroup.displayName = "InputOTPGroup"
30
+
31
+ const InputOTPSlot = React.forwardRef<
32
+ React.ElementRef<"div">,
33
+ React.ComponentPropsWithoutRef<"div"> & { index: number }
34
+ >(({ index, className, ...props }, ref) => {
35
+ const inputOTPContext = React.useContext(OTPInputContext)
36
+ const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]
37
+
38
+ return (
39
+ <div
40
+ ref={ref}
41
+ className={cn(
42
+ "relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
43
+ isActive && "z-10 ring-1 ring-ring",
44
+ className
45
+ )}
46
+ {...props}
47
+ >
48
+ {char}
49
+ {hasFakeCaret && (
50
+ <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
51
+ <div className="h-4 w-px animate-caret-blink bg-foreground duration-1000" />
52
+ </div>
53
+ )}
54
+ </div>
55
+ )
56
+ })
57
+ InputOTPSlot.displayName = "InputOTPSlot"
58
+
59
+ const InputOTPSeparator = React.forwardRef<
60
+ React.ElementRef<"div">,
61
+ React.ComponentPropsWithoutRef<"div">
62
+ >(({ ...props }, ref) => (
63
+ <div ref={ref} role="separator" {...props}>
64
+ <Minus />
65
+ </div>
66
+ ))
67
+ InputOTPSeparator.displayName = "InputOTPSeparator"
68
+
69
+ export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
@@ -0,0 +1,22 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
6
+ ({ className, type, ...props }, ref) => {
7
+ return (
8
+ <input
9
+ type={type}
10
+ className={cn(
11
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
+ className
13
+ )}
14
+ ref={ref}
15
+ {...props}
16
+ />
17
+ )
18
+ }
19
+ )
20
+ Input.displayName = "Input"
21
+
22
+ export { Input }
@@ -0,0 +1,24 @@
1
+ import * as React from "react"
2
+ import * as LabelPrimitive from "@radix-ui/react-label"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const labelVariants = cva(
8
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
+ )
10
+
11
+ const Label = React.forwardRef<
12
+ React.ElementRef<typeof LabelPrimitive.Root>,
13
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
+ VariantProps<typeof labelVariants>
15
+ >(({ className, ...props }, ref) => (
16
+ <LabelPrimitive.Root
17
+ ref={ref}
18
+ className={cn(labelVariants(), className)}
19
+ {...props}
20
+ />
21
+ ))
22
+ Label.displayName = LabelPrimitive.Root.displayName
23
+
24
+ export { Label }
@@ -0,0 +1,254 @@
1
+ import * as React from "react"
2
+ import * as MenubarPrimitive from "@radix-ui/react-menubar"
3
+ import { Check, ChevronRight, Circle } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function MenubarMenu({
8
+ ...props
9
+ }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
10
+ return <MenubarPrimitive.Menu {...props} />
11
+ }
12
+
13
+ function MenubarGroup({
14
+ ...props
15
+ }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
16
+ return <MenubarPrimitive.Group {...props} />
17
+ }
18
+
19
+ function MenubarPortal({
20
+ ...props
21
+ }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
22
+ return <MenubarPrimitive.Portal {...props} />
23
+ }
24
+
25
+ function MenubarRadioGroup({
26
+ ...props
27
+ }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
28
+ return <MenubarPrimitive.RadioGroup {...props} />
29
+ }
30
+
31
+ function MenubarSub({
32
+ ...props
33
+ }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
34
+ return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
35
+ }
36
+
37
+ const Menubar = React.forwardRef<
38
+ React.ElementRef<typeof MenubarPrimitive.Root>,
39
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
40
+ >(({ className, ...props }, ref) => (
41
+ <MenubarPrimitive.Root
42
+ ref={ref}
43
+ className={cn(
44
+ "flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",
45
+ className
46
+ )}
47
+ {...props}
48
+ />
49
+ ))
50
+ Menubar.displayName = MenubarPrimitive.Root.displayName
51
+
52
+ const MenubarTrigger = React.forwardRef<
53
+ React.ElementRef<typeof MenubarPrimitive.Trigger>,
54
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
55
+ >(({ className, ...props }, ref) => (
56
+ <MenubarPrimitive.Trigger
57
+ ref={ref}
58
+ className={cn(
59
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
60
+ className
61
+ )}
62
+ {...props}
63
+ />
64
+ ))
65
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
66
+
67
+ const MenubarSubTrigger = React.forwardRef<
68
+ React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
69
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
70
+ inset?: boolean
71
+ }
72
+ >(({ className, inset, children, ...props }, ref) => (
73
+ <MenubarPrimitive.SubTrigger
74
+ ref={ref}
75
+ className={cn(
76
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
77
+ inset && "pl-8",
78
+ className
79
+ )}
80
+ {...props}
81
+ >
82
+ {children}
83
+ <ChevronRight className="ml-auto h-4 w-4" />
84
+ </MenubarPrimitive.SubTrigger>
85
+ ))
86
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
87
+
88
+ const MenubarSubContent = React.forwardRef<
89
+ React.ElementRef<typeof MenubarPrimitive.SubContent>,
90
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
91
+ >(({ className, ...props }, ref) => (
92
+ <MenubarPrimitive.SubContent
93
+ ref={ref}
94
+ className={cn(
95
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[--radix-menubar-content-transform-origin]",
96
+ className
97
+ )}
98
+ {...props}
99
+ />
100
+ ))
101
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
102
+
103
+ const MenubarContent = React.forwardRef<
104
+ React.ElementRef<typeof MenubarPrimitive.Content>,
105
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
106
+ >(
107
+ (
108
+ { className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
109
+ ref
110
+ ) => (
111
+ <MenubarPrimitive.Portal>
112
+ <MenubarPrimitive.Content
113
+ ref={ref}
114
+ align={align}
115
+ alignOffset={alignOffset}
116
+ sideOffset={sideOffset}
117
+ className={cn(
118
+ "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 origin-[--radix-menubar-content-transform-origin]",
119
+ className
120
+ )}
121
+ {...props}
122
+ />
123
+ </MenubarPrimitive.Portal>
124
+ )
125
+ )
126
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName
127
+
128
+ const MenubarItem = React.forwardRef<
129
+ React.ElementRef<typeof MenubarPrimitive.Item>,
130
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
131
+ inset?: boolean
132
+ }
133
+ >(({ className, inset, ...props }, ref) => (
134
+ <MenubarPrimitive.Item
135
+ ref={ref}
136
+ className={cn(
137
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
138
+ inset && "pl-8",
139
+ className
140
+ )}
141
+ {...props}
142
+ />
143
+ ))
144
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName
145
+
146
+ const MenubarCheckboxItem = React.forwardRef<
147
+ React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
148
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
149
+ >(({ className, children, checked, ...props }, ref) => (
150
+ <MenubarPrimitive.CheckboxItem
151
+ ref={ref}
152
+ className={cn(
153
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
154
+ className
155
+ )}
156
+ checked={checked}
157
+ {...props}
158
+ >
159
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
160
+ <MenubarPrimitive.ItemIndicator>
161
+ <Check className="h-4 w-4" />
162
+ </MenubarPrimitive.ItemIndicator>
163
+ </span>
164
+ {children}
165
+ </MenubarPrimitive.CheckboxItem>
166
+ ))
167
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
168
+
169
+ const MenubarRadioItem = React.forwardRef<
170
+ React.ElementRef<typeof MenubarPrimitive.RadioItem>,
171
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
172
+ >(({ className, children, ...props }, ref) => (
173
+ <MenubarPrimitive.RadioItem
174
+ ref={ref}
175
+ className={cn(
176
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
177
+ className
178
+ )}
179
+ {...props}
180
+ >
181
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
182
+ <MenubarPrimitive.ItemIndicator>
183
+ <Circle className="h-4 w-4 fill-current" />
184
+ </MenubarPrimitive.ItemIndicator>
185
+ </span>
186
+ {children}
187
+ </MenubarPrimitive.RadioItem>
188
+ ))
189
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
190
+
191
+ const MenubarLabel = React.forwardRef<
192
+ React.ElementRef<typeof MenubarPrimitive.Label>,
193
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
194
+ inset?: boolean
195
+ }
196
+ >(({ className, inset, ...props }, ref) => (
197
+ <MenubarPrimitive.Label
198
+ ref={ref}
199
+ className={cn(
200
+ "px-2 py-1.5 text-sm font-semibold",
201
+ inset && "pl-8",
202
+ className
203
+ )}
204
+ {...props}
205
+ />
206
+ ))
207
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName
208
+
209
+ const MenubarSeparator = React.forwardRef<
210
+ React.ElementRef<typeof MenubarPrimitive.Separator>,
211
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
212
+ >(({ className, ...props }, ref) => (
213
+ <MenubarPrimitive.Separator
214
+ ref={ref}
215
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
216
+ {...props}
217
+ />
218
+ ))
219
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
220
+
221
+ const MenubarShortcut = ({
222
+ className,
223
+ ...props
224
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
225
+ return (
226
+ <span
227
+ className={cn(
228
+ "ml-auto text-xs tracking-widest text-muted-foreground",
229
+ className
230
+ )}
231
+ {...props}
232
+ />
233
+ )
234
+ }
235
+ MenubarShortcut.displayname = "MenubarShortcut"
236
+
237
+ export {
238
+ Menubar,
239
+ MenubarMenu,
240
+ MenubarTrigger,
241
+ MenubarContent,
242
+ MenubarItem,
243
+ MenubarSeparator,
244
+ MenubarLabel,
245
+ MenubarCheckboxItem,
246
+ MenubarRadioGroup,
247
+ MenubarRadioItem,
248
+ MenubarPortal,
249
+ MenubarSubContent,
250
+ MenubarSubTrigger,
251
+ MenubarGroup,
252
+ MenubarSub,
253
+ MenubarShortcut,
254
+ }
@@ -0,0 +1,128 @@
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 { ChevronDown } from "lucide-react"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const NavigationMenu = React.forwardRef<
9
+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
11
+ >(({ className, children, ...props }, ref) => (
12
+ <NavigationMenuPrimitive.Root
13
+ ref={ref}
14
+ className={cn(
15
+ "relative z-10 flex max-w-max flex-1 items-center justify-center",
16
+ className
17
+ )}
18
+ {...props}
19
+ >
20
+ {children}
21
+ <NavigationMenuViewport />
22
+ </NavigationMenuPrimitive.Root>
23
+ ))
24
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
25
+
26
+ const NavigationMenuList = React.forwardRef<
27
+ React.ElementRef<typeof NavigationMenuPrimitive.List>,
28
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
29
+ >(({ className, ...props }, ref) => (
30
+ <NavigationMenuPrimitive.List
31
+ ref={ref}
32
+ className={cn(
33
+ "group flex flex-1 list-none items-center justify-center space-x-1",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
38
+ ))
39
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
40
+
41
+ const NavigationMenuItem = NavigationMenuPrimitive.Item
42
+
43
+ const navigationMenuTriggerStyle = cva(
44
+ "group inline-flex h-9 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-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
45
+ )
46
+
47
+ const NavigationMenuTrigger = React.forwardRef<
48
+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
49
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
50
+ >(({ className, children, ...props }, ref) => (
51
+ <NavigationMenuPrimitive.Trigger
52
+ ref={ref}
53
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
54
+ {...props}
55
+ >
56
+ {children}{" "}
57
+ <ChevronDown
58
+ className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
59
+ aria-hidden="true"
60
+ />
61
+ </NavigationMenuPrimitive.Trigger>
62
+ ))
63
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
64
+
65
+ const NavigationMenuContent = React.forwardRef<
66
+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,
67
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
68
+ >(({ className, ...props }, ref) => (
69
+ <NavigationMenuPrimitive.Content
70
+ ref={ref}
71
+ className={cn(
72
+ "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-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 ",
73
+ className
74
+ )}
75
+ {...props}
76
+ />
77
+ ))
78
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
79
+
80
+ const NavigationMenuLink = NavigationMenuPrimitive.Link
81
+
82
+ const NavigationMenuViewport = React.forwardRef<
83
+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
84
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
85
+ >(({ className, ...props }, ref) => (
86
+ <div className={cn("absolute left-0 top-full flex justify-center")}>
87
+ <NavigationMenuPrimitive.Viewport
88
+ className={cn(
89
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
90
+ className
91
+ )}
92
+ ref={ref}
93
+ {...props}
94
+ />
95
+ </div>
96
+ ))
97
+ NavigationMenuViewport.displayName =
98
+ NavigationMenuPrimitive.Viewport.displayName
99
+
100
+ const NavigationMenuIndicator = React.forwardRef<
101
+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
102
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
103
+ >(({ className, ...props }, ref) => (
104
+ <NavigationMenuPrimitive.Indicator
105
+ ref={ref}
106
+ className={cn(
107
+ "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",
108
+ className
109
+ )}
110
+ {...props}
111
+ >
112
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
113
+ </NavigationMenuPrimitive.Indicator>
114
+ ))
115
+ NavigationMenuIndicator.displayName =
116
+ NavigationMenuPrimitive.Indicator.displayName
117
+
118
+ export {
119
+ navigationMenuTriggerStyle,
120
+ NavigationMenu,
121
+ NavigationMenuList,
122
+ NavigationMenuItem,
123
+ NavigationMenuContent,
124
+ NavigationMenuTrigger,
125
+ NavigationMenuLink,
126
+ NavigationMenuIndicator,
127
+ NavigationMenuViewport,
128
+ }
@@ -0,0 +1,117 @@
1
+ import * as React from "react"
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
3
+
4
+ import { cn } from "@/lib/utils"
5
+ import { ButtonProps, buttonVariants } from "@/components/ui/button"
6
+
7
+ const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
8
+ <nav
9
+ role="navigation"
10
+ aria-label="pagination"
11
+ className={cn("mx-auto flex w-full justify-center", className)}
12
+ {...props}
13
+ />
14
+ )
15
+ Pagination.displayName = "Pagination"
16
+
17
+ const PaginationContent = React.forwardRef<
18
+ HTMLUListElement,
19
+ React.ComponentProps<"ul">
20
+ >(({ className, ...props }, ref) => (
21
+ <ul
22
+ ref={ref}
23
+ className={cn("flex flex-row items-center gap-1", className)}
24
+ {...props}
25
+ />
26
+ ))
27
+ PaginationContent.displayName = "PaginationContent"
28
+
29
+ const PaginationItem = React.forwardRef<
30
+ HTMLLIElement,
31
+ React.ComponentProps<"li">
32
+ >(({ className, ...props }, ref) => (
33
+ <li ref={ref} className={cn("", className)} {...props} />
34
+ ))
35
+ PaginationItem.displayName = "PaginationItem"
36
+
37
+ type PaginationLinkProps = {
38
+ isActive?: boolean
39
+ } & Pick<ButtonProps, "size"> &
40
+ React.ComponentProps<"a">
41
+
42
+ const PaginationLink = ({
43
+ className,
44
+ isActive,
45
+ size = "icon",
46
+ ...props
47
+ }: PaginationLinkProps) => (
48
+ <a
49
+ aria-current={isActive ? "page" : undefined}
50
+ className={cn(
51
+ buttonVariants({
52
+ variant: isActive ? "outline" : "ghost",
53
+ size,
54
+ }),
55
+ className
56
+ )}
57
+ {...props}
58
+ />
59
+ )
60
+ PaginationLink.displayName = "PaginationLink"
61
+
62
+ const PaginationPrevious = ({
63
+ className,
64
+ ...props
65
+ }: React.ComponentProps<typeof PaginationLink>) => (
66
+ <PaginationLink
67
+ aria-label="Go to previous page"
68
+ size="default"
69
+ className={cn("gap-1 pl-2.5", className)}
70
+ {...props}
71
+ >
72
+ <ChevronLeft className="h-4 w-4" />
73
+ <span>Previous</span>
74
+ </PaginationLink>
75
+ )
76
+ PaginationPrevious.displayName = "PaginationPrevious"
77
+
78
+ const PaginationNext = ({
79
+ className,
80
+ ...props
81
+ }: React.ComponentProps<typeof PaginationLink>) => (
82
+ <PaginationLink
83
+ aria-label="Go to next page"
84
+ size="default"
85
+ className={cn("gap-1 pr-2.5", className)}
86
+ {...props}
87
+ >
88
+ <span>Next</span>
89
+ <ChevronRight className="h-4 w-4" />
90
+ </PaginationLink>
91
+ )
92
+ PaginationNext.displayName = "PaginationNext"
93
+
94
+ const PaginationEllipsis = ({
95
+ className,
96
+ ...props
97
+ }: React.ComponentProps<"span">) => (
98
+ <span
99
+ aria-hidden
100
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
101
+ {...props}
102
+ >
103
+ <MoreHorizontal className="h-4 w-4" />
104
+ <span className="sr-only">More pages</span>
105
+ </span>
106
+ )
107
+ PaginationEllipsis.displayName = "PaginationEllipsis"
108
+
109
+ export {
110
+ Pagination,
111
+ PaginationContent,
112
+ PaginationLink,
113
+ PaginationItem,
114
+ PaginationPrevious,
115
+ PaginationNext,
116
+ PaginationEllipsis,
117
+ }
@@ -0,0 +1,31 @@
1
+ import * as React from "react"
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ const Popover = PopoverPrimitive.Root
7
+
8
+ const PopoverTrigger = PopoverPrimitive.Trigger
9
+
10
+ const PopoverAnchor = PopoverPrimitive.Anchor
11
+
12
+ const PopoverContent = React.forwardRef<
13
+ React.ElementRef<typeof PopoverPrimitive.Content>,
14
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
15
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16
+ <PopoverPrimitive.Portal>
17
+ <PopoverPrimitive.Content
18
+ ref={ref}
19
+ align={align}
20
+ sideOffset={sideOffset}
21
+ className={cn(
22
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ </PopoverPrimitive.Portal>
28
+ ))
29
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName
30
+
31
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }