@chat-js/cli 0.6.1 → 0.6.2
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/dist/index.js +16938 -16786
- package/package.json +1 -1
- package/templates/chat-app/app/(auth)/login/page.tsx +3 -3
- package/templates/chat-app/app/(chat)/api/chat/route.ts +4 -60
- package/templates/chat-app/app/not-found.tsx +2 -2
- package/templates/chat-app/chat.config.ts +3 -0
- package/templates/chat-app/components/ai-elements/actions.tsx +44 -44
- package/templates/chat-app/components/ai-elements/artifact.tsx +92 -92
- package/templates/chat-app/components/ai-elements/code-block.tsx +143 -143
- package/templates/chat-app/components/ai-elements/context.tsx +313 -313
- package/templates/chat-app/components/ai-elements/conversation.tsx +65 -65
- package/templates/chat-app/components/ai-elements/extra/conversation-content-scroll-area.tsx +29 -29
- package/templates/chat-app/components/ai-elements/extra/mcp-tool-header.tsx +27 -27
- package/templates/chat-app/components/ai-elements/message.tsx +341 -344
- package/templates/chat-app/components/ai-elements/parseIncompleteMarkdown.tsx +122 -122
- package/templates/chat-app/components/ai-elements/prompt-input.tsx +1059 -1059
- package/templates/chat-app/components/ai-elements/reasoning.tsx +131 -131
- package/templates/chat-app/components/ai-elements/response.tsx +15 -12
- package/templates/chat-app/components/ai-elements/sandbox.tsx +84 -84
- package/templates/chat-app/components/ai-elements/shimmer.tsx +47 -47
- package/templates/chat-app/components/ai-elements/suggestion.tsx +33 -33
- package/templates/chat-app/components/ai-elements/tool.tsx +118 -118
- package/templates/chat-app/components/app-sidebar-history-conditional.tsx +3 -3
- package/templates/chat-app/components/app-sidebar.tsx +3 -3
- package/templates/chat-app/components/connectors-dropdown.tsx +6 -3
- package/templates/chat-app/components/deep-research-progress.tsx +1 -1
- package/templates/chat-app/components/header-breadcrumb.tsx +14 -11
- package/templates/chat-app/components/internal-link.tsx +73 -0
- package/templates/chat-app/components/login-form.tsx +5 -5
- package/templates/chat-app/components/message-parts.tsx +1 -71
- package/templates/chat-app/components/model-selector.tsx +3 -3
- package/templates/chat-app/components/new-chat-button.tsx +4 -4
- package/templates/chat-app/components/part/document-common.tsx +3 -3
- package/templates/chat-app/components/part/document-tool.tsx +3 -3
- package/templates/chat-app/components/part/message-annotations.tsx +2 -2
- package/templates/chat-app/components/part/tool-part.tsx +92 -0
- package/templates/chat-app/components/project-chat-item.tsx +2 -2
- package/templates/chat-app/components/research-progress.tsx +2 -2
- package/templates/chat-app/components/research-task.tsx +1 -1
- package/templates/chat-app/components/research-tasks.tsx +1 -1
- package/templates/chat-app/components/settings/connectors-settings.tsx +4 -4
- package/templates/chat-app/components/settings/mcp-details-page.tsx +5 -5
- package/templates/chat-app/components/settings/settings-nav.tsx +3 -3
- package/templates/chat-app/components/sidebar-chat-item.tsx +4 -12
- package/templates/chat-app/components/sidebar-project-item.tsx +4 -11
- package/templates/chat-app/components/sidebar-top-row.tsx +7 -7
- package/templates/chat-app/components/sidebar-user-nav.tsx +3 -3
- package/templates/chat-app/components/signup-form.tsx +8 -5
- package/templates/chat-app/components/source-badge.tsx +3 -9
- package/templates/chat-app/components/sources.tsx +1 -1
- package/templates/chat-app/components/ui/accordion.tsx +32 -32
- package/templates/chat-app/components/ui/alert-dialog.tsx +103 -103
- package/templates/chat-app/components/ui/alert.tsx +36 -36
- package/templates/chat-app/components/ui/avatar.tsx +28 -28
- package/templates/chat-app/components/ui/badge.tsx +22 -22
- package/templates/chat-app/components/ui/breadcrumb.tsx +72 -72
- package/templates/chat-app/components/ui/button-group.tsx +58 -58
- package/templates/chat-app/components/ui/button.tsx +45 -45
- package/templates/chat-app/components/ui/card.tsx +65 -65
- package/templates/chat-app/components/ui/checkbox.tsx +16 -16
- package/templates/chat-app/components/ui/collapsible.tsx +1 -1
- package/templates/chat-app/components/ui/command.tsx +137 -137
- package/templates/chat-app/components/ui/dialog.tsx +94 -94
- package/templates/chat-app/components/ui/drawer.tsx +68 -68
- package/templates/chat-app/components/ui/dropdown-menu.tsx +184 -184
- package/templates/chat-app/components/ui/empty.tsx +76 -76
- package/templates/chat-app/components/ui/extra/action-container.tsx +3 -3
- package/templates/chat-app/components/ui/extra/scroll-area-viewport-ref.tsx +24 -24
- package/templates/chat-app/components/ui/form.tsx +112 -112
- package/templates/chat-app/components/ui/hover-card.tsx +25 -25
- package/templates/chat-app/components/ui/input-group.tsx +126 -126
- package/templates/chat-app/components/ui/input.tsx +13 -13
- package/templates/chat-app/components/ui/label.tsx +12 -12
- package/templates/chat-app/components/ui/popover.tsx +25 -25
- package/templates/chat-app/components/ui/progress.tsx +19 -19
- package/templates/chat-app/components/ui/resizable.tsx +27 -27
- package/templates/chat-app/components/ui/scroll-area.tsx +30 -30
- package/templates/chat-app/components/ui/select.tsx +108 -108
- package/templates/chat-app/components/ui/separator.tsx +16 -16
- package/templates/chat-app/components/ui/sheet.tsx +91 -91
- package/templates/chat-app/components/ui/sidebar.tsx +615 -615
- package/templates/chat-app/components/ui/skeleton.tsx +7 -7
- package/templates/chat-app/components/ui/slider.tsx +50 -50
- package/templates/chat-app/components/ui/spinner.tsx +8 -8
- package/templates/chat-app/components/ui/switch.tsx +16 -16
- package/templates/chat-app/components/ui/table.tsx +71 -71
- package/templates/chat-app/components/ui/tabs.tsx +31 -31
- package/templates/chat-app/components/ui/textarea.tsx +10 -10
- package/templates/chat-app/components/ui/toggle.tsx +31 -31
- package/templates/chat-app/components/ui/tooltip.tsx +48 -48
- package/templates/chat-app/components/upgrade-cta/limit-display.tsx +7 -7
- package/templates/chat-app/components/upgrade-cta/login-cta-banner.tsx +3 -3
- package/templates/chat-app/components/upgrade-cta/login-prompt.tsx +3 -3
- package/templates/chat-app/hooks/use-mobile.ts +13 -13
- package/templates/chat-app/lib/ai/core-chat-agent.ts +25 -14
- package/templates/chat-app/lib/ai/eval-agent.ts +4 -5
- package/templates/chat-app/lib/ai/installed-tools.ts +12 -0
- package/templates/chat-app/lib/ai/mcp/mcp-client.ts +2 -2
- package/templates/chat-app/lib/ai/models.generated.ts +4236 -4585
- package/templates/chat-app/lib/ai/tool-renderer-registry.ts +31 -0
- package/templates/chat-app/lib/ai/types.ts +15 -20
- package/templates/chat-app/lib/config-requirements.ts +11 -6
- package/templates/chat-app/lib/config-schema.ts +13 -0
- package/templates/chat-app/lib/stores/hooks-message-parts.ts +1 -1
- package/templates/chat-app/lib/utils.ts +157 -157
- package/templates/chat-app/package.json +1 -1
- package/templates/chat-app/scripts/check-env.ts +229 -2
- package/templates/chat-app/tools/chatjs/_shared/lib/tool-part.ts +5 -0
- package/templates/chat-app/{components/part/weather.tsx → tools/chatjs/get-weather/renderer.tsx} +24 -38
- package/templates/chat-app/{components/part/retrieve-url.tsx → tools/chatjs/retrieve-url/renderer.tsx} +20 -15
- package/templates/chat-app/{lib/ai/tools/retrieve-url.ts → tools/chatjs/retrieve-url/tool.ts} +46 -7
- package/templates/chat-app/tools/chatjs/tools.ts +16 -0
- package/templates/chat-app/tools/chatjs/ui.ts +17 -0
- package/templates/chat-app/tools/chatjs/word-count/renderer.tsx +50 -0
- package/templates/chat-app/tools/chatjs/word-count/tool.ts +30 -0
- package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.ts +3 -5
- package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/deep-research.ts +2 -3
- package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/pipeline.ts +1 -1
- package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/types.ts +1 -1
- package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/utils.ts +7 -7
- package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/types.ts +1 -1
- package/templates/chat-app/{lib/ai/tools → tools/platform}/generate-video.ts +4 -6
- package/templates/chat-app/{lib/ai/tools → tools/platform}/read-document.ts +2 -2
- package/templates/chat-app/{lib/ai/tools → tools/platform}/steps/multi-query-web-search.ts +1 -1
- package/templates/chat-app/{lib/ai/tools → tools/platform}/steps/web-search.ts +1 -1
- package/templates/chat-app/{lib/ai/tools → tools/platform}/tools.ts +20 -20
- package/templates/chat-app/{lib/ai/tools → tools/platform}/web-search.ts +7 -5
- package/templates/electron/CHANGELOG.md +7 -1
- package/templates/electron/package.json +1 -1
- package/templates/chat-app/lib/ai/tools/tools-definitions.ts +0 -83
- /package/templates/chat-app/{lib/ai/tools/get-weather.ts → tools/chatjs/get-weather/tool.ts} +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.javascript.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.python.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.shared.test.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.shared.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/code-execution.types.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/configuration.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/prompts.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/researcher-agent.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/deep-research/supervisor-agent.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/code-guidelines.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-code-document.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-sheet-document.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/create-text-document.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-code-document.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-sheet-document.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/edit-text-document.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/sheet-guidelines.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/documents/text-guidelines.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/generate-image.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/research-updates-schema.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/steps/search-utils.ts +0 -0
- /package/templates/chat-app/{lib/ai/tools → tools/platform}/types.ts +0 -0
|
@@ -6,13 +6,13 @@ import { Drawer as DrawerPrimitive } from "vaul";
|
|
|
6
6
|
import { cn } from "@/lib/utils";
|
|
7
7
|
|
|
8
8
|
const Drawer = ({
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
shouldScaleBackground = true,
|
|
10
|
+
...props
|
|
11
11
|
}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
<DrawerPrimitive.Root
|
|
13
|
+
shouldScaleBackground={shouldScaleBackground}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
16
|
);
|
|
17
17
|
Drawer.displayName = "Drawer";
|
|
18
18
|
|
|
@@ -23,96 +23,96 @@ const DrawerPortal = DrawerPrimitive.Portal;
|
|
|
23
23
|
const DrawerClose = DrawerPrimitive.Close;
|
|
24
24
|
|
|
25
25
|
const DrawerOverlay = React.forwardRef<
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
React.ElementRef<typeof DrawerPrimitive.Overlay>,
|
|
27
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
|
|
28
28
|
>(({ className, ...props }, ref) => (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
<DrawerPrimitive.Overlay
|
|
30
|
+
className={cn("fixed inset-0 z-50 bg-black/80", className)}
|
|
31
|
+
ref={ref}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
34
|
));
|
|
35
35
|
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
36
36
|
|
|
37
37
|
const DrawerContent = React.forwardRef<
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
39
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
40
40
|
>(({ className, children, ...props }, ref) => (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
<DrawerPortal>
|
|
42
|
+
<DrawerOverlay />
|
|
43
|
+
<DrawerPrimitive.Content
|
|
44
|
+
className={cn(
|
|
45
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
ref={ref}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
|
|
52
|
+
{children}
|
|
53
|
+
</DrawerPrimitive.Content>
|
|
54
|
+
</DrawerPortal>
|
|
55
55
|
));
|
|
56
56
|
DrawerContent.displayName = "DrawerContent";
|
|
57
57
|
|
|
58
58
|
const DrawerHeader = ({
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
className,
|
|
60
|
+
...props
|
|
61
61
|
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
<div
|
|
63
|
+
className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
66
|
);
|
|
67
67
|
DrawerHeader.displayName = "DrawerHeader";
|
|
68
68
|
|
|
69
69
|
const DrawerFooter = ({
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
72
|
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
<div
|
|
74
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
77
|
);
|
|
78
78
|
DrawerFooter.displayName = "DrawerFooter";
|
|
79
79
|
|
|
80
80
|
const DrawerTitle = React.forwardRef<
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
82
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
83
83
|
>(({ className, ...props }, ref) => (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
<DrawerPrimitive.Title
|
|
85
|
+
className={cn(
|
|
86
|
+
"font-semibold text-lg leading-none tracking-tight",
|
|
87
|
+
className,
|
|
88
|
+
)}
|
|
89
|
+
ref={ref}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
92
|
));
|
|
93
93
|
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
94
94
|
|
|
95
95
|
const DrawerDescription = React.forwardRef<
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
React.ElementRef<typeof DrawerPrimitive.Description>,
|
|
97
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
|
|
98
98
|
>(({ className, ...props }, ref) => (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
<DrawerPrimitive.Description
|
|
100
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
101
|
+
ref={ref}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
104
|
));
|
|
105
105
|
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
106
106
|
|
|
107
107
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
Drawer,
|
|
109
|
+
DrawerClose,
|
|
110
|
+
DrawerContent,
|
|
111
|
+
DrawerDescription,
|
|
112
|
+
DrawerFooter,
|
|
113
|
+
DrawerHeader,
|
|
114
|
+
DrawerOverlay,
|
|
115
|
+
DrawerPortal,
|
|
116
|
+
DrawerTitle,
|
|
117
|
+
DrawerTrigger,
|
|
118
118
|
};
|
|
@@ -7,251 +7,251 @@ import type * as React from "react";
|
|
|
7
7
|
import { cn } from "@/lib/utils";
|
|
8
8
|
|
|
9
9
|
function DropdownMenu({
|
|
10
|
-
|
|
10
|
+
...props
|
|
11
11
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
12
|
-
|
|
12
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function DropdownMenuPortal({
|
|
16
|
-
|
|
16
|
+
...props
|
|
17
17
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
return (
|
|
19
|
+
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
20
|
+
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function DropdownMenuTrigger({
|
|
24
|
-
|
|
24
|
+
...props
|
|
25
25
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
return (
|
|
27
|
+
<DropdownMenuPrimitive.Trigger
|
|
28
|
+
data-slot="dropdown-menu-trigger"
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function DropdownMenuContent({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
className,
|
|
36
|
+
sideOffset = 4,
|
|
37
|
+
...props
|
|
38
38
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
return (
|
|
40
|
+
<DropdownMenuPrimitive.Portal>
|
|
41
|
+
<DropdownMenuPrimitive.Content
|
|
42
|
+
className={cn(
|
|
43
|
+
"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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
data-slot="dropdown-menu-content"
|
|
47
|
+
sideOffset={sideOffset}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
</DropdownMenuPrimitive.Portal>
|
|
51
|
+
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function DropdownMenuGroup({
|
|
55
|
-
|
|
55
|
+
...props
|
|
56
56
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
return (
|
|
58
|
+
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
59
|
+
);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function DropdownMenuItem({
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
className,
|
|
64
|
+
inset,
|
|
65
|
+
variant = "default",
|
|
66
|
+
...props
|
|
67
67
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
inset?: boolean;
|
|
69
|
+
variant?: "default" | "destructive";
|
|
70
70
|
}) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
return (
|
|
72
|
+
<DropdownMenuPrimitive.Item
|
|
73
|
+
className={cn(
|
|
74
|
+
"data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
75
|
+
className,
|
|
76
|
+
)}
|
|
77
|
+
data-inset={inset}
|
|
78
|
+
data-slot="dropdown-menu-item"
|
|
79
|
+
data-variant={variant}
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
function DropdownMenuCheckboxItem({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
className,
|
|
87
|
+
children,
|
|
88
|
+
checked,
|
|
89
|
+
...props
|
|
90
90
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
91
|
+
return (
|
|
92
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
93
|
+
checked={checked}
|
|
94
|
+
className={cn(
|
|
95
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
96
|
+
className,
|
|
97
|
+
)}
|
|
98
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
99
|
+
{...props}
|
|
100
|
+
>
|
|
101
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
102
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
103
|
+
<CheckIcon className="size-4" />
|
|
104
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
105
|
+
</span>
|
|
106
|
+
{children}
|
|
107
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
108
|
+
);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
function DropdownMenuRadioGroup({
|
|
112
|
-
|
|
112
|
+
...props
|
|
113
113
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
return (
|
|
115
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
116
|
+
data-slot="dropdown-menu-radio-group"
|
|
117
|
+
{...props}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function DropdownMenuRadioItem({
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
className,
|
|
124
|
+
children,
|
|
125
|
+
...props
|
|
126
126
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
return (
|
|
128
|
+
<DropdownMenuPrimitive.RadioItem
|
|
129
|
+
className={cn(
|
|
130
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
131
|
+
className,
|
|
132
|
+
)}
|
|
133
|
+
data-slot="dropdown-menu-radio-item"
|
|
134
|
+
{...props}
|
|
135
|
+
>
|
|
136
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
137
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
138
|
+
<CircleIcon className="size-2 fill-current" />
|
|
139
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
140
|
+
</span>
|
|
141
|
+
{children}
|
|
142
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
143
|
+
);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
function DropdownMenuLabel({
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
className,
|
|
148
|
+
inset,
|
|
149
|
+
...props
|
|
150
150
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
151
|
-
|
|
151
|
+
inset?: boolean;
|
|
152
152
|
}) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
return (
|
|
154
|
+
<DropdownMenuPrimitive.Label
|
|
155
|
+
className={cn(
|
|
156
|
+
"px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",
|
|
157
|
+
className,
|
|
158
|
+
)}
|
|
159
|
+
data-inset={inset}
|
|
160
|
+
data-slot="dropdown-menu-label"
|
|
161
|
+
{...props}
|
|
162
|
+
/>
|
|
163
|
+
);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
function DropdownMenuSeparator({
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
className,
|
|
168
|
+
...props
|
|
169
169
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
return (
|
|
171
|
+
<DropdownMenuPrimitive.Separator
|
|
172
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
173
|
+
data-slot="dropdown-menu-separator"
|
|
174
|
+
{...props}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
function DropdownMenuShortcut({
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
className,
|
|
181
|
+
...props
|
|
182
182
|
}: React.ComponentProps<"span">) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
183
|
+
return (
|
|
184
|
+
<span
|
|
185
|
+
className={cn(
|
|
186
|
+
"ml-auto text-muted-foreground text-xs tracking-widest",
|
|
187
|
+
className,
|
|
188
|
+
)}
|
|
189
|
+
data-slot="dropdown-menu-shortcut"
|
|
190
|
+
{...props}
|
|
191
|
+
/>
|
|
192
|
+
);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
function DropdownMenuSub({
|
|
196
|
-
|
|
196
|
+
...props
|
|
197
197
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
198
|
-
|
|
198
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
function DropdownMenuSubTrigger({
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
className,
|
|
203
|
+
inset,
|
|
204
|
+
children,
|
|
205
|
+
...props
|
|
206
206
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
207
|
-
|
|
207
|
+
inset?: boolean;
|
|
208
208
|
}) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
209
|
+
return (
|
|
210
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
211
|
+
className={cn(
|
|
212
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[inset]:pl-8 data-[state=open]:text-accent-foreground",
|
|
213
|
+
className,
|
|
214
|
+
)}
|
|
215
|
+
data-inset={inset}
|
|
216
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
217
|
+
{...props}
|
|
218
|
+
>
|
|
219
|
+
{children}
|
|
220
|
+
<ChevronRightIcon className="ml-auto size-4" />
|
|
221
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
222
|
+
);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
function DropdownMenuSubContent({
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
className,
|
|
227
|
+
...props
|
|
228
228
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
229
|
+
return (
|
|
230
|
+
<DropdownMenuPrimitive.SubContent
|
|
231
|
+
className={cn(
|
|
232
|
+
"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] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
233
|
+
className,
|
|
234
|
+
)}
|
|
235
|
+
data-slot="dropdown-menu-sub-content"
|
|
236
|
+
{...props}
|
|
237
|
+
/>
|
|
238
|
+
);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
export {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
242
|
+
DropdownMenu,
|
|
243
|
+
DropdownMenuCheckboxItem,
|
|
244
|
+
DropdownMenuContent,
|
|
245
|
+
DropdownMenuGroup,
|
|
246
|
+
DropdownMenuItem,
|
|
247
|
+
DropdownMenuLabel,
|
|
248
|
+
DropdownMenuPortal,
|
|
249
|
+
DropdownMenuRadioGroup,
|
|
250
|
+
DropdownMenuRadioItem,
|
|
251
|
+
DropdownMenuSeparator,
|
|
252
|
+
DropdownMenuShortcut,
|
|
253
|
+
DropdownMenuSub,
|
|
254
|
+
DropdownMenuSubContent,
|
|
255
|
+
DropdownMenuSubTrigger,
|
|
256
|
+
DropdownMenuTrigger,
|
|
257
257
|
};
|