@vercel/agent-eval-playground 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.
- package/README.md +50 -0
- package/app/compare/page.tsx +40 -0
- package/app/evals/[name]/page.tsx +22 -0
- package/app/evals/page.tsx +18 -0
- package/app/experiments/[name]/[timestamp]/page.tsx +23 -0
- package/app/experiments/page.tsx +28 -0
- package/app/globals.css +126 -0
- package/app/layout.tsx +102 -0
- package/app/page.tsx +179 -0
- package/app/transcript/[experiment]/[timestamp]/[evalName]/[run]/page.tsx +43 -0
- package/bin.mjs +86 -0
- package/components/ComparePage.tsx +312 -0
- package/components/EvalDetail.tsx +114 -0
- package/components/EvalsPage.tsx +80 -0
- package/components/ExperimentDetail.tsx +162 -0
- package/components/ExperimentList.tsx +103 -0
- package/components/O11ySummary.tsx +114 -0
- package/components/RunResultCard.tsx +72 -0
- package/components/ShowMore.tsx +60 -0
- package/components/TranscriptPage.tsx +46 -0
- package/components/TranscriptViewer.tsx +201 -0
- package/components/ui/alert-dialog.tsx +184 -0
- package/components/ui/badge.tsx +45 -0
- package/components/ui/button.tsx +60 -0
- package/components/ui/card.tsx +94 -0
- package/components/ui/collapsible.tsx +34 -0
- package/components/ui/combobox.tsx +297 -0
- package/components/ui/dropdown-menu.tsx +269 -0
- package/components/ui/field.tsx +227 -0
- package/components/ui/input-group.tsx +147 -0
- package/components/ui/input.tsx +19 -0
- package/components/ui/label.tsx +24 -0
- package/components/ui/progress.tsx +31 -0
- package/components/ui/scroll-area.tsx +58 -0
- package/components/ui/select.tsx +191 -0
- package/components/ui/separator.tsx +28 -0
- package/components/ui/table.tsx +116 -0
- package/components/ui/tabs.tsx +91 -0
- package/components/ui/textarea.tsx +18 -0
- package/components/ui/tooltip.tsx +57 -0
- package/components.json +25 -0
- package/lib/data.ts +297 -0
- package/lib/types.ts +113 -0
- package/lib/utils.ts +6 -0
- package/next.config.ts +5 -0
- package/package.json +51 -0
- package/postcss.config.mjs +7 -0
- package/public/vercel.svg +1 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { Button } from "@/components/ui/button"
|
|
8
|
+
import {
|
|
9
|
+
InputGroup,
|
|
10
|
+
InputGroupAddon,
|
|
11
|
+
InputGroupButton,
|
|
12
|
+
InputGroupInput,
|
|
13
|
+
} from "@/components/ui/input-group"
|
|
14
|
+
import { RiArrowDownSLine, RiCloseLine, RiCheckLine } from "@remixicon/react"
|
|
15
|
+
|
|
16
|
+
const Combobox = ComboboxPrimitive.Root
|
|
17
|
+
|
|
18
|
+
function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
|
|
19
|
+
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function ComboboxTrigger({
|
|
23
|
+
className,
|
|
24
|
+
children,
|
|
25
|
+
...props
|
|
26
|
+
}: ComboboxPrimitive.Trigger.Props) {
|
|
27
|
+
return (
|
|
28
|
+
<ComboboxPrimitive.Trigger
|
|
29
|
+
data-slot="combobox-trigger"
|
|
30
|
+
className={cn("[&_svg:not([class*='size-'])]:size-3.5", className)}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
<RiArrowDownSLine className="text-muted-foreground size-3.5 pointer-events-none" />
|
|
35
|
+
</ComboboxPrimitive.Trigger>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
40
|
+
return (
|
|
41
|
+
<ComboboxPrimitive.Clear
|
|
42
|
+
data-slot="combobox-clear"
|
|
43
|
+
render={<InputGroupButton variant="ghost" size="icon-xs" />}
|
|
44
|
+
className={cn(className)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
<RiCloseLine className="pointer-events-none" />
|
|
48
|
+
</ComboboxPrimitive.Clear>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function ComboboxInput({
|
|
53
|
+
className,
|
|
54
|
+
children,
|
|
55
|
+
disabled = false,
|
|
56
|
+
showTrigger = true,
|
|
57
|
+
showClear = false,
|
|
58
|
+
...props
|
|
59
|
+
}: ComboboxPrimitive.Input.Props & {
|
|
60
|
+
showTrigger?: boolean
|
|
61
|
+
showClear?: boolean
|
|
62
|
+
}) {
|
|
63
|
+
return (
|
|
64
|
+
<InputGroup className={cn("w-auto", className)}>
|
|
65
|
+
<ComboboxPrimitive.Input
|
|
66
|
+
render={<InputGroupInput disabled={disabled} />}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
69
|
+
<InputGroupAddon align="inline-end">
|
|
70
|
+
{showTrigger && (
|
|
71
|
+
<InputGroupButton
|
|
72
|
+
size="icon-xs"
|
|
73
|
+
variant="ghost"
|
|
74
|
+
asChild
|
|
75
|
+
data-slot="input-group-button"
|
|
76
|
+
className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
>
|
|
79
|
+
<ComboboxTrigger />
|
|
80
|
+
</InputGroupButton>
|
|
81
|
+
)}
|
|
82
|
+
{showClear && <ComboboxClear disabled={disabled} />}
|
|
83
|
+
</InputGroupAddon>
|
|
84
|
+
{children}
|
|
85
|
+
</InputGroup>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function ComboboxContent({
|
|
90
|
+
className,
|
|
91
|
+
side = "bottom",
|
|
92
|
+
sideOffset = 6,
|
|
93
|
+
align = "start",
|
|
94
|
+
alignOffset = 0,
|
|
95
|
+
anchor,
|
|
96
|
+
...props
|
|
97
|
+
}: ComboboxPrimitive.Popup.Props &
|
|
98
|
+
Pick<
|
|
99
|
+
ComboboxPrimitive.Positioner.Props,
|
|
100
|
+
"side" | "align" | "sideOffset" | "alignOffset" | "anchor"
|
|
101
|
+
>) {
|
|
102
|
+
return (
|
|
103
|
+
<ComboboxPrimitive.Portal>
|
|
104
|
+
<ComboboxPrimitive.Positioner
|
|
105
|
+
side={side}
|
|
106
|
+
sideOffset={sideOffset}
|
|
107
|
+
align={align}
|
|
108
|
+
alignOffset={alignOffset}
|
|
109
|
+
anchor={anchor}
|
|
110
|
+
className="isolate z-50"
|
|
111
|
+
>
|
|
112
|
+
<ComboboxPrimitive.Popup
|
|
113
|
+
data-slot="combobox-content"
|
|
114
|
+
data-chips={!!anchor}
|
|
115
|
+
className={cn(
|
|
116
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 dark group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",
|
|
117
|
+
className
|
|
118
|
+
)}
|
|
119
|
+
{...props}
|
|
120
|
+
/>
|
|
121
|
+
</ComboboxPrimitive.Positioner>
|
|
122
|
+
</ComboboxPrimitive.Portal>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
127
|
+
return (
|
|
128
|
+
<ComboboxPrimitive.List
|
|
129
|
+
data-slot="combobox-list"
|
|
130
|
+
className={cn(
|
|
131
|
+
"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 p-1 data-empty:p-0 overflow-y-auto overscroll-contain",
|
|
132
|
+
className
|
|
133
|
+
)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function ComboboxItem({
|
|
140
|
+
className,
|
|
141
|
+
children,
|
|
142
|
+
...props
|
|
143
|
+
}: ComboboxPrimitive.Item.Props) {
|
|
144
|
+
return (
|
|
145
|
+
<ComboboxPrimitive.Item
|
|
146
|
+
data-slot="combobox-item"
|
|
147
|
+
className={cn(
|
|
148
|
+
"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
149
|
+
className
|
|
150
|
+
)}
|
|
151
|
+
{...props}
|
|
152
|
+
>
|
|
153
|
+
{children}
|
|
154
|
+
<ComboboxPrimitive.ItemIndicator
|
|
155
|
+
render={<span className="pointer-events-none absolute right-2 flex items-center justify-center" />}
|
|
156
|
+
>
|
|
157
|
+
<RiCheckLine className="pointer-events-none" />
|
|
158
|
+
</ComboboxPrimitive.ItemIndicator>
|
|
159
|
+
</ComboboxPrimitive.Item>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
|
|
164
|
+
return (
|
|
165
|
+
<ComboboxPrimitive.Group
|
|
166
|
+
data-slot="combobox-group"
|
|
167
|
+
className={cn(className)}
|
|
168
|
+
{...props}
|
|
169
|
+
/>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function ComboboxLabel({
|
|
174
|
+
className,
|
|
175
|
+
...props
|
|
176
|
+
}: ComboboxPrimitive.GroupLabel.Props) {
|
|
177
|
+
return (
|
|
178
|
+
<ComboboxPrimitive.GroupLabel
|
|
179
|
+
data-slot="combobox-label"
|
|
180
|
+
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
181
|
+
{...props}
|
|
182
|
+
/>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
|
|
187
|
+
return (
|
|
188
|
+
<ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
193
|
+
return (
|
|
194
|
+
<ComboboxPrimitive.Empty
|
|
195
|
+
data-slot="combobox-empty"
|
|
196
|
+
className={cn("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex", className)}
|
|
197
|
+
{...props}
|
|
198
|
+
/>
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function ComboboxSeparator({
|
|
203
|
+
className,
|
|
204
|
+
...props
|
|
205
|
+
}: ComboboxPrimitive.Separator.Props) {
|
|
206
|
+
return (
|
|
207
|
+
<ComboboxPrimitive.Separator
|
|
208
|
+
data-slot="combobox-separator"
|
|
209
|
+
className={cn("bg-border/50 -mx-1 my-1 h-px", className)}
|
|
210
|
+
{...props}
|
|
211
|
+
/>
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function ComboboxChips({
|
|
216
|
+
className,
|
|
217
|
+
...props
|
|
218
|
+
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &
|
|
219
|
+
ComboboxPrimitive.Chips.Props) {
|
|
220
|
+
return (
|
|
221
|
+
<ComboboxPrimitive.Chips
|
|
222
|
+
data-slot="combobox-chips"
|
|
223
|
+
className={cn("bg-input/20 dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/30 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-7 flex-wrap items-center gap-1 rounded-md border bg-clip-padding px-2 py-0.5 text-xs/relaxed transition-colors focus-within:ring-2 has-aria-invalid:ring-2 has-data-[slot=combobox-chip]:px-1", className)}
|
|
224
|
+
{...props}
|
|
225
|
+
/>
|
|
226
|
+
)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function ComboboxChip({
|
|
230
|
+
className,
|
|
231
|
+
children,
|
|
232
|
+
showRemove = true,
|
|
233
|
+
...props
|
|
234
|
+
}: ComboboxPrimitive.Chip.Props & {
|
|
235
|
+
showRemove?: boolean
|
|
236
|
+
}) {
|
|
237
|
+
return (
|
|
238
|
+
<ComboboxPrimitive.Chip
|
|
239
|
+
data-slot="combobox-chip"
|
|
240
|
+
className={cn(
|
|
241
|
+
"bg-muted-foreground/10 text-foreground flex h-[calc(--spacing(4.75))] w-fit items-center justify-center gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1.5 text-xs/relaxed font-medium whitespace-nowrap has-data-[slot=combobox-chip-remove]:pr-0 has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50",
|
|
242
|
+
className
|
|
243
|
+
)}
|
|
244
|
+
{...props}
|
|
245
|
+
>
|
|
246
|
+
{children}
|
|
247
|
+
{showRemove && (
|
|
248
|
+
<ComboboxPrimitive.ChipRemove
|
|
249
|
+
render={<Button variant="ghost" size="icon-xs" />}
|
|
250
|
+
className="-ml-1 opacity-50 hover:opacity-100"
|
|
251
|
+
data-slot="combobox-chip-remove"
|
|
252
|
+
>
|
|
253
|
+
<RiCloseLine className="pointer-events-none" />
|
|
254
|
+
</ComboboxPrimitive.ChipRemove>
|
|
255
|
+
)}
|
|
256
|
+
</ComboboxPrimitive.Chip>
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function ComboboxChipsInput({
|
|
261
|
+
className,
|
|
262
|
+
...props
|
|
263
|
+
}: ComboboxPrimitive.Input.Props) {
|
|
264
|
+
return (
|
|
265
|
+
<ComboboxPrimitive.Input
|
|
266
|
+
data-slot="combobox-chip-input"
|
|
267
|
+
className={cn(
|
|
268
|
+
"min-w-16 flex-1 outline-none",
|
|
269
|
+
className
|
|
270
|
+
)}
|
|
271
|
+
{...props}
|
|
272
|
+
/>
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function useComboboxAnchor() {
|
|
277
|
+
return React.useRef<HTMLDivElement | null>(null)
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export {
|
|
281
|
+
Combobox,
|
|
282
|
+
ComboboxInput,
|
|
283
|
+
ComboboxContent,
|
|
284
|
+
ComboboxList,
|
|
285
|
+
ComboboxItem,
|
|
286
|
+
ComboboxGroup,
|
|
287
|
+
ComboboxLabel,
|
|
288
|
+
ComboboxCollection,
|
|
289
|
+
ComboboxEmpty,
|
|
290
|
+
ComboboxSeparator,
|
|
291
|
+
ComboboxChips,
|
|
292
|
+
ComboboxChip,
|
|
293
|
+
ComboboxChipsInput,
|
|
294
|
+
ComboboxTrigger,
|
|
295
|
+
ComboboxValue,
|
|
296
|
+
useComboboxAnchor,
|
|
297
|
+
}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { RiCheckLine, RiArrowRightSLine } from "@remixicon/react"
|
|
8
|
+
|
|
9
|
+
function DropdownMenu({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
12
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function DropdownMenuPortal({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
18
|
+
return (
|
|
19
|
+
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function DropdownMenuTrigger({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
26
|
+
return (
|
|
27
|
+
<DropdownMenuPrimitive.Trigger
|
|
28
|
+
data-slot="dropdown-menu-trigger"
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function DropdownMenuContent({
|
|
35
|
+
className,
|
|
36
|
+
align = "start",
|
|
37
|
+
sideOffset = 4,
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
40
|
+
return (
|
|
41
|
+
<DropdownMenuPrimitive.Portal>
|
|
42
|
+
<DropdownMenuPrimitive.Content
|
|
43
|
+
data-slot="dropdown-menu-content"
|
|
44
|
+
sideOffset={sideOffset}
|
|
45
|
+
align={align}
|
|
46
|
+
className={cn(
|
|
47
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 dark z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden",
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
</DropdownMenuPrimitive.Portal>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function DropdownMenuGroup({
|
|
57
|
+
...props
|
|
58
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
59
|
+
return (
|
|
60
|
+
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function DropdownMenuItem({
|
|
65
|
+
className,
|
|
66
|
+
inset,
|
|
67
|
+
variant = "default",
|
|
68
|
+
...props
|
|
69
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
70
|
+
inset?: boolean
|
|
71
|
+
variant?: "default" | "destructive"
|
|
72
|
+
}) {
|
|
73
|
+
return (
|
|
74
|
+
<DropdownMenuPrimitive.Item
|
|
75
|
+
data-slot="dropdown-menu-item"
|
|
76
|
+
data-inset={inset}
|
|
77
|
+
data-variant={variant}
|
|
78
|
+
className={cn(
|
|
79
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed data-inset:pl-7.5 [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
80
|
+
className
|
|
81
|
+
)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function DropdownMenuCheckboxItem({
|
|
88
|
+
className,
|
|
89
|
+
children,
|
|
90
|
+
checked,
|
|
91
|
+
inset,
|
|
92
|
+
...props
|
|
93
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
94
|
+
inset?: boolean
|
|
95
|
+
}) {
|
|
96
|
+
return (
|
|
97
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
98
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
99
|
+
data-inset={inset}
|
|
100
|
+
className={cn(
|
|
101
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs data-inset:pl-7.5 [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
102
|
+
className
|
|
103
|
+
)}
|
|
104
|
+
checked={checked}
|
|
105
|
+
{...props}
|
|
106
|
+
>
|
|
107
|
+
<span
|
|
108
|
+
className="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
109
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
110
|
+
>
|
|
111
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
112
|
+
<RiCheckLine
|
|
113
|
+
/>
|
|
114
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
115
|
+
</span>
|
|
116
|
+
{children}
|
|
117
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function DropdownMenuRadioGroup({
|
|
122
|
+
...props
|
|
123
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
124
|
+
return (
|
|
125
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
126
|
+
data-slot="dropdown-menu-radio-group"
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function DropdownMenuRadioItem({
|
|
133
|
+
className,
|
|
134
|
+
children,
|
|
135
|
+
inset,
|
|
136
|
+
...props
|
|
137
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
138
|
+
inset?: boolean
|
|
139
|
+
}) {
|
|
140
|
+
return (
|
|
141
|
+
<DropdownMenuPrimitive.RadioItem
|
|
142
|
+
data-slot="dropdown-menu-radio-item"
|
|
143
|
+
data-inset={inset}
|
|
144
|
+
className={cn(
|
|
145
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs data-inset:pl-7.5 [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
146
|
+
className
|
|
147
|
+
)}
|
|
148
|
+
{...props}
|
|
149
|
+
>
|
|
150
|
+
<span
|
|
151
|
+
className="absolute right-2 flex items-center justify-center pointer-events-none"
|
|
152
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
153
|
+
>
|
|
154
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
155
|
+
<RiCheckLine
|
|
156
|
+
/>
|
|
157
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
158
|
+
</span>
|
|
159
|
+
{children}
|
|
160
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function DropdownMenuLabel({
|
|
165
|
+
className,
|
|
166
|
+
inset,
|
|
167
|
+
...props
|
|
168
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
169
|
+
inset?: boolean
|
|
170
|
+
}) {
|
|
171
|
+
return (
|
|
172
|
+
<DropdownMenuPrimitive.Label
|
|
173
|
+
data-slot="dropdown-menu-label"
|
|
174
|
+
data-inset={inset}
|
|
175
|
+
className={cn("text-muted-foreground px-2 py-1.5 text-xs data-inset:pl-7.5", className)}
|
|
176
|
+
{...props}
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function DropdownMenuSeparator({
|
|
182
|
+
className,
|
|
183
|
+
...props
|
|
184
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
185
|
+
return (
|
|
186
|
+
<DropdownMenuPrimitive.Separator
|
|
187
|
+
data-slot="dropdown-menu-separator"
|
|
188
|
+
className={cn("bg-border/50 -mx-1 my-1 h-px", className)}
|
|
189
|
+
{...props}
|
|
190
|
+
/>
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function DropdownMenuShortcut({
|
|
195
|
+
className,
|
|
196
|
+
...props
|
|
197
|
+
}: React.ComponentProps<"span">) {
|
|
198
|
+
return (
|
|
199
|
+
<span
|
|
200
|
+
data-slot="dropdown-menu-shortcut"
|
|
201
|
+
className={cn("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-[0.625rem] tracking-widest", className)}
|
|
202
|
+
{...props}
|
|
203
|
+
/>
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function DropdownMenuSub({
|
|
208
|
+
...props
|
|
209
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
210
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function DropdownMenuSubTrigger({
|
|
214
|
+
className,
|
|
215
|
+
inset,
|
|
216
|
+
children,
|
|
217
|
+
...props
|
|
218
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
219
|
+
inset?: boolean
|
|
220
|
+
}) {
|
|
221
|
+
return (
|
|
222
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
223
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
224
|
+
data-inset={inset}
|
|
225
|
+
className={cn(
|
|
226
|
+
"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs data-inset:pl-7.5 [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
227
|
+
className
|
|
228
|
+
)}
|
|
229
|
+
{...props}
|
|
230
|
+
>
|
|
231
|
+
{children}
|
|
232
|
+
<RiArrowRightSLine className="ml-auto" />
|
|
233
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function DropdownMenuSubContent({
|
|
238
|
+
className,
|
|
239
|
+
...props
|
|
240
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
241
|
+
return (
|
|
242
|
+
<DropdownMenuPrimitive.SubContent
|
|
243
|
+
data-slot="dropdown-menu-sub-content"
|
|
244
|
+
className={cn(
|
|
245
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 dark z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden",
|
|
246
|
+
className
|
|
247
|
+
)}
|
|
248
|
+
{...props}
|
|
249
|
+
/>
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export {
|
|
254
|
+
DropdownMenu,
|
|
255
|
+
DropdownMenuPortal,
|
|
256
|
+
DropdownMenuTrigger,
|
|
257
|
+
DropdownMenuContent,
|
|
258
|
+
DropdownMenuGroup,
|
|
259
|
+
DropdownMenuLabel,
|
|
260
|
+
DropdownMenuItem,
|
|
261
|
+
DropdownMenuCheckboxItem,
|
|
262
|
+
DropdownMenuRadioGroup,
|
|
263
|
+
DropdownMenuRadioItem,
|
|
264
|
+
DropdownMenuSeparator,
|
|
265
|
+
DropdownMenuShortcut,
|
|
266
|
+
DropdownMenuSub,
|
|
267
|
+
DropdownMenuSubTrigger,
|
|
268
|
+
DropdownMenuSubContent,
|
|
269
|
+
}
|