@arronqzy/ui 0.0.0

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 (64) hide show
  1. package/.eslintrc.cjs +10 -0
  2. package/.turbo/turbo-lint.log +4 -0
  3. package/components.json +20 -0
  4. package/dist/styles.css +3105 -0
  5. package/index.ts +7 -0
  6. package/package.json +76 -0
  7. package/postcss.config.cjs +7 -0
  8. package/scripts/sync-shadcn.mjs +144 -0
  9. package/src/hooks/use-toast.ts +194 -0
  10. package/src/lib/overlay-z-index.ts +8 -0
  11. package/src/lib/utils.ts +7 -0
  12. package/src/styles.css +89 -0
  13. package/src/theme-provider.tsx +36 -0
  14. package/src/ui/accordion.tsx +58 -0
  15. package/src/ui/alert-dialog.tsx +149 -0
  16. package/src/ui/alert.tsx +59 -0
  17. package/src/ui/aspect-ratio.tsx +7 -0
  18. package/src/ui/avatar.tsx +50 -0
  19. package/src/ui/badge.tsx +36 -0
  20. package/src/ui/breadcrumb.tsx +115 -0
  21. package/src/ui/button.tsx +56 -0
  22. package/src/ui/calendar.tsx +213 -0
  23. package/src/ui/card.tsx +79 -0
  24. package/src/ui/carousel.tsx +262 -0
  25. package/src/ui/chart.tsx +403 -0
  26. package/src/ui/checkbox.tsx +30 -0
  27. package/src/ui/collapsible.tsx +11 -0
  28. package/src/ui/command.tsx +153 -0
  29. package/src/ui/context-menu.tsx +200 -0
  30. package/src/ui/dialog.tsx +130 -0
  31. package/src/ui/drawer.tsx +124 -0
  32. package/src/ui/dropdown-menu.tsx +200 -0
  33. package/src/ui/empty.tsx +50 -0
  34. package/src/ui/form.tsx +178 -0
  35. package/src/ui/hover-card.tsx +29 -0
  36. package/src/ui/index.ts +50 -0
  37. package/src/ui/input-otp.tsx +71 -0
  38. package/src/ui/input.tsx +22 -0
  39. package/src/ui/label.tsx +26 -0
  40. package/src/ui/menubar.tsx +256 -0
  41. package/src/ui/navigation-menu.tsx +128 -0
  42. package/src/ui/pagination.tsx +117 -0
  43. package/src/ui/popover.tsx +31 -0
  44. package/src/ui/progress.tsx +28 -0
  45. package/src/ui/radio-group.tsx +44 -0
  46. package/src/ui/resizable.tsx +46 -0
  47. package/src/ui/scroll-area.tsx +48 -0
  48. package/src/ui/select.tsx +160 -0
  49. package/src/ui/separator.tsx +31 -0
  50. package/src/ui/sheet.tsx +146 -0
  51. package/src/ui/skeleton.tsx +15 -0
  52. package/src/ui/slider.tsx +28 -0
  53. package/src/ui/sonner.tsx +45 -0
  54. package/src/ui/switch.tsx +29 -0
  55. package/src/ui/table.tsx +117 -0
  56. package/src/ui/tabs.tsx +55 -0
  57. package/src/ui/textarea.tsx +22 -0
  58. package/src/ui/toast.tsx +129 -0
  59. package/src/ui/toaster.tsx +35 -0
  60. package/src/ui/toggle-group.tsx +61 -0
  61. package/src/ui/toggle.tsx +45 -0
  62. package/src/ui/tooltip.tsx +32 -0
  63. package/tailwind.config.ts +8 -0
  64. package/tsconfig.json +5 -0
@@ -0,0 +1,200 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
5
+ import { Check, ChevronRight, Circle } from "lucide-react"
6
+
7
+ import { cn } from "../lib/utils"
8
+
9
+ const ContextMenu = ContextMenuPrimitive.Root
10
+
11
+ const ContextMenuTrigger = ContextMenuPrimitive.Trigger
12
+
13
+ const ContextMenuGroup = ContextMenuPrimitive.Group
14
+
15
+ const ContextMenuPortal = ContextMenuPrimitive.Portal
16
+
17
+ const ContextMenuSub = ContextMenuPrimitive.Sub
18
+
19
+ const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup
20
+
21
+ const ContextMenuSubTrigger = React.forwardRef<
22
+ React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
23
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
24
+ inset?: boolean
25
+ }
26
+ >(({ className, inset, children, ...props }, ref) => (
27
+ <ContextMenuPrimitive.SubTrigger
28
+ ref={ref}
29
+ className={cn(
30
+ "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",
31
+ inset && "pl-8",
32
+ className
33
+ )}
34
+ {...props}
35
+ >
36
+ {children}
37
+ <ChevronRight className="ml-auto h-4 w-4" />
38
+ </ContextMenuPrimitive.SubTrigger>
39
+ ))
40
+ ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName
41
+
42
+ const ContextMenuSubContent = React.forwardRef<
43
+ React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
44
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
45
+ >(({ className, ...props }, ref) => (
46
+ <ContextMenuPrimitive.SubContent
47
+ ref={ref}
48
+ className={cn(
49
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-context-menu-content-transform-origin]",
50
+ className
51
+ )}
52
+ {...props}
53
+ />
54
+ ))
55
+ ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName
56
+
57
+ const ContextMenuContent = React.forwardRef<
58
+ React.ElementRef<typeof ContextMenuPrimitive.Content>,
59
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
60
+ >(({ className, ...props }, ref) => (
61
+ <ContextMenuPrimitive.Portal>
62
+ <ContextMenuPrimitive.Content
63
+ ref={ref}
64
+ className={cn(
65
+ "z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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-context-menu-content-transform-origin]",
66
+ className
67
+ )}
68
+ {...props}
69
+ />
70
+ </ContextMenuPrimitive.Portal>
71
+ ))
72
+ ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName
73
+
74
+ const ContextMenuItem = React.forwardRef<
75
+ React.ElementRef<typeof ContextMenuPrimitive.Item>,
76
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
77
+ inset?: boolean
78
+ }
79
+ >(({ className, inset, ...props }, ref) => (
80
+ <ContextMenuPrimitive.Item
81
+ ref={ref}
82
+ className={cn(
83
+ "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",
84
+ inset && "pl-8",
85
+ className
86
+ )}
87
+ {...props}
88
+ />
89
+ ))
90
+ ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName
91
+
92
+ const ContextMenuCheckboxItem = React.forwardRef<
93
+ React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
94
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
95
+ >(({ className, children, checked, ...props }, ref) => (
96
+ <ContextMenuPrimitive.CheckboxItem
97
+ ref={ref}
98
+ className={cn(
99
+ "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",
100
+ className
101
+ )}
102
+ checked={checked}
103
+ {...props}
104
+ >
105
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
106
+ <ContextMenuPrimitive.ItemIndicator>
107
+ <Check className="h-4 w-4" />
108
+ </ContextMenuPrimitive.ItemIndicator>
109
+ </span>
110
+ {children}
111
+ </ContextMenuPrimitive.CheckboxItem>
112
+ ))
113
+ ContextMenuCheckboxItem.displayName =
114
+ ContextMenuPrimitive.CheckboxItem.displayName
115
+
116
+ const ContextMenuRadioItem = React.forwardRef<
117
+ React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
118
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
119
+ >(({ className, children, ...props }, ref) => (
120
+ <ContextMenuPrimitive.RadioItem
121
+ ref={ref}
122
+ className={cn(
123
+ "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",
124
+ className
125
+ )}
126
+ {...props}
127
+ >
128
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
129
+ <ContextMenuPrimitive.ItemIndicator>
130
+ <Circle className="h-2 w-2 fill-current" />
131
+ </ContextMenuPrimitive.ItemIndicator>
132
+ </span>
133
+ {children}
134
+ </ContextMenuPrimitive.RadioItem>
135
+ ))
136
+ ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName
137
+
138
+ const ContextMenuLabel = React.forwardRef<
139
+ React.ElementRef<typeof ContextMenuPrimitive.Label>,
140
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
141
+ inset?: boolean
142
+ }
143
+ >(({ className, inset, ...props }, ref) => (
144
+ <ContextMenuPrimitive.Label
145
+ ref={ref}
146
+ className={cn(
147
+ "px-2 py-1.5 text-sm font-semibold text-foreground",
148
+ inset && "pl-8",
149
+ className
150
+ )}
151
+ {...props}
152
+ />
153
+ ))
154
+ ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName
155
+
156
+ const ContextMenuSeparator = React.forwardRef<
157
+ React.ElementRef<typeof ContextMenuPrimitive.Separator>,
158
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
159
+ >(({ className, ...props }, ref) => (
160
+ <ContextMenuPrimitive.Separator
161
+ ref={ref}
162
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
163
+ {...props}
164
+ />
165
+ ))
166
+ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName
167
+
168
+ const ContextMenuShortcut = ({
169
+ className,
170
+ ...props
171
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
172
+ return (
173
+ <span
174
+ className={cn(
175
+ "ml-auto text-xs tracking-widest text-muted-foreground",
176
+ className
177
+ )}
178
+ {...props}
179
+ />
180
+ )
181
+ }
182
+ ContextMenuShortcut.displayName = "ContextMenuShortcut"
183
+
184
+ export {
185
+ ContextMenu,
186
+ ContextMenuTrigger,
187
+ ContextMenuContent,
188
+ ContextMenuItem,
189
+ ContextMenuCheckboxItem,
190
+ ContextMenuRadioItem,
191
+ ContextMenuLabel,
192
+ ContextMenuSeparator,
193
+ ContextMenuShortcut,
194
+ ContextMenuGroup,
195
+ ContextMenuPortal,
196
+ ContextMenuSub,
197
+ ContextMenuSubContent,
198
+ ContextMenuSubTrigger,
199
+ ContextMenuRadioGroup,
200
+ }
@@ -0,0 +1,130 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as DialogPrimitive from "@radix-ui/react-dialog"
5
+ import { X } from "lucide-react"
6
+
7
+ import { cn } from "../lib/utils"
8
+ import {
9
+ modalContentStyle,
10
+ modalOverlayStyle,
11
+ } from "../lib/overlay-z-index"
12
+
13
+ const Dialog = DialogPrimitive.Root
14
+
15
+ const DialogTrigger = DialogPrimitive.Trigger
16
+
17
+ const DialogPortal = DialogPrimitive.Portal
18
+
19
+ const DialogClose = DialogPrimitive.Close
20
+
21
+ const DialogOverlay = React.forwardRef<
22
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
23
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
24
+ >(({ className, style, ...props }, ref) => (
25
+ <DialogPrimitive.Overlay
26
+ ref={ref}
27
+ style={{ ...modalOverlayStyle, ...style }}
28
+ className={cn(
29
+ "fixed inset-0 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
30
+ className
31
+ )}
32
+ {...props}
33
+ />
34
+ ))
35
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
36
+
37
+ const DialogContent = React.forwardRef<
38
+ React.ElementRef<typeof DialogPrimitive.Content>,
39
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
40
+ overlayClassName?: string
41
+ }
42
+ >(({ className, style, children, overlayClassName, ...props }, ref) => (
43
+ <DialogPortal>
44
+ <DialogOverlay className={overlayClassName} />
45
+ <DialogPrimitive.Content
46
+ ref={ref}
47
+ style={{ ...modalContentStyle, ...style }}
48
+ className={cn(
49
+ "fixed left-[50%] top-[50%] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
50
+ className
51
+ )}
52
+ {...props}
53
+ >
54
+ {children}
55
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
56
+ <X className="h-4 w-4" />
57
+ <span className="sr-only">Close</span>
58
+ </DialogPrimitive.Close>
59
+ </DialogPrimitive.Content>
60
+ </DialogPortal>
61
+ ))
62
+ DialogContent.displayName = DialogPrimitive.Content.displayName
63
+
64
+ const DialogHeader = ({
65
+ className,
66
+ ...props
67
+ }: React.HTMLAttributes<HTMLDivElement>) => (
68
+ <div
69
+ className={cn(
70
+ "flex flex-col space-y-1.5 text-center sm:text-left",
71
+ className
72
+ )}
73
+ {...props}
74
+ />
75
+ )
76
+ DialogHeader.displayName = "DialogHeader"
77
+
78
+ const DialogFooter = ({
79
+ className,
80
+ ...props
81
+ }: React.HTMLAttributes<HTMLDivElement>) => (
82
+ <div
83
+ className={cn(
84
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
85
+ className
86
+ )}
87
+ {...props}
88
+ />
89
+ )
90
+ DialogFooter.displayName = "DialogFooter"
91
+
92
+ const DialogTitle = React.forwardRef<
93
+ React.ElementRef<typeof DialogPrimitive.Title>,
94
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
95
+ >(({ className, ...props }, ref) => (
96
+ <DialogPrimitive.Title
97
+ ref={ref}
98
+ className={cn(
99
+ "text-lg font-semibold leading-none tracking-tight",
100
+ className
101
+ )}
102
+ {...props}
103
+ />
104
+ ))
105
+ DialogTitle.displayName = DialogPrimitive.Title.displayName
106
+
107
+ const DialogDescription = React.forwardRef<
108
+ React.ElementRef<typeof DialogPrimitive.Description>,
109
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
110
+ >(({ className, ...props }, ref) => (
111
+ <DialogPrimitive.Description
112
+ ref={ref}
113
+ className={cn("text-sm text-muted-foreground", className)}
114
+ {...props}
115
+ />
116
+ ))
117
+ DialogDescription.displayName = DialogPrimitive.Description.displayName
118
+
119
+ export {
120
+ Dialog,
121
+ DialogPortal,
122
+ DialogOverlay,
123
+ DialogClose,
124
+ DialogTrigger,
125
+ DialogContent,
126
+ DialogHeader,
127
+ DialogFooter,
128
+ DialogTitle,
129
+ DialogDescription,
130
+ }
@@ -0,0 +1,124 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Drawer as DrawerPrimitive } from "vaul"
5
+
6
+ import { cn } from "../lib/utils"
7
+ import {
8
+ modalContentStyle,
9
+ modalOverlayStyle,
10
+ } from "../lib/overlay-z-index"
11
+
12
+ const Drawer = ({
13
+ shouldScaleBackground = true,
14
+ ...props
15
+ }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
16
+ <DrawerPrimitive.Root
17
+ shouldScaleBackground={shouldScaleBackground}
18
+ {...props}
19
+ />
20
+ )
21
+ Drawer.displayName = "Drawer"
22
+
23
+ const DrawerTrigger = DrawerPrimitive.Trigger
24
+
25
+ const DrawerPortal = DrawerPrimitive.Portal
26
+
27
+ const DrawerClose = DrawerPrimitive.Close
28
+
29
+ const DrawerOverlay = React.forwardRef<
30
+ React.ElementRef<typeof DrawerPrimitive.Overlay>,
31
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
32
+ >(({ className, style, ...props }, ref) => (
33
+ <DrawerPrimitive.Overlay
34
+ ref={ref}
35
+ style={{ ...modalOverlayStyle, ...style }}
36
+ className={cn("fixed inset-0 bg-black/80", className)}
37
+ {...props}
38
+ />
39
+ ))
40
+ DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
41
+
42
+ const DrawerContent = React.forwardRef<
43
+ React.ElementRef<typeof DrawerPrimitive.Content>,
44
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
45
+ >(({ className, style, children, ...props }, ref) => (
46
+ <DrawerPortal>
47
+ <DrawerOverlay />
48
+ <DrawerPrimitive.Content
49
+ ref={ref}
50
+ style={{ ...modalContentStyle, ...style }}
51
+ className={cn(
52
+ "fixed inset-x-0 bottom-0 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
53
+ className
54
+ )}
55
+ {...props}
56
+ >
57
+ <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
58
+ {children}
59
+ </DrawerPrimitive.Content>
60
+ </DrawerPortal>
61
+ ))
62
+ DrawerContent.displayName = "DrawerContent"
63
+
64
+ const DrawerHeader = ({
65
+ className,
66
+ ...props
67
+ }: React.HTMLAttributes<HTMLDivElement>) => (
68
+ <div
69
+ className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
70
+ {...props}
71
+ />
72
+ )
73
+ DrawerHeader.displayName = "DrawerHeader"
74
+
75
+ const DrawerFooter = ({
76
+ className,
77
+ ...props
78
+ }: React.HTMLAttributes<HTMLDivElement>) => (
79
+ <div
80
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
81
+ {...props}
82
+ />
83
+ )
84
+ DrawerFooter.displayName = "DrawerFooter"
85
+
86
+ const DrawerTitle = React.forwardRef<
87
+ React.ElementRef<typeof DrawerPrimitive.Title>,
88
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
89
+ >(({ className, ...props }, ref) => (
90
+ <DrawerPrimitive.Title
91
+ ref={ref}
92
+ className={cn(
93
+ "text-lg font-semibold leading-none tracking-tight",
94
+ className
95
+ )}
96
+ {...props}
97
+ />
98
+ ))
99
+ DrawerTitle.displayName = DrawerPrimitive.Title.displayName
100
+
101
+ const DrawerDescription = React.forwardRef<
102
+ React.ElementRef<typeof DrawerPrimitive.Description>,
103
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
104
+ >(({ className, ...props }, ref) => (
105
+ <DrawerPrimitive.Description
106
+ ref={ref}
107
+ className={cn("text-sm text-muted-foreground", className)}
108
+ {...props}
109
+ />
110
+ ))
111
+ DrawerDescription.displayName = DrawerPrimitive.Description.displayName
112
+
113
+ export {
114
+ Drawer,
115
+ DrawerPortal,
116
+ DrawerOverlay,
117
+ DrawerTrigger,
118
+ DrawerClose,
119
+ DrawerContent,
120
+ DrawerHeader,
121
+ DrawerFooter,
122
+ DrawerTitle,
123
+ DrawerDescription,
124
+ }
@@ -0,0 +1,200 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
5
+ import { Check, ChevronRight, Circle } from "lucide-react"
6
+
7
+ import { cn } from "../lib/utils"
8
+
9
+ const DropdownMenu = DropdownMenuPrimitive.Root
10
+
11
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
12
+
13
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group
14
+
15
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal
16
+
17
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub
18
+
19
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
20
+
21
+ const DropdownMenuSubTrigger = React.forwardRef<
22
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
23
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
24
+ inset?: boolean
25
+ }
26
+ >(({ className, inset, children, ...props }, ref) => (
27
+ <DropdownMenuPrimitive.SubTrigger
28
+ ref={ref}
29
+ className={cn(
30
+ "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
31
+ inset && "pl-8",
32
+ className
33
+ )}
34
+ {...props}
35
+ >
36
+ {children}
37
+ <ChevronRight className="ml-auto" />
38
+ </DropdownMenuPrimitive.SubTrigger>
39
+ ))
40
+ DropdownMenuSubTrigger.displayName =
41
+ DropdownMenuPrimitive.SubTrigger.displayName
42
+
43
+ const DropdownMenuSubContent = React.forwardRef<
44
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
45
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
46
+ >(({ className, ...props }, ref) => (
47
+ <DropdownMenuPrimitive.SubContent
48
+ ref={ref}
49
+ className={cn(
50
+ "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-dropdown-menu-content-transform-origin]",
51
+ className
52
+ )}
53
+ {...props}
54
+ />
55
+ ))
56
+ DropdownMenuSubContent.displayName =
57
+ DropdownMenuPrimitive.SubContent.displayName
58
+
59
+ const DropdownMenuContent = React.forwardRef<
60
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
61
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
62
+ >(({ className, sideOffset = 4, ...props }, ref) => (
63
+ <DropdownMenuPrimitive.Portal>
64
+ <DropdownMenuPrimitive.Content
65
+ ref={ref}
66
+ sideOffset={sideOffset}
67
+ className={cn(
68
+ "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-dropdown-menu-content-transform-origin]",
69
+ className
70
+ )}
71
+ {...props}
72
+ />
73
+ </DropdownMenuPrimitive.Portal>
74
+ ))
75
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
76
+
77
+ const DropdownMenuItem = React.forwardRef<
78
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
79
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
80
+ inset?: boolean
81
+ }
82
+ >(({ className, inset, ...props }, ref) => (
83
+ <DropdownMenuPrimitive.Item
84
+ ref={ref}
85
+ className={cn(
86
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
87
+ inset && "pl-8",
88
+ className
89
+ )}
90
+ {...props}
91
+ />
92
+ ))
93
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
94
+
95
+ const DropdownMenuCheckboxItem = React.forwardRef<
96
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
97
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
98
+ >(({ className, children, checked, ...props }, ref) => (
99
+ <DropdownMenuPrimitive.CheckboxItem
100
+ ref={ref}
101
+ className={cn(
102
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
103
+ className
104
+ )}
105
+ checked={checked}
106
+ {...props}
107
+ >
108
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
109
+ <DropdownMenuPrimitive.ItemIndicator>
110
+ <Check className="h-4 w-4" />
111
+ </DropdownMenuPrimitive.ItemIndicator>
112
+ </span>
113
+ {children}
114
+ </DropdownMenuPrimitive.CheckboxItem>
115
+ ))
116
+ DropdownMenuCheckboxItem.displayName =
117
+ DropdownMenuPrimitive.CheckboxItem.displayName
118
+
119
+ const DropdownMenuRadioItem = React.forwardRef<
120
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
121
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
122
+ >(({ className, children, ...props }, ref) => (
123
+ <DropdownMenuPrimitive.RadioItem
124
+ ref={ref}
125
+ className={cn(
126
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
127
+ className
128
+ )}
129
+ {...props}
130
+ >
131
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
132
+ <DropdownMenuPrimitive.ItemIndicator>
133
+ <Circle className="h-2 w-2 fill-current" />
134
+ </DropdownMenuPrimitive.ItemIndicator>
135
+ </span>
136
+ {children}
137
+ </DropdownMenuPrimitive.RadioItem>
138
+ ))
139
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
140
+
141
+ const DropdownMenuLabel = React.forwardRef<
142
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
143
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
144
+ inset?: boolean
145
+ }
146
+ >(({ className, inset, ...props }, ref) => (
147
+ <DropdownMenuPrimitive.Label
148
+ ref={ref}
149
+ className={cn(
150
+ "px-2 py-1.5 text-sm font-semibold",
151
+ inset && "pl-8",
152
+ className
153
+ )}
154
+ {...props}
155
+ />
156
+ ))
157
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
158
+
159
+ const DropdownMenuSeparator = React.forwardRef<
160
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
161
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
162
+ >(({ className, ...props }, ref) => (
163
+ <DropdownMenuPrimitive.Separator
164
+ ref={ref}
165
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
166
+ {...props}
167
+ />
168
+ ))
169
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
170
+
171
+ const DropdownMenuShortcut = ({
172
+ className,
173
+ ...props
174
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
175
+ return (
176
+ <span
177
+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
178
+ {...props}
179
+ />
180
+ )
181
+ }
182
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
183
+
184
+ export {
185
+ DropdownMenu,
186
+ DropdownMenuTrigger,
187
+ DropdownMenuContent,
188
+ DropdownMenuItem,
189
+ DropdownMenuCheckboxItem,
190
+ DropdownMenuRadioItem,
191
+ DropdownMenuLabel,
192
+ DropdownMenuSeparator,
193
+ DropdownMenuShortcut,
194
+ DropdownMenuGroup,
195
+ DropdownMenuPortal,
196
+ DropdownMenuSub,
197
+ DropdownMenuSubContent,
198
+ DropdownMenuSubTrigger,
199
+ DropdownMenuRadioGroup,
200
+ }
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ import { cn } from "../lib/utils";
3
+
4
+ function Empty({
5
+ className,
6
+ ...props
7
+ }: React.HTMLAttributes<HTMLDivElement>) {
8
+ return (
9
+ <div
10
+ className={cn(
11
+ "flex flex-col items-center justify-center rounded-lg border border-dashed border-border/70 bg-card/40 px-4 py-6 text-center",
12
+ className
13
+ )}
14
+ {...props}
15
+ />
16
+ );
17
+ }
18
+
19
+ function EmptyIcon({
20
+ className,
21
+ ...props
22
+ }: React.HTMLAttributes<HTMLDivElement>) {
23
+ return (
24
+ <div
25
+ className={cn(
26
+ "mb-2 flex h-9 w-9 items-center justify-center rounded-md border border-border bg-background text-muted-foreground",
27
+ className
28
+ )}
29
+ {...props}
30
+ />
31
+ );
32
+ }
33
+
34
+ function EmptyTitle({
35
+ className,
36
+ ...props
37
+ }: React.HTMLAttributes<HTMLHeadingElement>) {
38
+ return (
39
+ <h3 className={cn("text-sm font-semibold text-foreground", className)} {...props} />
40
+ );
41
+ }
42
+
43
+ function EmptyDescription({
44
+ className,
45
+ ...props
46
+ }: React.HTMLAttributes<HTMLParagraphElement>) {
47
+ return <p className={cn("mt-1 text-xs leading-5 text-muted-foreground", className)} {...props} />;
48
+ }
49
+
50
+ export { Empty, EmptyIcon, EmptyTitle, EmptyDescription };