{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "skeleton",
  "title": "Skeleton",
  "description": "A loading placeholder with rect, text, circle and card presets, a shimmer or pulse animation, reduced-motion support and a built-in swap to real content when loading ends.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/skeleton/skeleton.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type SkeletonVariant = \"rect\" | \"text\" | \"circle\" | \"card\";\nexport type SkeletonAnimation = \"shimmer\" | \"pulse\" | \"none\";\n\nexport interface SkeletonProps {\n  variant?: SkeletonVariant;\n  width?: number | string;\n  height?: number | string;\n  lines?: number;\n  radius?: number;\n  animation?: SkeletonAnimation;\n  theme?: \"dark\" | \"light\";\n  accentColor?: string;\n  loading?: boolean;\n  children?: React.ReactNode;\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { base: \"rgba(255,255,255,0.07)\", shine: \"rgba(255,255,255,0.12)\" },\n  light: { base: \"rgba(10,10,10,0.07)\", shine: \"rgba(255,255,255,0.75)\" },\n};\n\ninterface BoneProps {\n  width?: number | string;\n  height?: number | string;\n  radius: number | string;\n  base: string;\n  shine: string;\n  animation: SkeletonAnimation;\n  reduced: boolean;\n  delay?: number;\n  style?: React.CSSProperties;\n}\n\nfunction Bone({ width = \"100%\", height = 14, radius, base, shine, animation, reduced, delay = 0, style }: BoneProps) {\n  const still = reduced || animation === \"none\";\n  return (\n    <motion.div\n      aria-hidden=\"true\"\n      className=\"relative shrink-0 overflow-hidden\"\n      style={{ width, height, borderRadius: radius, background: base, ...style }}\n      animate={animation === \"pulse\" && !still ? { opacity: [1, 0.5, 1] } : undefined}\n      transition={animation === \"pulse\" ? { duration: 1.6, ease: \"easeInOut\", repeat: Infinity, delay } : undefined}\n    >\n      {animation === \"shimmer\" && !still && (\n        <motion.div\n          className=\"absolute inset-0\"\n          style={{ background: `linear-gradient(100deg, transparent 20%, ${shine} 50%, transparent 80%)` }}\n          initial={{ x: \"-100%\" }}\n          animate={{ x: \"100%\" }}\n          transition={{ duration: 1.5, ease: \"easeInOut\", repeat: Infinity, repeatDelay: 0.2, delay }}\n        />\n      )}\n    </motion.div>\n  );\n}\n\nexport function Skeleton({\n  variant = \"rect\",\n  width,\n  height,\n  lines = 3,\n  radius = 10,\n  animation = \"shimmer\",\n  theme = \"dark\",\n  accentColor,\n  loading = true,\n  children,\n  className,\n}: SkeletonProps) {\n  const reduced = useReducedMotion() ?? false;\n  const p = PALETTES[theme];\n  const shine = accentColor ? `color-mix(in srgb, ${accentColor} 22%, transparent)` : p.shine;\n  const bone = { base: p.base, shine, animation, reduced };\n\n  if (!loading) {\n    return (\n      <motion.div className={className} initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.3 }}>\n        {children}\n      </motion.div>\n    );\n  }\n\n  let content: React.ReactNode;\n  if (variant === \"circle\") {\n    const size = width ?? height ?? 48;\n    content = <Bone {...bone} width={size} height={size} radius=\"50%\" />;\n  } else if (variant === \"text\") {\n    content = (\n      <div className=\"flex flex-col\" style={{ gap: 10, width: width ?? \"100%\" }}>\n        {Array.from({ length: lines }).map((_, i) => (\n          <Bone key={i} {...bone} height={height ?? 14} radius={Math.min(radius, 8)} width={i === lines - 1 && lines > 1 ? \"62%\" : \"100%\"} delay={i * 0.12} />\n        ))}\n      </div>\n    );\n  } else if (variant === \"card\") {\n    content = (\n      <div className=\"flex flex-col\" style={{ gap: 16, width: width ?? 320, padding: 16, borderRadius: radius + 8, border: `1px solid ${theme === \"dark\" ? \"rgba(255,255,255,0.08)\" : \"rgba(10,10,10,0.08)\"}` }}>\n        <div className=\"flex items-center\" style={{ gap: 12 }}>\n          <Bone {...bone} width={44} height={44} radius=\"50%\" />\n          <div className=\"flex flex-1 flex-col\" style={{ gap: 8 }}>\n            <Bone {...bone} width=\"55%\" height={12} radius={6} delay={0.1} />\n            <Bone {...bone} width=\"35%\" height={10} radius={6} delay={0.2} />\n          </div>\n        </div>\n        <Bone {...bone} height={height ?? 150} radius={radius} delay={0.15} />\n        <div className=\"flex flex-col\" style={{ gap: 9 }}>\n          {Array.from({ length: lines }).map((_, i) => (\n            <Bone key={i} {...bone} height={12} radius={6} width={i === lines - 1 ? \"58%\" : \"100%\"} delay={0.2 + i * 0.1} />\n          ))}\n        </div>\n      </div>\n    );\n  } else {\n    content = <Bone {...bone} width={width ?? \"100%\"} height={height ?? 120} radius={radius} />;\n  }\n\n  return (\n    <div role=\"status\" aria-busy=\"true\" aria-live=\"polite\" className={cn(\"inline-block max-w-full\", className)} style={variant === \"rect\" || variant === \"text\" ? { width: width ?? \"100%\" } : undefined}>\n      <span className=\"sr-only\">Loading…</span>\n      {content}\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}