import { cn } from "./index3.js";
import { cva } from "class-variance-authority";
import { ArrowRight, Sparkles } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/organisms/ai/AIPromptSuggestion/AIPromptSuggestion.tsx
var promptSuggestionVariants = cva("group inline-flex items-center gap-2 transition-all cursor-pointer", {
	variants: {
		variant: {
			default: "px-4 py-2.5 rounded-full border border-border bg-background hover:border-border hover:shadow-sm text-secondary-foreground hover:text-foreground",
			outline: "px-4 py-2.5 rounded-full border border-border bg-transparent hover:bg-muted text-secondary-foreground hover:text-foreground",
			ghost: "px-3 py-2 rounded-lg hover:bg-accent text-muted-foreground hover:text-foreground",
			card: "flex-col items-start p-4 rounded-xl border border-border bg-background hover:border-primary hover:shadow-md",
			highlight: "text-primary hover:text-primary underline underline-offset-2"
		},
		size: {
			sm: "text-xs",
			md: "text-sm",
			lg: "text-base"
		}
	},
	defaultVariants: {
		variant: "default",
		size: "md"
	}
});
function AIPromptSuggestion({ children, onClick, icon, showArrow = false, highlight, variant, size, className }) {
	const renderText = () => {
		if (!highlight) return /* @__PURE__ */ jsx("span", { children });
		return /* @__PURE__ */ jsx("span", { children: children.split(new RegExp(`(${highlight})`, "gi")).map((part, index) => part.toLowerCase() === highlight.toLowerCase() ? /* @__PURE__ */ jsx("span", {
			className: "text-primary font-medium",
			children: part
		}, index) : /* @__PURE__ */ jsx("span", { children: part }, index)) });
	};
	return /* @__PURE__ */ jsxs("button", {
		type: "button",
		"data-slot": "ai-prompt-suggestion",
		onClick,
		className: cn(promptSuggestionVariants({
			variant,
			size
		}), "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className),
		children: [
			icon && /* @__PURE__ */ jsx("span", {
				className: "shrink-0",
				"aria-hidden": "true",
				children: icon
			}),
			renderText(),
			showArrow && variant !== "highlight" && /* @__PURE__ */ jsx(ArrowRight, {
				className: "size-4 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all motion-reduce:transition-none",
				"aria-hidden": "true"
			})
		]
	});
}
AIPromptSuggestion.displayName = "AIPromptSuggestion";
function AIPromptSuggestionCard({ title, description, icon, onClick, featured = false, className }) {
	return /* @__PURE__ */ jsxs("button", {
		type: "button",
		"data-slot": "ai-prompt-suggestion-card",
		onClick,
		className: cn("group flex flex-col items-start gap-2 p-4 rounded-xl border transition-all text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", featured ? "border-primary bg-primary/10 hover:border-primary hover:shadow-md" : "border-border bg-background hover:border-border hover:shadow-md", className),
		children: [icon && /* @__PURE__ */ jsx("div", {
			className: cn("size-8 rounded-lg flex items-center justify-center", featured ? "bg-primary/20 text-primary" : "bg-accent text-muted-foreground"),
			children: icon
		}), /* @__PURE__ */ jsxs("div", {
			className: "space-y-1",
			children: [/* @__PURE__ */ jsx("h4", {
				className: "text-sm font-medium text-foreground group-hover:text-primary transition-colors",
				children: title
			}), description && /* @__PURE__ */ jsx("p", {
				className: "text-xs text-quaternary-foreground line-clamp-2",
				children: description
			})]
		})]
	});
}
AIPromptSuggestionCard.displayName = "AIPromptSuggestionCard";
function AIPromptSuggestionList({ suggestions, onSelect, variant = "default", direction = "horizontal", max, className }) {
	const visibleSuggestions = max ? suggestions.slice(0, max) : suggestions;
	return /* @__PURE__ */ jsx("div", {
		"data-slot": "ai-prompt-suggestion-list",
		role: "group",
		"aria-label": "Prompt suggestions",
		className: cn("flex gap-2", direction === "horizontal" ? "flex-wrap" : "flex-col", className),
		children: visibleSuggestions.map((suggestion, index) => /* @__PURE__ */ jsx(AIPromptSuggestion, {
			variant,
			icon: suggestion.icon,
			onClick: () => onSelect?.(suggestion.text),
			children: suggestion.text
		}, `${suggestion.text}-${index}`))
	});
}
AIPromptSuggestionList.displayName = "AIPromptSuggestionList";
function AIQuickActions({ actions, onSelect, variant = "card", columns = 2, className }) {
	const gridCols = {
		2: "grid-cols-2",
		3: "grid-cols-3",
		4: "grid-cols-4"
	};
	if (variant === "pill") return /* @__PURE__ */ jsx("div", {
		className: cn("flex flex-wrap gap-2", className),
		children: actions.map((action) => /* @__PURE__ */ jsx(AIPromptSuggestion, {
			icon: action.icon || /* @__PURE__ */ jsx(Sparkles, { className: "size-4" }),
			onClick: () => onSelect?.(action.prompt),
			children: action.title
		}, action.id))
	});
	return /* @__PURE__ */ jsx("div", {
		className: cn("grid gap-3", gridCols[columns], className),
		children: actions.map((action) => /* @__PURE__ */ jsx(AIPromptSuggestionCard, {
			title: action.title,
			description: action.description,
			icon: action.icon || /* @__PURE__ */ jsx(Sparkles, { className: "size-4" }),
			onClick: () => onSelect?.(action.prompt)
		}, action.id))
	});
}
AIQuickActions.displayName = "AIQuickActions";
//#endregion
export { AIPromptSuggestion, AIPromptSuggestionCard, AIPromptSuggestionList, AIQuickActions, promptSuggestionVariants };

//# sourceMappingURL=index431.js.map