Skip to content

Commit 8fec443

Browse files
committed
chore: refactor component paths and enhance utility functions
- Updated component path aliases in components.json: - Changed "components" from "@/app/components" to "@/components" - Changed "ui" from "@/components/ui" to "@/ui" - Added utility function `cn` in lib/utils.ts for class name merging using clsx and tailwind-merge. - Removed outdated AGENTS.md documentation for AI Elements Components. - Refactored imports in AI Elements components to use new path aliases: - Updated imports in artifact.tsx, chain-of-thought.tsx, checkpoint.tsx, code-block.tsx, confirmation.tsx, context.tsx, conversation.tsx, inline-citation.tsx, message.tsx, model-selector.tsx, node.tsx, open-in-chat.tsx, plan.tsx, prompt-input.tsx, queue.tsx, reasoning.tsx, sources.tsx, suggestion.tsx, task.tsx, tool.tsx, web-preview.tsx. - Deleted AGENTS.md documentation for UI components. - Fixed minor styling issues in button-group.tsx, command.tsx, dropdown-menu.tsx, select.tsx, and tooltip.tsx.
1 parent 5f65373 commit 8fec443

30 files changed

Lines changed: 72 additions & 251 deletions

components.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
},
1313
"iconLibrary": "lucide",
1414
"aliases": {
15-
"components": "@/app/components",
15+
"components": "@/components",
1616
"utils": "@/lib/utils",
17-
"ui": "@/components/ui",
17+
"ui": "@/ui",
1818
"lib": "@/lib",
1919
"app": "@/app",
2020
"hooks": "@/hooks"

lib/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
1
1+
import { type ClassValue, clsx } from "clsx"
2+
import { twMerge } from "tailwind-merge"
3+
4+
export function cn(...inputs: ClassValue[]) {
5+
return twMerge(clsx(inputs))
6+
}

src/components/ai-elements/AGENTS.md

Lines changed: 0 additions & 118 deletions
This file was deleted.

src/components/ai-elements/artifact.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"use client";
22

3-
import { Button } from "@/components/ui/button";
3+
import { Button } from "@/ui/button";
44
import {
55
Tooltip,
66
TooltipContent,
77
TooltipProvider,
88
TooltipTrigger,
9-
} from "@/components/ui/tooltip";
9+
} from "@/ui/tooltip";
1010
import { cn } from "@/lib/utils";
1111
import { type LucideIcon, XIcon } from "lucide-react";
1212
import type { ComponentProps, HTMLAttributes } from "react";

src/components/ai-elements/chain-of-thought.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"use client";
22

33
import { useControllableState } from "@radix-ui/react-use-controllable-state";
4-
import { Badge } from "@/components/ui/badge";
4+
import { Badge } from "@/ui/badge";
55
import {
66
Collapsible,
77
CollapsibleContent,
88
CollapsibleTrigger,
9-
} from "@/components/ui/collapsible";
9+
} from "@/ui/collapsible";
1010
import { cn } from "@/lib/utils";
1111
import {
1212
BrainIcon,
@@ -211,7 +211,7 @@ export type ChainOfThoughtImageProps = ComponentProps<"div"> & {
211211
export const ChainOfThoughtImage = memo(
212212
({ className, children, caption, ...props }: ChainOfThoughtImageProps) => (
213213
<div className={cn("mt-2 space-y-2", className)} {...props}>
214-
<div className="relative flex max-h-[22rem] items-center justify-center overflow-hidden rounded-lg bg-muted p-3">
214+
<div className="relative flex max-h-88 items-center justify-center overflow-hidden rounded-lg bg-muted p-3">
215215
{children}
216216
</div>
217217
{caption && <p className="text-muted-foreground text-xs">{caption}</p>}

src/components/ai-elements/checkpoint.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"use client";
22

3-
import { Button } from "@/components/ui/button";
4-
import { Separator } from "@/components/ui/separator";
3+
import { Button } from "@/ui/button";
4+
import { Separator } from "@/ui/separator";
55
import {
66
Tooltip,
77
TooltipContent,
88
TooltipTrigger,
9-
} from "@/components/ui/tooltip";
9+
} from "@/ui/tooltip";
1010
import { cn } from "@/lib/utils";
1111
import { BookmarkIcon, type LucideProps } from "lucide-react";
1212
import type { ComponentProps, HTMLAttributes } from "react";

src/components/ai-elements/code-block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { Button } from "@/components/ui/button";
3+
import { Button } from "@/ui/button";
44
import { cn } from "@/lib/utils";
55
import { CheckIcon, CopyIcon } from "lucide-react";
66
import {

src/components/ai-elements/confirmation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

3-
import { Alert, AlertDescription } from "@/components/ui/alert";
4-
import { Button } from "@/components/ui/button";
3+
import { Alert, AlertDescription } from "@/ui/alert";
4+
import { Button } from "@/ui/button";
55
import { cn } from "@/lib/utils";
66
import type { ToolUIPart } from "ai";
77
import {

src/components/ai-elements/context.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"use client";
22

3-
import { Button } from "@/components/ui/button";
3+
import { Button } from "@/ui/button";
44
import {
55
HoverCard,
66
HoverCardContent,
77
HoverCardTrigger,
8-
} from "@/components/ui/hover-card";
9-
import { Progress } from "@/components/ui/progress";
8+
} from "@/ui/hover-card";
9+
import { Progress } from "@/ui/progress";
1010
import { cn } from "@/lib/utils";
1111
import type { LanguageModelUsage } from "ai";
1212
import { type ComponentProps, createContext, useContext } from "react";

src/components/ai-elements/conversation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { Button } from "@/components/ui/button";
3+
import { Button } from "@/ui/button";
44
import { cn } from "@/lib/utils";
55
import { ArrowDownIcon } from "lucide-react";
66
import type { ComponentProps } from "react";

0 commit comments

Comments
 (0)