@chat-js/cli 0.6.1 → 0.6.3
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 +17065 -16667
- 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/gateway-model-defaults.ts +24 -0
- 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 +24 -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 +54 -30
- package/templates/chat-app/{lib/ai/tools → tools/platform}/web-search.ts +7 -5
- package/templates/electron/CHANGELOG.md +16 -2
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import Link from "next/link";
|
|
4
3
|
import { useSearchParams } from "next/navigation";
|
|
5
4
|
import { Suspense, useEffect, useState } from "react";
|
|
6
5
|
import { SocialAuthProviders } from "@/components/auth-providers";
|
|
6
|
+
import { InternalLink } from "@/components/internal-link";
|
|
7
7
|
import {
|
|
8
8
|
Card,
|
|
9
9
|
CardContent,
|
|
@@ -64,9 +64,12 @@ export function SignupForm({
|
|
|
64
64
|
) : (
|
|
65
65
|
<div className="text-center text-sm">
|
|
66
66
|
Already have an account?{" "}
|
|
67
|
-
<
|
|
67
|
+
<InternalLink
|
|
68
|
+
className="underline underline-offset-4"
|
|
69
|
+
href={loginHref}
|
|
70
|
+
>
|
|
68
71
|
Sign in
|
|
69
|
-
</
|
|
72
|
+
</InternalLink>
|
|
70
73
|
</div>
|
|
71
74
|
)}
|
|
72
75
|
</div>
|
|
@@ -74,8 +77,8 @@ export function SignupForm({
|
|
|
74
77
|
</Card>
|
|
75
78
|
<div className="text-balance text-center text-muted-foreground text-xs [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary">
|
|
76
79
|
By clicking continue, you agree to our{" "}
|
|
77
|
-
<
|
|
78
|
-
<
|
|
80
|
+
<InternalLink href="/terms">Terms of Service</InternalLink> and{" "}
|
|
81
|
+
<InternalLink href="/privacy">Privacy Policy</InternalLink>.
|
|
79
82
|
</div>
|
|
80
83
|
</div>
|
|
81
84
|
);
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import Link from "next/link";
|
|
2
1
|
import { Badge } from "@/components/ui/badge";
|
|
3
2
|
import {
|
|
4
3
|
Tooltip,
|
|
5
4
|
TooltipContent,
|
|
6
5
|
TooltipTrigger,
|
|
7
6
|
} from "@/components/ui/tooltip";
|
|
8
|
-
import type { SearchResultItem } from "@/lib/ai/tools/research-updates-schema";
|
|
9
7
|
import { getDomainFromUrl, getFaviconUrl } from "@/lib/url-utils";
|
|
8
|
+
import type { SearchResultItem } from "@/tools/platform/research-updates-schema";
|
|
10
9
|
import { Favicon } from "./favicon";
|
|
11
10
|
|
|
12
11
|
export function WebSourceBadge({ result }: { result: SearchResultItem }) {
|
|
13
12
|
return (
|
|
14
13
|
<Tooltip>
|
|
15
14
|
<TooltipTrigger asChild>
|
|
16
|
-
<
|
|
17
|
-
// @ts-expect-error - result.url is a valid URL
|
|
18
|
-
href={result.url}
|
|
19
|
-
rel="noopener noreferrer"
|
|
20
|
-
target="_blank"
|
|
21
|
-
>
|
|
15
|
+
<a href={result.url} rel="noopener noreferrer" target="_blank">
|
|
22
16
|
<Badge
|
|
23
17
|
className="max-w-[200px] gap-1 truncate text-xs"
|
|
24
18
|
variant="secondary"
|
|
@@ -29,7 +23,7 @@ export function WebSourceBadge({ result }: { result: SearchResultItem }) {
|
|
|
29
23
|
{result.title}
|
|
30
24
|
</span>
|
|
31
25
|
</Badge>
|
|
32
|
-
</
|
|
26
|
+
</a>
|
|
33
27
|
</TooltipTrigger>
|
|
34
28
|
<TooltipContent className="max-w-xs space-y-1 p-3" variant="base">
|
|
35
29
|
<div className="flex items-center gap-2">
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
DrawerTrigger,
|
|
15
15
|
} from "@/components/ui/drawer";
|
|
16
16
|
import { useMediaQuery } from "@/hooks/use-media-query";
|
|
17
|
-
import type { SearchResultItem } from "@/lib/ai/tools/research-updates-schema";
|
|
18
17
|
import { getFaviconUrl } from "@/lib/url-utils";
|
|
19
18
|
import { cn } from "@/lib/utils";
|
|
19
|
+
import type { SearchResultItem } from "@/tools/platform/research-updates-schema";
|
|
20
20
|
import { Favicon } from "./favicon";
|
|
21
21
|
import { FaviconGroup } from "./favicon-group";
|
|
22
22
|
|
|
@@ -9,50 +9,50 @@ import { cn } from "@/lib/utils";
|
|
|
9
9
|
const Accordion = AccordionPrimitive.Root;
|
|
10
10
|
|
|
11
11
|
const AccordionItem = React.forwardRef<
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
13
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
14
14
|
>(({ className, ...props }, ref) => (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
<AccordionPrimitive.Item
|
|
16
|
+
className={cn("border-b", className)}
|
|
17
|
+
ref={ref}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
20
|
));
|
|
21
21
|
AccordionItem.displayName = "AccordionItem";
|
|
22
22
|
|
|
23
23
|
const AccordionTrigger = React.forwardRef<
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
26
26
|
>(({ className, children, ...props }, ref) => (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
<AccordionPrimitive.Header className="flex">
|
|
28
|
+
<AccordionPrimitive.Trigger
|
|
29
|
+
className={cn(
|
|
30
|
+
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
ref={ref}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
38
|
+
</AccordionPrimitive.Trigger>
|
|
39
|
+
</AccordionPrimitive.Header>
|
|
40
40
|
));
|
|
41
41
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
42
42
|
|
|
43
43
|
const AccordionContent = React.forwardRef<
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
45
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
46
46
|
>(({ className, children, ...props }, ref) => (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
<AccordionPrimitive.Content
|
|
48
|
+
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
49
|
+
ref={ref}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|
|
53
|
+
</AccordionPrimitive.Content>
|
|
54
54
|
));
|
|
55
55
|
|
|
56
56
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
57
57
|
|
|
58
|
-
export { Accordion, AccordionItem, AccordionTrigger
|
|
58
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -6,151 +6,151 @@ import { buttonVariants } from "@/components/ui/button";
|
|
|
6
6
|
import { cn } from "@/lib/utils";
|
|
7
7
|
|
|
8
8
|
function AlertDialog({
|
|
9
|
-
|
|
9
|
+
...props
|
|
10
10
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
11
|
-
|
|
11
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function AlertDialogTrigger({
|
|
15
|
-
|
|
15
|
+
...props
|
|
16
16
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
return (
|
|
18
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
19
|
+
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function AlertDialogPortal({
|
|
23
|
-
|
|
23
|
+
...props
|
|
24
24
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
return (
|
|
26
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
27
|
+
);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function AlertDialogOverlay({
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
33
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
return (
|
|
35
|
+
<AlertDialogPrimitive.Overlay
|
|
36
|
+
className={cn(
|
|
37
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
data-slot="alert-dialog-overlay"
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function AlertDialogContent({
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
49
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
return (
|
|
51
|
+
<AlertDialogPortal>
|
|
52
|
+
<AlertDialogOverlay />
|
|
53
|
+
<AlertDialogPrimitive.Content
|
|
54
|
+
className={cn(
|
|
55
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
data-slot="alert-dialog-content"
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
</AlertDialogPortal>
|
|
62
|
+
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function AlertDialogHeader({
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
className,
|
|
67
|
+
...props
|
|
68
68
|
}: React.ComponentProps<"div">) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
return (
|
|
70
|
+
<div
|
|
71
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
72
|
+
data-slot="alert-dialog-header"
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function AlertDialogFooter({
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
81
|
}: React.ComponentProps<"div">) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
return (
|
|
83
|
+
<div
|
|
84
|
+
className={cn(
|
|
85
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
86
|
+
className,
|
|
87
|
+
)}
|
|
88
|
+
data-slot="alert-dialog-footer"
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
function AlertDialogTitle({
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
97
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
return (
|
|
99
|
+
<AlertDialogPrimitive.Title
|
|
100
|
+
className={cn("font-semibold text-lg", className)}
|
|
101
|
+
data-slot="alert-dialog-title"
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
function AlertDialogDescription({
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
110
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
return (
|
|
112
|
+
<AlertDialogPrimitive.Description
|
|
113
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
114
|
+
data-slot="alert-dialog-description"
|
|
115
|
+
{...props}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
function AlertDialogAction({
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
className,
|
|
122
|
+
...props
|
|
123
123
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
return (
|
|
125
|
+
<AlertDialogPrimitive.Action
|
|
126
|
+
className={cn(buttonVariants(), className)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
function AlertDialogCancel({
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
className,
|
|
134
|
+
...props
|
|
135
135
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
return (
|
|
137
|
+
<AlertDialogPrimitive.Cancel
|
|
138
|
+
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
145
|
+
AlertDialog,
|
|
146
|
+
AlertDialogAction,
|
|
147
|
+
AlertDialogCancel,
|
|
148
|
+
AlertDialogContent,
|
|
149
|
+
AlertDialogDescription,
|
|
150
|
+
AlertDialogFooter,
|
|
151
|
+
AlertDialogHeader,
|
|
152
|
+
AlertDialogOverlay,
|
|
153
|
+
AlertDialogPortal,
|
|
154
|
+
AlertDialogTitle,
|
|
155
|
+
AlertDialogTrigger,
|
|
156
156
|
};
|
|
@@ -4,56 +4,56 @@ import * as React from "react";
|
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
"relative w-full rounded-lg border p-4 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:top-4 [&>svg]:left-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-background text-foreground",
|
|
12
|
+
destructive:
|
|
13
|
+
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
const Alert = React.forwardRef<
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
HTMLDivElement,
|
|
24
|
+
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
25
25
|
>(({ className, variant, ...props }, ref) => (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
<div
|
|
27
|
+
className={cn(alertVariants({ variant }), className)}
|
|
28
|
+
ref={ref}
|
|
29
|
+
role="alert"
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
32
|
));
|
|
33
33
|
Alert.displayName = "Alert";
|
|
34
34
|
|
|
35
35
|
const AlertTitle = React.forwardRef<
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
HTMLParagraphElement,
|
|
37
|
+
React.HTMLAttributes<HTMLHeadingElement>
|
|
38
38
|
>(({ className, ...props }, ref) => (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
<h5
|
|
40
|
+
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
|
41
|
+
ref={ref}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
44
|
));
|
|
45
45
|
AlertTitle.displayName = "AlertTitle";
|
|
46
46
|
|
|
47
47
|
const AlertDescription = React.forwardRef<
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
HTMLParagraphElement,
|
|
49
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
50
50
|
>(({ className, ...props }, ref) => (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
<div
|
|
52
|
+
className={cn("text-sm [&_p]:leading-relaxed", className)}
|
|
53
|
+
ref={ref}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
56
|
));
|
|
57
57
|
AlertDescription.displayName = "AlertDescription";
|
|
58
58
|
|
|
59
|
-
export { Alert,
|
|
59
|
+
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -6,45 +6,45 @@ import * as React from "react";
|
|
|
6
6
|
import { cn } from "@/lib/utils";
|
|
7
7
|
|
|
8
8
|
const Avatar = React.forwardRef<
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
11
11
|
>(({ className, ...props }, ref) => (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
<AvatarPrimitive.Root
|
|
13
|
+
className={cn(
|
|
14
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
ref={ref}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
20
|
));
|
|
21
21
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
22
22
|
|
|
23
23
|
const AvatarImage = React.forwardRef<
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
26
26
|
>(({ className, ...props }, ref) => (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
<AvatarPrimitive.Image
|
|
28
|
+
className={cn("aspect-square h-full w-full", className)}
|
|
29
|
+
ref={ref}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
32
|
));
|
|
33
33
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
34
34
|
|
|
35
35
|
const AvatarFallback = React.forwardRef<
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
38
38
|
>(({ className, ...props }, ref) => (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
<AvatarPrimitive.Fallback
|
|
40
|
+
className={cn(
|
|
41
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
ref={ref}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
47
|
));
|
|
48
48
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
49
49
|
|
|
50
|
-
export { Avatar,
|
|
50
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -4,33 +4,33 @@ import type * as React from "react";
|
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
5
|
|
|
6
6
|
const badgeVariants = cva(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
13
|
+
secondary:
|
|
14
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
+
destructive:
|
|
16
|
+
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
17
|
+
outline: "text-foreground",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
export interface BadgeProps
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
28
|
+
VariantProps<typeof badgeVariants> {}
|
|
29
29
|
|
|
30
30
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
33
|
+
);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export { Badge, badgeVariants };
|