@arolariu/components 0.0.31 → 0.0.32
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/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.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/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.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 +294 -293
- package/dist/esm/index.js.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +298 -0
- package/dist/types/components/ui/alert.d.ts.map +1 -1
- package/dist/types/components/ui/form.d.ts.map +1 -1
- package/package.json +76 -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 +30 -30
- 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 +2 -0
- package/tailwind.config.mjs +67 -0
- package/tsconfig.json +4 -1
|
@@ -1,259 +1,259 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
5
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
6
|
-
import { cn } from "./../../lib/utils";
|
|
7
|
-
|
|
8
|
-
function DropdownMenu({
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
11
|
-
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function DropdownMenuPortal({
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
17
|
-
return (
|
|
18
|
-
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function DropdownMenuTrigger({
|
|
23
|
-
...props
|
|
24
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
25
|
-
return (
|
|
26
|
-
<DropdownMenuPrimitive.Trigger
|
|
27
|
-
data-slot="dropdown-menu-trigger"
|
|
28
|
-
{...props}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function DropdownMenuContent({
|
|
34
|
-
className,
|
|
35
|
-
sideOffset = 4,
|
|
36
|
-
...props
|
|
37
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
38
|
-
return (
|
|
39
|
-
<DropdownMenuPrimitive.Portal>
|
|
40
|
-
<DropdownMenuPrimitive.Content
|
|
41
|
-
data-slot="dropdown-menu-content"
|
|
42
|
-
sideOffset={sideOffset}
|
|
43
|
-
className={cn(
|
|
44
|
-
"bg-white text-neutral-950 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] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-md dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
45
|
-
className
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
</DropdownMenuPrimitive.Portal>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function DropdownMenuGroup({
|
|
54
|
-
...props
|
|
55
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
56
|
-
return (
|
|
57
|
-
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function DropdownMenuItem({
|
|
62
|
-
className,
|
|
63
|
-
inset,
|
|
64
|
-
variant = "default",
|
|
65
|
-
...props
|
|
66
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
67
|
-
inset?: boolean;
|
|
68
|
-
variant?: "default" | "destructive";
|
|
69
|
-
}) {
|
|
70
|
-
return (
|
|
71
|
-
<DropdownMenuPrimitive.Item
|
|
72
|
-
data-slot="dropdown-menu-item"
|
|
73
|
-
data-inset={inset}
|
|
74
|
-
data-variant={variant}
|
|
75
|
-
className={cn(
|
|
76
|
-
"focus:bg-neutral-100 focus:text-neutral-900 data-[variant=destructive]:text-neutral-50 data-[variant=destructive]:focus:bg-red-500/10 dark:data-[variant=destructive]:focus:bg-red-500/40 data-[variant=destructive]:focus:text-neutral-50 data-[variant=destructive]:*:[svg]:!text-destructive-foreground [&_svg:not([class*='text-'])]:text-neutral-500 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 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[variant=destructive]:text-neutral-50 dark:data-[variant=destructive]:focus:bg-red-900/10 dark:dark:data-[variant=destructive]:focus:bg-red-900/40 dark:data-[variant=destructive]:focus:text-neutral-50 dark:[&_svg:not([class*='text-'])]:text-neutral-400",
|
|
77
|
-
className
|
|
78
|
-
)}
|
|
79
|
-
{...props}
|
|
80
|
-
/>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function DropdownMenuCheckboxItem({
|
|
85
|
-
className,
|
|
86
|
-
children,
|
|
87
|
-
checked,
|
|
88
|
-
...props
|
|
89
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
|
90
|
-
return (
|
|
91
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
92
|
-
data-slot="dropdown-menu-checkbox-item"
|
|
93
|
-
className={cn(
|
|
94
|
-
"focus:bg-neutral-100 focus:text-neutral-900 relative flex cursor-default items-center gap-2 rounded-sm 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 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
|
95
|
-
className
|
|
96
|
-
)}
|
|
97
|
-
checked={checked}
|
|
98
|
-
{...props}
|
|
99
|
-
>
|
|
100
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
101
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
102
|
-
<CheckIcon className="size-4" />
|
|
103
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
104
|
-
</span>
|
|
105
|
-
{children}
|
|
106
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function DropdownMenuRadioGroup({
|
|
111
|
-
...props
|
|
112
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
113
|
-
return (
|
|
114
|
-
<DropdownMenuPrimitive.RadioGroup
|
|
115
|
-
data-slot="dropdown-menu-radio-group"
|
|
116
|
-
{...props}
|
|
117
|
-
/>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function DropdownMenuRadioItem({
|
|
122
|
-
className,
|
|
123
|
-
children,
|
|
124
|
-
...props
|
|
125
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
126
|
-
return (
|
|
127
|
-
<DropdownMenuPrimitive.RadioItem
|
|
128
|
-
data-slot="dropdown-menu-radio-item"
|
|
129
|
-
className={cn(
|
|
130
|
-
"focus:bg-neutral-100 focus:text-neutral-900 relative flex cursor-default items-center gap-2 rounded-sm 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 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
|
131
|
-
className
|
|
132
|
-
)}
|
|
133
|
-
{...props}
|
|
134
|
-
>
|
|
135
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
136
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
137
|
-
<CircleIcon className="size-2 fill-current" />
|
|
138
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
139
|
-
</span>
|
|
140
|
-
{children}
|
|
141
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function DropdownMenuLabel({
|
|
146
|
-
className,
|
|
147
|
-
inset,
|
|
148
|
-
...props
|
|
149
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
150
|
-
inset?: boolean;
|
|
151
|
-
}) {
|
|
152
|
-
return (
|
|
153
|
-
<DropdownMenuPrimitive.Label
|
|
154
|
-
data-slot="dropdown-menu-label"
|
|
155
|
-
data-inset={inset}
|
|
156
|
-
className={cn(
|
|
157
|
-
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
158
|
-
className
|
|
159
|
-
)}
|
|
160
|
-
{...props}
|
|
161
|
-
/>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function DropdownMenuSeparator({
|
|
166
|
-
className,
|
|
167
|
-
...props
|
|
168
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
169
|
-
return (
|
|
170
|
-
<DropdownMenuPrimitive.Separator
|
|
171
|
-
data-slot="dropdown-menu-separator"
|
|
172
|
-
className={cn(
|
|
173
|
-
"bg-neutral-200 -mx-1 my-1 h-px dark:bg-neutral-800",
|
|
174
|
-
className
|
|
175
|
-
)}
|
|
176
|
-
{...props}
|
|
177
|
-
/>
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function DropdownMenuShortcut({
|
|
182
|
-
className,
|
|
183
|
-
...props
|
|
184
|
-
}: React.ComponentProps<"span">) {
|
|
185
|
-
return (
|
|
186
|
-
<span
|
|
187
|
-
data-slot="dropdown-menu-shortcut"
|
|
188
|
-
className={cn(
|
|
189
|
-
"text-neutral-500 ml-auto text-xs tracking-widest dark:text-neutral-400",
|
|
190
|
-
className
|
|
191
|
-
)}
|
|
192
|
-
{...props}
|
|
193
|
-
/>
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function DropdownMenuSub({
|
|
198
|
-
...props
|
|
199
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
200
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function DropdownMenuSubTrigger({
|
|
204
|
-
className,
|
|
205
|
-
inset,
|
|
206
|
-
children,
|
|
207
|
-
...props
|
|
208
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
209
|
-
inset?: boolean;
|
|
210
|
-
}) {
|
|
211
|
-
return (
|
|
212
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
213
|
-
data-slot="dropdown-menu-sub-trigger"
|
|
214
|
-
data-inset={inset}
|
|
215
|
-
className={cn(
|
|
216
|
-
"focus:bg-neutral-100 focus:text-neutral-900 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-900 flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-50",
|
|
217
|
-
className
|
|
218
|
-
)}
|
|
219
|
-
{...props}
|
|
220
|
-
>
|
|
221
|
-
{children}
|
|
222
|
-
<ChevronRightIcon className="ml-auto size-4" />
|
|
223
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function DropdownMenuSubContent({
|
|
228
|
-
className,
|
|
229
|
-
...props
|
|
230
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
231
|
-
return (
|
|
232
|
-
<DropdownMenuPrimitive.SubContent
|
|
233
|
-
data-slot="dropdown-menu-sub-content"
|
|
234
|
-
className={cn(
|
|
235
|
-
"bg-white text-neutral-950 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] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-lg dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
236
|
-
className
|
|
237
|
-
)}
|
|
238
|
-
{...props}
|
|
239
|
-
/>
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export {
|
|
244
|
-
DropdownMenu,
|
|
245
|
-
DropdownMenuPortal,
|
|
246
|
-
DropdownMenuTrigger,
|
|
247
|
-
DropdownMenuContent,
|
|
248
|
-
DropdownMenuGroup,
|
|
249
|
-
DropdownMenuLabel,
|
|
250
|
-
DropdownMenuItem,
|
|
251
|
-
DropdownMenuCheckboxItem,
|
|
252
|
-
DropdownMenuRadioGroup,
|
|
253
|
-
DropdownMenuRadioItem,
|
|
254
|
-
DropdownMenuSeparator,
|
|
255
|
-
DropdownMenuShortcut,
|
|
256
|
-
DropdownMenuSub,
|
|
257
|
-
DropdownMenuSubTrigger,
|
|
258
|
-
DropdownMenuSubContent,
|
|
259
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
5
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
6
|
+
import { cn } from "./../../lib/utils";
|
|
7
|
+
|
|
8
|
+
function DropdownMenu({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
11
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function DropdownMenuPortal({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
17
|
+
return (
|
|
18
|
+
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function DropdownMenuTrigger({
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
25
|
+
return (
|
|
26
|
+
<DropdownMenuPrimitive.Trigger
|
|
27
|
+
data-slot="dropdown-menu-trigger"
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function DropdownMenuContent({
|
|
34
|
+
className,
|
|
35
|
+
sideOffset = 4,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
38
|
+
return (
|
|
39
|
+
<DropdownMenuPrimitive.Portal>
|
|
40
|
+
<DropdownMenuPrimitive.Content
|
|
41
|
+
data-slot="dropdown-menu-content"
|
|
42
|
+
sideOffset={sideOffset}
|
|
43
|
+
className={cn(
|
|
44
|
+
"bg-white text-neutral-950 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] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-md dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
</DropdownMenuPrimitive.Portal>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function DropdownMenuGroup({
|
|
54
|
+
...props
|
|
55
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
56
|
+
return (
|
|
57
|
+
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function DropdownMenuItem({
|
|
62
|
+
className,
|
|
63
|
+
inset,
|
|
64
|
+
variant = "default",
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
67
|
+
inset?: boolean;
|
|
68
|
+
variant?: "default" | "destructive";
|
|
69
|
+
}) {
|
|
70
|
+
return (
|
|
71
|
+
<DropdownMenuPrimitive.Item
|
|
72
|
+
data-slot="dropdown-menu-item"
|
|
73
|
+
data-inset={inset}
|
|
74
|
+
data-variant={variant}
|
|
75
|
+
className={cn(
|
|
76
|
+
"focus:bg-neutral-100 focus:text-neutral-900 data-[variant=destructive]:text-neutral-50 data-[variant=destructive]:focus:bg-red-500/10 dark:data-[variant=destructive]:focus:bg-red-500/40 data-[variant=destructive]:focus:text-neutral-50 data-[variant=destructive]:*:[svg]:!text-destructive-foreground [&_svg:not([class*='text-'])]:text-neutral-500 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 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[variant=destructive]:text-neutral-50 dark:data-[variant=destructive]:focus:bg-red-900/10 dark:dark:data-[variant=destructive]:focus:bg-red-900/40 dark:data-[variant=destructive]:focus:text-neutral-50 dark:[&_svg:not([class*='text-'])]:text-neutral-400",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function DropdownMenuCheckboxItem({
|
|
85
|
+
className,
|
|
86
|
+
children,
|
|
87
|
+
checked,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
|
90
|
+
return (
|
|
91
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
92
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
93
|
+
className={cn(
|
|
94
|
+
"focus:bg-neutral-100 focus:text-neutral-900 relative flex cursor-default items-center gap-2 rounded-sm 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 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
|
95
|
+
className
|
|
96
|
+
)}
|
|
97
|
+
checked={checked}
|
|
98
|
+
{...props}
|
|
99
|
+
>
|
|
100
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
101
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
102
|
+
<CheckIcon className="size-4" />
|
|
103
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
104
|
+
</span>
|
|
105
|
+
{children}
|
|
106
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function DropdownMenuRadioGroup({
|
|
111
|
+
...props
|
|
112
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
113
|
+
return (
|
|
114
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
115
|
+
data-slot="dropdown-menu-radio-group"
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function DropdownMenuRadioItem({
|
|
122
|
+
className,
|
|
123
|
+
children,
|
|
124
|
+
...props
|
|
125
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
126
|
+
return (
|
|
127
|
+
<DropdownMenuPrimitive.RadioItem
|
|
128
|
+
data-slot="dropdown-menu-radio-item"
|
|
129
|
+
className={cn(
|
|
130
|
+
"focus:bg-neutral-100 focus:text-neutral-900 relative flex cursor-default items-center gap-2 rounded-sm 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 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",
|
|
131
|
+
className
|
|
132
|
+
)}
|
|
133
|
+
{...props}
|
|
134
|
+
>
|
|
135
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
136
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
137
|
+
<CircleIcon className="size-2 fill-current" />
|
|
138
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
139
|
+
</span>
|
|
140
|
+
{children}
|
|
141
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function DropdownMenuLabel({
|
|
146
|
+
className,
|
|
147
|
+
inset,
|
|
148
|
+
...props
|
|
149
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
150
|
+
inset?: boolean;
|
|
151
|
+
}) {
|
|
152
|
+
return (
|
|
153
|
+
<DropdownMenuPrimitive.Label
|
|
154
|
+
data-slot="dropdown-menu-label"
|
|
155
|
+
data-inset={inset}
|
|
156
|
+
className={cn(
|
|
157
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
158
|
+
className
|
|
159
|
+
)}
|
|
160
|
+
{...props}
|
|
161
|
+
/>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function DropdownMenuSeparator({
|
|
166
|
+
className,
|
|
167
|
+
...props
|
|
168
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
169
|
+
return (
|
|
170
|
+
<DropdownMenuPrimitive.Separator
|
|
171
|
+
data-slot="dropdown-menu-separator"
|
|
172
|
+
className={cn(
|
|
173
|
+
"bg-neutral-200 -mx-1 my-1 h-px dark:bg-neutral-800",
|
|
174
|
+
className
|
|
175
|
+
)}
|
|
176
|
+
{...props}
|
|
177
|
+
/>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function DropdownMenuShortcut({
|
|
182
|
+
className,
|
|
183
|
+
...props
|
|
184
|
+
}: React.ComponentProps<"span">) {
|
|
185
|
+
return (
|
|
186
|
+
<span
|
|
187
|
+
data-slot="dropdown-menu-shortcut"
|
|
188
|
+
className={cn(
|
|
189
|
+
"text-neutral-500 ml-auto text-xs tracking-widest dark:text-neutral-400",
|
|
190
|
+
className
|
|
191
|
+
)}
|
|
192
|
+
{...props}
|
|
193
|
+
/>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function DropdownMenuSub({
|
|
198
|
+
...props
|
|
199
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
200
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function DropdownMenuSubTrigger({
|
|
204
|
+
className,
|
|
205
|
+
inset,
|
|
206
|
+
children,
|
|
207
|
+
...props
|
|
208
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
209
|
+
inset?: boolean;
|
|
210
|
+
}) {
|
|
211
|
+
return (
|
|
212
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
213
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
214
|
+
data-inset={inset}
|
|
215
|
+
className={cn(
|
|
216
|
+
"focus:bg-neutral-100 focus:text-neutral-900 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-900 flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-50",
|
|
217
|
+
className
|
|
218
|
+
)}
|
|
219
|
+
{...props}
|
|
220
|
+
>
|
|
221
|
+
{children}
|
|
222
|
+
<ChevronRightIcon className="ml-auto size-4" />
|
|
223
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function DropdownMenuSubContent({
|
|
228
|
+
className,
|
|
229
|
+
...props
|
|
230
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
231
|
+
return (
|
|
232
|
+
<DropdownMenuPrimitive.SubContent
|
|
233
|
+
data-slot="dropdown-menu-sub-content"
|
|
234
|
+
className={cn(
|
|
235
|
+
"bg-white text-neutral-950 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] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-lg dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
236
|
+
className
|
|
237
|
+
)}
|
|
238
|
+
{...props}
|
|
239
|
+
/>
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export {
|
|
244
|
+
DropdownMenu,
|
|
245
|
+
DropdownMenuPortal,
|
|
246
|
+
DropdownMenuTrigger,
|
|
247
|
+
DropdownMenuContent,
|
|
248
|
+
DropdownMenuGroup,
|
|
249
|
+
DropdownMenuLabel,
|
|
250
|
+
DropdownMenuItem,
|
|
251
|
+
DropdownMenuCheckboxItem,
|
|
252
|
+
DropdownMenuRadioGroup,
|
|
253
|
+
DropdownMenuRadioItem,
|
|
254
|
+
DropdownMenuSeparator,
|
|
255
|
+
DropdownMenuShortcut,
|
|
256
|
+
DropdownMenuSub,
|
|
257
|
+
DropdownMenuSubTrigger,
|
|
258
|
+
DropdownMenuSubContent,
|
|
259
|
+
};
|