/** * Skeleton - Configurable placeholder loader with shimmer animation. * * Variants: * text - Horizontal line (for text placeholders) * circle - Circle (for avatars) * card - Full card placeholder with header, body lines, footer * rect - Custom rectangle * * Supports repeating via the `count` prop and custom dimensions. */ import PropTypes from "prop-types"; // --------------------------------------------------------------------------- // Base Skeleton Block // --------------------------------------------------------------------------- function SkeletonBlock({ width, height, rounded = "rounded", className = "" }) { return (
); } SkeletonBlock.propTypes = { width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), rounded: PropTypes.string, className: PropTypes.string, }; // --------------------------------------------------------------------------- // Preset: Text Lines // --------------------------------------------------------------------------- function SkeletonText({ lines = 3, className = "" }) { const widths = ["100%", "90%", "75%", "85%", "60%"]; return ( ); } SkeletonText.propTypes = { lines: PropTypes.number, className: PropTypes.string, }; // --------------------------------------------------------------------------- // Preset: Card // --------------------------------------------------------------------------- function SkeletonCard({ className = "" }) { return ( ); } SkeletonCard.propTypes = { className: PropTypes.string, }; // --------------------------------------------------------------------------- // Main Skeleton Component // --------------------------------------------------------------------------- function Skeleton({ variant = "text", width, height, count = 1, className = "", }) { if (variant === "circle") { const size = width || height || 48; return (