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