@multicomma/arkcn 0.1.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.
- package/README.md +78 -0
- package/bin/arkcn.mjs +78 -0
- package/cli/commands.mjs +251 -0
- package/cli/project.mjs +168 -0
- package/cli/registry.mjs +50 -0
- package/cli/ui.mjs +46 -0
- package/mcp/server.mjs +149 -0
- package/package.json +201 -0
- package/registry/base.css +680 -0
- package/registry/index.json +1833 -0
- package/registry/items/accordion.json +18 -0
- package/registry/items/activity-feed.json +18 -0
- package/registry/items/alert-dialog.json +18 -0
- package/registry/items/alert.json +17 -0
- package/registry/items/angle-slider.json +17 -0
- package/registry/items/app-shell.json +28 -0
- package/registry/items/aspect-ratio.json +13 -0
- package/registry/items/attachment.json +19 -0
- package/registry/items/avatar.json +17 -0
- package/registry/items/badge.json +18 -0
- package/registry/items/breadcrumb.json +18 -0
- package/registry/items/bubble.json +18 -0
- package/registry/items/button-group.json +19 -0
- package/registry/items/button.json +18 -0
- package/registry/items/calendar.json +19 -0
- package/registry/items/canvas.json +24 -0
- package/registry/items/card.json +15 -0
- package/registry/items/carousel.json +19 -0
- package/registry/items/cascader.json +23 -0
- package/registry/items/chart.json +17 -0
- package/registry/items/chat.json +23 -0
- package/registry/items/checkbox.json +18 -0
- package/registry/items/clipboard.json +19 -0
- package/registry/items/collapsible.json +15 -0
- package/registry/items/color-picker.json +19 -0
- package/registry/items/combobox.json +20 -0
- package/registry/items/command.json +21 -0
- package/registry/items/comment-thread.json +25 -0
- package/registry/items/context-menu.json +18 -0
- package/registry/items/controllable.json +14 -0
- package/registry/items/data-grid.json +24 -0
- package/registry/items/data-table-adapter.json +14 -0
- package/registry/items/data-table.json +32 -0
- package/registry/items/date-input.json +17 -0
- package/registry/items/dialog.json +19 -0
- package/registry/items/direction.json +13 -0
- package/registry/items/drag-preview.json +16 -0
- package/registry/items/drawer.json +18 -0
- package/registry/items/dropdown-menu.json +18 -0
- package/registry/items/editable.json +17 -0
- package/registry/items/empty.json +17 -0
- package/registry/items/field.json +19 -0
- package/registry/items/file-upload.json +19 -0
- package/registry/items/floating-panel.json +19 -0
- package/registry/items/floating-toolbar.json +16 -0
- package/registry/items/form.json +14 -0
- package/registry/items/format.json +15 -0
- package/registry/items/gantt.json +22 -0
- package/registry/items/history.json +14 -0
- package/registry/items/hotkeys.json +18 -0
- package/registry/items/hover-card.json +17 -0
- package/registry/items/image-cropper.json +17 -0
- package/registry/items/input-group.json +20 -0
- package/registry/items/input-otp.json +18 -0
- package/registry/items/input.json +15 -0
- package/registry/items/item.json +19 -0
- package/registry/items/json-tree-view.json +17 -0
- package/registry/items/kanban.json +26 -0
- package/registry/items/kbd.json +15 -0
- package/registry/items/label.json +15 -0
- package/registry/items/live-region.json +16 -0
- package/registry/items/marker.json +18 -0
- package/registry/items/marquee.json +17 -0
- package/registry/items/menubar.json +19 -0
- package/registry/items/message.json +15 -0
- package/registry/items/navigation-menu.json +19 -0
- package/registry/items/node-graph.json +22 -0
- package/registry/items/number-input.json +18 -0
- package/registry/items/pagination.json +18 -0
- package/registry/items/password-input.json +18 -0
- package/registry/items/popconfirm.json +20 -0
- package/registry/items/popover.json +18 -0
- package/registry/items/progress.json +17 -0
- package/registry/items/qr-code.json +17 -0
- package/registry/items/query-builder.json +23 -0
- package/registry/items/radio-group.json +17 -0
- package/registry/items/rating-group.json +18 -0
- package/registry/items/resizable.json +17 -0
- package/registry/items/rich-text-editor.json +37 -0
- package/registry/items/row-layout.json +15 -0
- package/registry/items/scheduler.json +23 -0
- package/registry/items/scroll-area.json +17 -0
- package/registry/items/segment-group.json +17 -0
- package/registry/items/select.json +19 -0
- package/registry/items/separator.json +15 -0
- package/registry/items/sheet.json +19 -0
- package/registry/items/sidebar.json +27 -0
- package/registry/items/signature-pad.json +19 -0
- package/registry/items/skeleton.json +15 -0
- package/registry/items/slider.json +17 -0
- package/registry/items/sonner.json +17 -0
- package/registry/items/spinner.json +17 -0
- package/registry/items/steps.json +19 -0
- package/registry/items/swap.json +17 -0
- package/registry/items/switch.json +17 -0
- package/registry/items/table.json +16 -0
- package/registry/items/tabs.json +18 -0
- package/registry/items/tags-input.json +18 -0
- package/registry/items/textarea.json +15 -0
- package/registry/items/time.json +14 -0
- package/registry/items/timer.json +18 -0
- package/registry/items/toc.json +17 -0
- package/registry/items/toggle-group.json +19 -0
- package/registry/items/toggle.json +18 -0
- package/registry/items/tooltip.json +17 -0
- package/registry/items/tour.json +19 -0
- package/registry/items/transfer-list.json +24 -0
- package/registry/items/tree-select.json +24 -0
- package/registry/items/tree-view.json +18 -0
- package/registry/items/use-mobile.json +13 -0
- package/registry/items/utils.json +17 -0
- package/registry/items/virtual-list.json +16 -0
- package/src/components/ui/accordion.tsx +111 -0
- package/src/components/ui/activity-feed.tsx +228 -0
- package/src/components/ui/alert-dialog.tsx +204 -0
- package/src/components/ui/alert.tsx +55 -0
- package/src/components/ui/angle-slider.tsx +117 -0
- package/src/components/ui/app-shell.tsx +985 -0
- package/src/components/ui/aspect-ratio.tsx +35 -0
- package/src/components/ui/attachment.tsx +193 -0
- package/src/components/ui/avatar.tsx +94 -0
- package/src/components/ui/badge.tsx +45 -0
- package/src/components/ui/breadcrumb.tsx +93 -0
- package/src/components/ui/bubble.tsx +119 -0
- package/src/components/ui/button-group.tsx +79 -0
- package/src/components/ui/button.tsx +65 -0
- package/src/components/ui/calendar.tsx +172 -0
- package/src/components/ui/canvas.tsx +723 -0
- package/src/components/ui/card.tsx +69 -0
- package/src/components/ui/carousel.tsx +228 -0
- package/src/components/ui/cascader.tsx +754 -0
- package/src/components/ui/chart.tsx +303 -0
- package/src/components/ui/chat.tsx +544 -0
- package/src/components/ui/checkbox.tsx +94 -0
- package/src/components/ui/clipboard.tsx +94 -0
- package/src/components/ui/collapsible.tsx +32 -0
- package/src/components/ui/color-picker.tsx +441 -0
- package/src/components/ui/combobox.tsx +400 -0
- package/src/components/ui/command.tsx +292 -0
- package/src/components/ui/comment-thread.tsx +923 -0
- package/src/components/ui/context-menu.tsx +331 -0
- package/src/components/ui/data-grid.tsx +1227 -0
- package/src/components/ui/data-table.tsx +993 -0
- package/src/components/ui/date-input.tsx +103 -0
- package/src/components/ui/dialog.tsx +159 -0
- package/src/components/ui/direction.tsx +32 -0
- package/src/components/ui/drawer.tsx +200 -0
- package/src/components/ui/dropdown-menu.tsx +329 -0
- package/src/components/ui/editable.tsx +90 -0
- package/src/components/ui/empty.tsx +86 -0
- package/src/components/ui/field.tsx +218 -0
- package/src/components/ui/file-upload.tsx +204 -0
- package/src/components/ui/floating-panel.tsx +199 -0
- package/src/components/ui/floating-toolbar.tsx +79 -0
- package/src/components/ui/format.tsx +22 -0
- package/src/components/ui/gantt.tsx +950 -0
- package/src/components/ui/hotkeys.tsx +340 -0
- package/src/components/ui/hover-card.tsx +83 -0
- package/src/components/ui/image-cropper.tsx +100 -0
- package/src/components/ui/input-group.tsx +133 -0
- package/src/components/ui/input-otp.tsx +82 -0
- package/src/components/ui/input.tsx +18 -0
- package/src/components/ui/item.tsx +174 -0
- package/src/components/ui/json-tree-view.tsx +37 -0
- package/src/components/ui/kanban.tsx +884 -0
- package/src/components/ui/kbd.tsx +20 -0
- package/src/components/ui/label.tsx +30 -0
- package/src/components/ui/live-region.tsx +54 -0
- package/src/components/ui/marker.tsx +66 -0
- package/src/components/ui/marquee.tsx +61 -0
- package/src/components/ui/menubar.tsx +456 -0
- package/src/components/ui/message.tsx +74 -0
- package/src/components/ui/navigation-menu.tsx +202 -0
- package/src/components/ui/node-graph.tsx +1723 -0
- package/src/components/ui/number-input.tsx +148 -0
- package/src/components/ui/pagination.tsx +88 -0
- package/src/components/ui/password-input.tsx +104 -0
- package/src/components/ui/popconfirm.tsx +149 -0
- package/src/components/ui/popover.tsx +126 -0
- package/src/components/ui/progress.tsx +114 -0
- package/src/components/ui/qr-code.tsx +51 -0
- package/src/components/ui/query-builder.tsx +938 -0
- package/src/components/ui/radio-group.tsx +108 -0
- package/src/components/ui/rating-group.tsx +91 -0
- package/src/components/ui/resizable.tsx +41 -0
- package/src/components/ui/rich-text-editor.tsx +845 -0
- package/src/components/ui/scheduler.tsx +1164 -0
- package/src/components/ui/scroll-area.tsx +82 -0
- package/src/components/ui/segment-group.tsx +95 -0
- package/src/components/ui/select.tsx +354 -0
- package/src/components/ui/separator.tsx +32 -0
- package/src/components/ui/sheet.tsx +130 -0
- package/src/components/ui/sidebar.tsx +665 -0
- package/src/components/ui/signature-pad.tsx +112 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/slider.tsx +183 -0
- package/src/components/ui/sonner.tsx +37 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/steps.tsx +152 -0
- package/src/components/ui/swap.tsx +33 -0
- package/src/components/ui/switch.tsx +83 -0
- package/src/components/ui/table.tsx +72 -0
- package/src/components/ui/tabs.tsx +100 -0
- package/src/components/ui/tags-input.tsx +153 -0
- package/src/components/ui/textarea.tsx +17 -0
- package/src/components/ui/timer.tsx +67 -0
- package/src/components/ui/toc.tsx +64 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +46 -0
- package/src/components/ui/tooltip.tsx +113 -0
- package/src/components/ui/tour.tsx +168 -0
- package/src/components/ui/transfer-list.tsx +700 -0
- package/src/components/ui/tree-select.tsx +638 -0
- package/src/components/ui/tree-view.tsx +217 -0
- package/src/components/ui/virtual-list.tsx +343 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/lib/controllable.ts +31 -0
- package/src/lib/data-table-adapter.ts +67 -0
- package/src/lib/drag-preview.ts +39 -0
- package/src/lib/form.ts +39 -0
- package/src/lib/history.ts +55 -0
- package/src/lib/row-layout.ts +81 -0
- package/src/lib/table.ts +483 -0
- package/src/lib/time.ts +37 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/arkcn.css +764 -0
- package/src/styles/index.css +3 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Menu as ContextMenuPrimitive, Portal as PortalPrimitive } from "@ark-ui/react"
|
|
6
|
+
import { CheckIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
function ContextMenu({
|
|
9
|
+
lazyMount = true,
|
|
10
|
+
unmountOnExit = true,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
13
|
+
return <ContextMenuPrimitive.Root lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.ContextTrigger>) {
|
|
17
|
+
return (
|
|
18
|
+
<ContextMenuPrimitive.ContextTrigger
|
|
19
|
+
data-slot="context-menu-trigger"
|
|
20
|
+
className={cn("select-none", className)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function ContextMenuPortal({ ...props }: React.ComponentProps<typeof PortalPrimitive>) {
|
|
27
|
+
return <PortalPrimitive {...props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function ContextMenuContext({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Context>) {
|
|
31
|
+
return <ContextMenuPrimitive.Context {...props} />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function ContextMenuPositioner({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Positioner>) {
|
|
35
|
+
return (
|
|
36
|
+
<ContextMenuPrimitive.Positioner
|
|
37
|
+
data-slot="context-menu-positioner"
|
|
38
|
+
className={cn("[--z-index:50]", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
45
|
+
return (
|
|
46
|
+
<ContextMenuPortal>
|
|
47
|
+
<ContextMenuPositioner>
|
|
48
|
+
<ContextMenuPrimitive.Content
|
|
49
|
+
data-slot="context-menu-content"
|
|
50
|
+
className={cn(
|
|
51
|
+
"z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
52
|
+
className
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
</ContextMenuPositioner>
|
|
57
|
+
</ContextMenuPortal>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.ItemGroup>) {
|
|
62
|
+
return <ContextMenuPrimitive.ItemGroup data-slot="context-menu-group" {...props} />
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function ContextMenuItem({
|
|
66
|
+
className,
|
|
67
|
+
inset,
|
|
68
|
+
variant = "default",
|
|
69
|
+
value,
|
|
70
|
+
...props
|
|
71
|
+
}: Omit<React.ComponentProps<typeof ContextMenuPrimitive.Item>, "value"> & {
|
|
72
|
+
value?: string
|
|
73
|
+
inset?: boolean
|
|
74
|
+
variant?: "default" | "destructive"
|
|
75
|
+
}) {
|
|
76
|
+
const id = React.useId()
|
|
77
|
+
return (
|
|
78
|
+
<ContextMenuPrimitive.Item
|
|
79
|
+
data-slot="context-menu-item"
|
|
80
|
+
data-inset={inset}
|
|
81
|
+
data-variant={variant}
|
|
82
|
+
value={value ?? id}
|
|
83
|
+
className={cn(
|
|
84
|
+
"group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-highlighted:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
85
|
+
className
|
|
86
|
+
)}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function ContextMenuItemText({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.ItemText>) {
|
|
93
|
+
return <ContextMenuPrimitive.ItemText data-slot="context-menu-item-text" {...props} />
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function ContextMenuItemIndicator({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.ItemIndicator>) {
|
|
100
|
+
return (
|
|
101
|
+
<ContextMenuPrimitive.ItemIndicator
|
|
102
|
+
data-slot="context-menu-item-indicator"
|
|
103
|
+
className={cn("pointer-events-none absolute right-2 flex items-center justify-center", className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const optionItemClassName =
|
|
110
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
111
|
+
|
|
112
|
+
function ContextMenuCheckboxItem({
|
|
113
|
+
className,
|
|
114
|
+
children,
|
|
115
|
+
checked = false,
|
|
116
|
+
inset,
|
|
117
|
+
value,
|
|
118
|
+
...props
|
|
119
|
+
}: Omit<React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>, "checked" | "value"> & {
|
|
120
|
+
checked?: boolean
|
|
121
|
+
value?: string
|
|
122
|
+
inset?: boolean
|
|
123
|
+
}) {
|
|
124
|
+
const id = React.useId()
|
|
125
|
+
return (
|
|
126
|
+
<ContextMenuPrimitive.CheckboxItem
|
|
127
|
+
data-slot="context-menu-checkbox-item"
|
|
128
|
+
data-inset={inset}
|
|
129
|
+
className={cn(optionItemClassName, className)}
|
|
130
|
+
checked={checked}
|
|
131
|
+
value={value ?? id}
|
|
132
|
+
{...props}
|
|
133
|
+
>
|
|
134
|
+
<ContextMenuItemIndicator data-slot="context-menu-checkbox-item-indicator">
|
|
135
|
+
<CheckIcon />
|
|
136
|
+
</ContextMenuItemIndicator>
|
|
137
|
+
{children}
|
|
138
|
+
</ContextMenuPrimitive.CheckboxItem>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItemGroup>) {
|
|
143
|
+
return <ContextMenuPrimitive.RadioItemGroup data-slot="context-menu-radio-group" {...props} />
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function ContextMenuRadioItem({
|
|
147
|
+
className,
|
|
148
|
+
children,
|
|
149
|
+
inset,
|
|
150
|
+
...props
|
|
151
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {
|
|
152
|
+
inset?: boolean
|
|
153
|
+
}) {
|
|
154
|
+
return (
|
|
155
|
+
<ContextMenuPrimitive.RadioItem
|
|
156
|
+
data-slot="context-menu-radio-item"
|
|
157
|
+
data-inset={inset}
|
|
158
|
+
className={cn(optionItemClassName, className)}
|
|
159
|
+
{...props}
|
|
160
|
+
>
|
|
161
|
+
<ContextMenuItemIndicator data-slot="context-menu-radio-item-indicator">
|
|
162
|
+
<CheckIcon />
|
|
163
|
+
</ContextMenuItemIndicator>
|
|
164
|
+
{children}
|
|
165
|
+
</ContextMenuPrimitive.RadioItem>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function ContextMenuLabel({
|
|
170
|
+
className,
|
|
171
|
+
inset,
|
|
172
|
+
...props
|
|
173
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.ItemGroupLabel> & {
|
|
174
|
+
inset?: boolean
|
|
175
|
+
}) {
|
|
176
|
+
return (
|
|
177
|
+
<ContextMenuPrimitive.ItemGroupLabel
|
|
178
|
+
data-slot="context-menu-label"
|
|
179
|
+
data-inset={inset}
|
|
180
|
+
className={cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className)}
|
|
181
|
+
{...props}
|
|
182
|
+
/>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
187
|
+
return (
|
|
188
|
+
<ContextMenuPrimitive.Separator
|
|
189
|
+
data-slot="context-menu-separator"
|
|
190
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
191
|
+
{...props}
|
|
192
|
+
/>
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
197
|
+
return (
|
|
198
|
+
<span
|
|
199
|
+
data-slot="context-menu-shortcut"
|
|
200
|
+
className={cn(
|
|
201
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-data-highlighted/context-menu-item:text-accent-foreground",
|
|
202
|
+
className
|
|
203
|
+
)}
|
|
204
|
+
{...props}
|
|
205
|
+
/>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function ContextMenuSub({
|
|
210
|
+
lazyMount = true,
|
|
211
|
+
unmountOnExit = true,
|
|
212
|
+
...props
|
|
213
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
214
|
+
return <ContextMenuPrimitive.Root lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...props} />
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function ContextMenuSubTrigger({
|
|
218
|
+
className,
|
|
219
|
+
inset,
|
|
220
|
+
children,
|
|
221
|
+
...props
|
|
222
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.TriggerItem> & {
|
|
223
|
+
inset?: boolean
|
|
224
|
+
}) {
|
|
225
|
+
return (
|
|
226
|
+
<ContextMenuPrimitive.TriggerItem
|
|
227
|
+
data-slot="context-menu-sub-trigger"
|
|
228
|
+
data-inset={inset}
|
|
229
|
+
className={cn(
|
|
230
|
+
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
231
|
+
className
|
|
232
|
+
)}
|
|
233
|
+
{...props}
|
|
234
|
+
>
|
|
235
|
+
{children}
|
|
236
|
+
<ChevronRightIcon className="ml-auto" />
|
|
237
|
+
</ContextMenuPrimitive.TriggerItem>
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
242
|
+
return (
|
|
243
|
+
<ContextMenuPortal>
|
|
244
|
+
<ContextMenuPositioner>
|
|
245
|
+
<ContextMenuPrimitive.Content
|
|
246
|
+
data-slot="context-menu-sub-content"
|
|
247
|
+
className={cn(
|
|
248
|
+
"z-50 min-w-32 origin-(--transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
249
|
+
className
|
|
250
|
+
)}
|
|
251
|
+
{...props}
|
|
252
|
+
/>
|
|
253
|
+
</ContextMenuPositioner>
|
|
254
|
+
</ContextMenuPortal>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** Render-prop access to one item's state (`{ selected, highlighted, disabled, ... }`). */
|
|
259
|
+
function ContextMenuItemContext({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.ItemContext>) {
|
|
260
|
+
return <ContextMenuPrimitive.ItemContext {...props} />
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** A click trigger for the same menu, alongside the right-click `ContextMenuTrigger`. */
|
|
264
|
+
function ContextMenuClickTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
265
|
+
return <ContextMenuPrimitive.Trigger data-slot="context-menu-click-trigger" {...props} />
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function ContextMenuIndicator({
|
|
269
|
+
className,
|
|
270
|
+
children,
|
|
271
|
+
...props
|
|
272
|
+
}: React.ComponentProps<typeof ContextMenuPrimitive.Indicator>) {
|
|
273
|
+
return (
|
|
274
|
+
<ContextMenuPrimitive.Indicator
|
|
275
|
+
data-slot="context-menu-indicator"
|
|
276
|
+
className={cn("inline-flex transition-transform data-[state=open]:rotate-180 [&_svg]:size-4", className)}
|
|
277
|
+
{...props}
|
|
278
|
+
>
|
|
279
|
+
{children ?? <ChevronDownIcon />}
|
|
280
|
+
</ContextMenuPrimitive.Indicator>
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function ContextMenuArrow({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Arrow>) {
|
|
285
|
+
return (
|
|
286
|
+
<ContextMenuPrimitive.Arrow
|
|
287
|
+
data-slot="context-menu-arrow"
|
|
288
|
+
className={cn("[--arrow-background:var(--color-popover)] [--arrow-size:0.625rem]", className)}
|
|
289
|
+
{...props}
|
|
290
|
+
>
|
|
291
|
+
<ContextMenuArrowTip />
|
|
292
|
+
</ContextMenuPrimitive.Arrow>
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function ContextMenuArrowTip({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.ArrowTip>) {
|
|
297
|
+
return (
|
|
298
|
+
<ContextMenuPrimitive.ArrowTip
|
|
299
|
+
data-slot="context-menu-arrow-tip"
|
|
300
|
+
className={cn("border-t border-l border-foreground/10", className)}
|
|
301
|
+
{...props}
|
|
302
|
+
/>
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export {
|
|
307
|
+
ContextMenu,
|
|
308
|
+
ContextMenuCheckboxItem,
|
|
309
|
+
ContextMenuContent,
|
|
310
|
+
ContextMenuContext,
|
|
311
|
+
ContextMenuGroup,
|
|
312
|
+
ContextMenuItem,
|
|
313
|
+
ContextMenuItemIndicator,
|
|
314
|
+
ContextMenuItemText,
|
|
315
|
+
ContextMenuLabel,
|
|
316
|
+
ContextMenuPortal,
|
|
317
|
+
ContextMenuPositioner,
|
|
318
|
+
ContextMenuRadioGroup,
|
|
319
|
+
ContextMenuRadioItem,
|
|
320
|
+
ContextMenuSeparator,
|
|
321
|
+
ContextMenuShortcut,
|
|
322
|
+
ContextMenuSub,
|
|
323
|
+
ContextMenuSubContent,
|
|
324
|
+
ContextMenuSubTrigger,
|
|
325
|
+
ContextMenuTrigger,
|
|
326
|
+
ContextMenuItemContext,
|
|
327
|
+
ContextMenuArrow,
|
|
328
|
+
ContextMenuArrowTip,
|
|
329
|
+
ContextMenuClickTrigger,
|
|
330
|
+
ContextMenuIndicator,
|
|
331
|
+
}
|