@sero-ai/ui 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/.turbo/turbo-typecheck.log +4 -0
- package/components.json +18 -0
- package/package.json +70 -0
- package/src/components/ai-elements/agent.tsx +142 -0
- package/src/components/ai-elements/artifact.tsx +149 -0
- package/src/components/ai-elements/attachments.tsx +427 -0
- package/src/components/ai-elements/audio-player.tsx +232 -0
- package/src/components/ai-elements/canvas.tsx +26 -0
- package/src/components/ai-elements/chain-of-thought.tsx +223 -0
- package/src/components/ai-elements/checkpoint.tsx +72 -0
- package/src/components/ai-elements/code-block.tsx +555 -0
- package/src/components/ai-elements/commit.tsx +449 -0
- package/src/components/ai-elements/confirmation.tsx +173 -0
- package/src/components/ai-elements/connection.tsx +28 -0
- package/src/components/ai-elements/context.tsx +410 -0
- package/src/components/ai-elements/controls.tsx +19 -0
- package/src/components/ai-elements/conversation.tsx +167 -0
- package/src/components/ai-elements/edge.tsx +144 -0
- package/src/components/ai-elements/environment-variables.tsx +325 -0
- package/src/components/ai-elements/file-tree.tsx +298 -0
- package/src/components/ai-elements/image.tsx +25 -0
- package/src/components/ai-elements/inline-citation.tsx +294 -0
- package/src/components/ai-elements/jsx-preview.tsx +250 -0
- package/src/components/ai-elements/message.tsx +359 -0
- package/src/components/ai-elements/mic-selector.tsx +372 -0
- package/src/components/ai-elements/model-selector.tsx +214 -0
- package/src/components/ai-elements/node.tsx +72 -0
- package/src/components/ai-elements/open-in-chat.tsx +367 -0
- package/src/components/ai-elements/package-info.tsx +235 -0
- package/src/components/ai-elements/panel.tsx +16 -0
- package/src/components/ai-elements/persona.tsx +280 -0
- package/src/components/ai-elements/plan.tsx +144 -0
- package/src/components/ai-elements/prompt-input.tsx +1341 -0
- package/src/components/ai-elements/queue.tsx +275 -0
- package/src/components/ai-elements/reasoning.tsx +229 -0
- package/src/components/ai-elements/sandbox.tsx +133 -0
- package/src/components/ai-elements/schema-display.tsx +473 -0
- package/src/components/ai-elements/shimmer.tsx +78 -0
- package/src/components/ai-elements/snippet.tsx +141 -0
- package/src/components/ai-elements/sources.tsx +78 -0
- package/src/components/ai-elements/speech-input.tsx +324 -0
- package/src/components/ai-elements/stack-trace.tsx +531 -0
- package/src/components/ai-elements/suggestion.tsx +58 -0
- package/src/components/ai-elements/task.tsx +88 -0
- package/src/components/ai-elements/terminal.tsx +277 -0
- package/src/components/ai-elements/test-results.tsx +497 -0
- package/src/components/ai-elements/tool.tsx +174 -0
- package/src/components/ai-elements/toolbar.tsx +17 -0
- package/src/components/ai-elements/transcription.tsx +126 -0
- package/src/components/ai-elements/voice-selector.tsx +525 -0
- package/src/components/ai-elements/web-preview.tsx +282 -0
- package/src/components/ui/accordion.tsx +64 -0
- package/src/components/ui/alert-dialog.tsx +196 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/aspect-ratio.tsx +11 -0
- package/src/components/ui/avatar.tsx +107 -0
- package/src/components/ui/badge.tsx +48 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button-group.tsx +83 -0
- package/src/components/ui/button.tsx +64 -0
- package/src/components/ui/calendar.tsx +218 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/carousel.tsx +239 -0
- package/src/components/ui/chart.tsx +355 -0
- package/src/components/ui/checkbox.tsx +32 -0
- package/src/components/ui/collapsible.tsx +31 -0
- package/src/components/ui/combobox.tsx +310 -0
- package/src/components/ui/command.tsx +184 -0
- package/src/components/ui/context-menu.tsx +252 -0
- package/src/components/ui/dialog.tsx +158 -0
- package/src/components/ui/direction.tsx +22 -0
- package/src/components/ui/drawer.tsx +133 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +248 -0
- package/src/components/ui/form.tsx +165 -0
- package/src/components/ui/hover-card.tsx +42 -0
- package/src/components/ui/input-group.tsx +168 -0
- package/src/components/ui/input-otp.tsx +77 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/item.tsx +193 -0
- package/src/components/ui/kbd.tsx +28 -0
- package/src/components/ui/label.tsx +22 -0
- package/src/components/ui/menubar.tsx +276 -0
- package/src/components/ui/native-select.tsx +53 -0
- package/src/components/ui/navigation-menu.tsx +168 -0
- package/src/components/ui/pagination.tsx +127 -0
- package/src/components/ui/popover.tsx +87 -0
- package/src/components/ui/progress.tsx +31 -0
- package/src/components/ui/radio-group.tsx +43 -0
- package/src/components/ui/resizable.tsx +53 -0
- package/src/components/ui/scroll-area.tsx +56 -0
- package/src/components/ui/select.tsx +190 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +145 -0
- package/src/components/ui/sidebar.tsx +724 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +61 -0
- package/src/components/ui/sonner.tsx +40 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/switch.tsx +33 -0
- package/src/components/ui/table.tsx +116 -0
- package/src/components/ui/tabs.tsx +91 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toggle-group.tsx +83 -0
- package/src/components/ui/toggle.tsx +47 -0
- package/src/components/ui/tooltip.tsx +57 -0
- package/src/components/ui/tree.tsx +207 -0
- package/src/hooks/use-mobile.ts +17 -0
- package/src/index.ts +16 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +373 -0
- package/tsconfig.json +18 -0
package/components.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/styles/global.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"iconLibrary": "lucide",
|
|
14
|
+
"rtl": false,
|
|
15
|
+
"registries": {
|
|
16
|
+
"@ai-elements": "https://ai-sdk.dev/elements/api/registry/{name}.json"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sero-ai/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared UI components, AI elements, and design tokens for the Sero platform",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.ts",
|
|
10
|
+
"./*": "./src/*",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"typecheck": "tsc --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": "catalog:peer",
|
|
18
|
+
"react-dom": "catalog:peer"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@base-ui/react": "^1.3.0",
|
|
22
|
+
"@headless-tree/core": "^1.6.3",
|
|
23
|
+
"@headless-tree/react": "^1.6.3",
|
|
24
|
+
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
25
|
+
"@remixicon/react": "^4.9.0",
|
|
26
|
+
"@rive-app/react-webgl2": "^4.27.1",
|
|
27
|
+
"@streamdown/cjk": "^1.0.2",
|
|
28
|
+
"@streamdown/code": "^1.1.0",
|
|
29
|
+
"@streamdown/math": "^1.0.2",
|
|
30
|
+
"@streamdown/mermaid": "^1.0.2",
|
|
31
|
+
"@xyflow/react": "^12.10.1",
|
|
32
|
+
"ai": "^6.0.116",
|
|
33
|
+
"ansi-to-react": "^6.2.6",
|
|
34
|
+
"class-variance-authority": "^0.7.1",
|
|
35
|
+
"clsx": "^2.1.1",
|
|
36
|
+
"cmdk": "^1.1.1",
|
|
37
|
+
"date-fns": "^4.1.0",
|
|
38
|
+
"embla-carousel-react": "^8.6.0",
|
|
39
|
+
"input-otp": "^1.4.2",
|
|
40
|
+
"lucide-react": "catalog:",
|
|
41
|
+
"media-chrome": "^4.18.0",
|
|
42
|
+
"motion": "catalog:",
|
|
43
|
+
"nanoid": "^5.1.6",
|
|
44
|
+
"next-themes": "^0.4.6",
|
|
45
|
+
"radix-ui": "^1.4.3",
|
|
46
|
+
"react-day-picker": "^9.14.0",
|
|
47
|
+
"react-hook-form": "^7.71.2",
|
|
48
|
+
"react-jsx-parser": "^2.4.1",
|
|
49
|
+
"react-resizable-panels": "^4.7.2",
|
|
50
|
+
"react-syntax-highlighter": "^16.1.1",
|
|
51
|
+
"recharts": "2.15.4",
|
|
52
|
+
"shiki": "^3.23.0",
|
|
53
|
+
"sonner": "^2.0.7",
|
|
54
|
+
"streamdown": "^2.4.0",
|
|
55
|
+
"tailwind-merge": "^3.5.0",
|
|
56
|
+
"tokenlens": "^1.3.1",
|
|
57
|
+
"use-stick-to-bottom": "^1.1.3",
|
|
58
|
+
"vaul": "^1.1.2"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@hookform/resolvers": "^5.2.2",
|
|
62
|
+
"@types/react": "catalog:",
|
|
63
|
+
"@types/react-dom": "catalog:",
|
|
64
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
65
|
+
"shadcn": "^3.8.5",
|
|
66
|
+
"tailwindcss": "catalog:",
|
|
67
|
+
"tw-animate-css": "^1.4.0",
|
|
68
|
+
"typescript": "catalog:"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { Tool } from "ai";
|
|
4
|
+
import type { ComponentProps } from "react";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Accordion,
|
|
8
|
+
AccordionContent,
|
|
9
|
+
AccordionItem,
|
|
10
|
+
AccordionTrigger,
|
|
11
|
+
} from "../ui/accordion";
|
|
12
|
+
import { Badge } from "../ui/badge";
|
|
13
|
+
import { cn } from "../../lib/utils";
|
|
14
|
+
import { BotIcon } from "lucide-react";
|
|
15
|
+
import { memo } from "react";
|
|
16
|
+
|
|
17
|
+
import { CodeBlock } from "./code-block";
|
|
18
|
+
|
|
19
|
+
export type AgentProps = ComponentProps<"div">;
|
|
20
|
+
|
|
21
|
+
export const Agent = memo(({ className, ...props }: AgentProps) => (
|
|
22
|
+
<div
|
|
23
|
+
className={cn("not-prose w-full rounded-md border", className)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
export type AgentHeaderProps = ComponentProps<"div"> & {
|
|
29
|
+
name: string;
|
|
30
|
+
model?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const AgentHeader = memo(
|
|
34
|
+
({ className, name, model, ...props }: AgentHeaderProps) => (
|
|
35
|
+
<div
|
|
36
|
+
className={cn(
|
|
37
|
+
"flex w-full items-center justify-between gap-4 p-3",
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
<div className="flex items-center gap-2">
|
|
43
|
+
<BotIcon className="size-4 text-muted-foreground" />
|
|
44
|
+
<span className="font-medium text-sm">{name}</span>
|
|
45
|
+
{model && (
|
|
46
|
+
<Badge className="font-mono text-xs" variant="secondary">
|
|
47
|
+
{model}
|
|
48
|
+
</Badge>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export type AgentContentProps = ComponentProps<"div">;
|
|
56
|
+
|
|
57
|
+
export const AgentContent = memo(
|
|
58
|
+
({ className, ...props }: AgentContentProps) => (
|
|
59
|
+
<div className={cn("space-y-4 p-4 pt-0", className)} {...props} />
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export type AgentInstructionsProps = ComponentProps<"div"> & {
|
|
64
|
+
children: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const AgentInstructions = memo(
|
|
68
|
+
({ className, children, ...props }: AgentInstructionsProps) => (
|
|
69
|
+
<div className={cn("space-y-2", className)} {...props}>
|
|
70
|
+
<span className="font-medium text-muted-foreground text-sm">
|
|
71
|
+
Instructions
|
|
72
|
+
</span>
|
|
73
|
+
<div className="rounded-md bg-muted/50 p-3 text-muted-foreground text-sm">
|
|
74
|
+
<p>{children}</p>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export type AgentToolsProps = ComponentProps<typeof Accordion>;
|
|
81
|
+
|
|
82
|
+
export const AgentTools = memo(({ className, ...props }: AgentToolsProps) => (
|
|
83
|
+
<div className={cn("space-y-2", className)}>
|
|
84
|
+
<span className="font-medium text-muted-foreground text-sm">Tools</span>
|
|
85
|
+
<Accordion className="rounded-md border" {...props} />
|
|
86
|
+
</div>
|
|
87
|
+
));
|
|
88
|
+
|
|
89
|
+
export type AgentToolProps = ComponentProps<typeof AccordionItem> & {
|
|
90
|
+
tool: Tool;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const AgentTool = memo(
|
|
94
|
+
({ className, tool, value, ...props }: AgentToolProps) => {
|
|
95
|
+
const schema =
|
|
96
|
+
"jsonSchema" in tool && tool.jsonSchema
|
|
97
|
+
? tool.jsonSchema
|
|
98
|
+
: tool.inputSchema;
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<AccordionItem
|
|
102
|
+
className={cn("border-b last:border-b-0", className)}
|
|
103
|
+
value={value}
|
|
104
|
+
{...props}
|
|
105
|
+
>
|
|
106
|
+
<AccordionTrigger className="px-3 py-2 text-sm hover:no-underline">
|
|
107
|
+
{tool.description ?? "No description"}
|
|
108
|
+
</AccordionTrigger>
|
|
109
|
+
<AccordionContent className="px-3 pb-3">
|
|
110
|
+
<div className="rounded-md bg-muted/50">
|
|
111
|
+
<CodeBlock code={JSON.stringify(schema, null, 2)} language="json" />
|
|
112
|
+
</div>
|
|
113
|
+
</AccordionContent>
|
|
114
|
+
</AccordionItem>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
export type AgentOutputProps = ComponentProps<"div"> & {
|
|
120
|
+
schema: string;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const AgentOutput = memo(
|
|
124
|
+
({ className, schema, ...props }: AgentOutputProps) => (
|
|
125
|
+
<div className={cn("space-y-2", className)} {...props}>
|
|
126
|
+
<span className="font-medium text-muted-foreground text-sm">
|
|
127
|
+
Output Schema
|
|
128
|
+
</span>
|
|
129
|
+
<div className="rounded-md bg-muted/50">
|
|
130
|
+
<CodeBlock code={schema} language="typescript" />
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
)
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
Agent.displayName = "Agent";
|
|
137
|
+
AgentHeader.displayName = "AgentHeader";
|
|
138
|
+
AgentContent.displayName = "AgentContent";
|
|
139
|
+
AgentInstructions.displayName = "AgentInstructions";
|
|
140
|
+
AgentTools.displayName = "AgentTools";
|
|
141
|
+
AgentTool.displayName = "AgentTool";
|
|
142
|
+
AgentOutput.displayName = "AgentOutput";
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { LucideIcon } from "lucide-react";
|
|
4
|
+
import type { ComponentProps, HTMLAttributes } from "react";
|
|
5
|
+
|
|
6
|
+
import { Button } from "../ui/button";
|
|
7
|
+
import {
|
|
8
|
+
Tooltip,
|
|
9
|
+
TooltipContent,
|
|
10
|
+
TooltipProvider,
|
|
11
|
+
TooltipTrigger,
|
|
12
|
+
} from "../ui/tooltip";
|
|
13
|
+
import { cn } from "../../lib/utils";
|
|
14
|
+
import { XIcon } from "lucide-react";
|
|
15
|
+
|
|
16
|
+
export type ArtifactProps = HTMLAttributes<HTMLDivElement>;
|
|
17
|
+
|
|
18
|
+
export const Artifact = ({ className, ...props }: ArtifactProps) => (
|
|
19
|
+
<div
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
29
|
+
|
|
30
|
+
export const ArtifactHeader = ({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: ArtifactHeaderProps) => (
|
|
34
|
+
<div
|
|
35
|
+
className={cn(
|
|
36
|
+
"flex items-center justify-between border-b bg-muted/50 px-4 py-3",
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export type ArtifactCloseProps = ComponentProps<typeof Button>;
|
|
44
|
+
|
|
45
|
+
export const ArtifactClose = ({
|
|
46
|
+
className,
|
|
47
|
+
children,
|
|
48
|
+
size = "sm",
|
|
49
|
+
variant = "ghost",
|
|
50
|
+
...props
|
|
51
|
+
}: ArtifactCloseProps) => (
|
|
52
|
+
<Button
|
|
53
|
+
className={cn(
|
|
54
|
+
"size-8 p-0 text-muted-foreground hover:text-foreground",
|
|
55
|
+
className
|
|
56
|
+
)}
|
|
57
|
+
size={size}
|
|
58
|
+
type="button"
|
|
59
|
+
variant={variant}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{children ?? <XIcon className="size-4" />}
|
|
63
|
+
<span className="sr-only">Close</span>
|
|
64
|
+
</Button>
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
export type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;
|
|
68
|
+
|
|
69
|
+
export const ArtifactTitle = ({ className, ...props }: ArtifactTitleProps) => (
|
|
70
|
+
<p
|
|
71
|
+
className={cn("font-medium text-foreground text-sm", className)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
export type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
77
|
+
|
|
78
|
+
export const ArtifactDescription = ({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}: ArtifactDescriptionProps) => (
|
|
82
|
+
<p className={cn("text-muted-foreground text-sm", className)} {...props} />
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
export type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
86
|
+
|
|
87
|
+
export const ArtifactActions = ({
|
|
88
|
+
className,
|
|
89
|
+
...props
|
|
90
|
+
}: ArtifactActionsProps) => (
|
|
91
|
+
<div className={cn("flex items-center gap-1", className)} {...props} />
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export type ArtifactActionProps = ComponentProps<typeof Button> & {
|
|
95
|
+
tooltip?: string;
|
|
96
|
+
label?: string;
|
|
97
|
+
icon?: LucideIcon;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const ArtifactAction = ({
|
|
101
|
+
tooltip,
|
|
102
|
+
label,
|
|
103
|
+
icon: Icon,
|
|
104
|
+
children,
|
|
105
|
+
className,
|
|
106
|
+
size = "sm",
|
|
107
|
+
variant = "ghost",
|
|
108
|
+
...props
|
|
109
|
+
}: ArtifactActionProps) => {
|
|
110
|
+
const button = (
|
|
111
|
+
<Button
|
|
112
|
+
className={cn(
|
|
113
|
+
"size-8 p-0 text-muted-foreground hover:text-foreground",
|
|
114
|
+
className
|
|
115
|
+
)}
|
|
116
|
+
size={size}
|
|
117
|
+
type="button"
|
|
118
|
+
variant={variant}
|
|
119
|
+
{...props}
|
|
120
|
+
>
|
|
121
|
+
{Icon ? <Icon className="size-4" /> : children}
|
|
122
|
+
<span className="sr-only">{label || tooltip}</span>
|
|
123
|
+
</Button>
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
if (tooltip) {
|
|
127
|
+
return (
|
|
128
|
+
<TooltipProvider>
|
|
129
|
+
<Tooltip>
|
|
130
|
+
<TooltipTrigger asChild>{button}</TooltipTrigger>
|
|
131
|
+
<TooltipContent>
|
|
132
|
+
<p>{tooltip}</p>
|
|
133
|
+
</TooltipContent>
|
|
134
|
+
</Tooltip>
|
|
135
|
+
</TooltipProvider>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return button;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export type ArtifactContentProps = HTMLAttributes<HTMLDivElement>;
|
|
143
|
+
|
|
144
|
+
export const ArtifactContent = ({
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
}: ArtifactContentProps) => (
|
|
148
|
+
<div className={cn("flex-1 overflow-auto p-4", className)} {...props} />
|
|
149
|
+
);
|