import { cn } from "./index3.js";
import * as React from "react";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/ui/gradient-border.tsx
/**
* GradientBorder - A shared primitive that provides an animated gradient border effect.
* Uses the same gradient as AIInput: linear-gradient from oasis-flat-300 via brand-400 to aqua-flat-400.
* When animated, a conic-gradient spins around the border while content stays stable.
*/
var GradientBorder = React.forwardRef(({ animated = false, focused = false, active = false, disabled = false, borderRadius = "rounded-full", className, innerClassName, children }, ref) => {
	const isActive = (focused || active || animated) && !disabled;
	const borderWidth = isActive ? 2 : 1.25;
	const showGradient = isActive;
	return /* @__PURE__ */ jsxs("div", {
		ref,
		className: cn("relative w-full overflow-hidden transition-all", borderRadius, !disabled && showGradient && "bg-brand-400", disabled && "bg-surface-2", !showGradient && "bg-surface-2", className),
		style: { padding: `${borderWidth}px` },
		children: [
			showGradient && !animated && /* @__PURE__ */ jsx("div", { className: cn("absolute inset-0", borderRadius, "bg-linear-to-b from-oasis-flat-300 via-brand-400 to-aqua-flat-400") }),
			animated && !disabled && showGradient && /* @__PURE__ */ jsx("div", {
				className: "absolute inset-0 flex items-center justify-center",
				children: /* @__PURE__ */ jsx("div", {
					className: "aspect-square animate-spin",
					style: {
						animationDuration: "2s",
						width: "max(500%, 500px)",
						background: "conic-gradient(from 0deg, var(--oasis-flat-300), var(--brand-400), var(--aqua-flat-400), var(--oasis-flat-300))"
					}
				})
			}),
			/* @__PURE__ */ jsx("div", {
				className: cn("relative bg-background w-full h-full", borderRadius, disabled && "bg-muted", innerClassName),
				children
			})
		]
	});
});
GradientBorder.displayName = "GradientBorder";
//#endregion
export { GradientBorder };

//# sourceMappingURL=index4.js.map