diff --git a/src/components/ui/skeleton.tsx b/src/components/ui/skeleton.tsx new file mode 100644 index 0000000..37cf573 --- /dev/null +++ b/src/components/ui/skeleton.tsx @@ -0,0 +1,59 @@ +import * as React from "react"; +import { cn } from "@/lib/utils"; + +type SkeletonVariant = "default" | "text" | "circle" | "row"; + +type SkeletonProps = { + className?: string; + variant?: SkeletonVariant; + width?: string | number; + height?: string | number; +}; + +const variantClass: Record = { + default: "rounded-md", + text: "rounded-sm h-3 w-full", + circle: "rounded-full", + row: "rounded-md h-9 w-full", +}; + +/** + * Hairline loading primitive. + * Voice: not a generic gray pulse — a 1px hairline ring with a slow + * horizontal scanline that sweeps the surface, like a precision + * instrument's sensor arm. + */ +export function Skeleton({ + className, + variant = "default", + width, + height, +}: SkeletonProps) { + const style: React.CSSProperties = { + ...(width !== undefined ? { width } : null), + ...(height !== undefined ? { height } : null), + }; + + return ( +
+
+
+ ); +}