import * as React from "react"; import { cn } from "../../lib/utils"; // Assumes a standard shadcn setup export interface GooeyLoaderProps extends React.HTMLAttributes { /** The primary color for the goo effect. Defaults to shadcn's primary color. */ primaryColor?: string; /** The secondary color for the goo effect. Defaults to shadcn's secondary color. */ secondaryColor?: string; /** The color for the bottom border. Defaults to shadcn's border color. */ borderColor?: string; } const GooeyLoader = React.forwardRef( ({ className, primaryColor, secondaryColor, borderColor, ...props }, ref) => { // CSS variables for dynamic styling. Falls back to shadcn's theme variables. const style = { "--gooey-primary-color": primaryColor || "hsl(var(--primary))", "--gooey-secondary-color": secondaryColor || "hsl(var(--secondary))", "--gooey-border-color": borderColor || "hsl(var(--border))", } as React.CSSProperties; return (
{/* SVG filter for the gooey effect */} {/* Embedded styles for complex animations and pseudo-elements that are not achievable with standard Tailwind classes. Using CSS variables makes them theme-aware. */} {/* The loader element that the styles target */}
); } ); GooeyLoader.displayName = "GooeyLoader"; export { GooeyLoader };