{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "skeleton",
  "type": "registry:component",
  "title": "Skeleton",
  "description": "Shimmering loading placeholders: a rect, circle and text primitive. SkeletonCard, SkeletonList and SkeletonProfile ship in the same file.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "site",
    "skeleton",
    "loading",
    "placeholder",
    "shimmer",
    "suspense",
    "spinner"
  ],
  "docs": "https://hyperblur.dev/effects/skeleton",
  "files": [
    {
      "path": "registry/hyperblur/skeleton.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/skeleton.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n  variant?: \"rect\" | \"circle\" | \"text\";\n  width?: number | string;\n  height?: number | string;\n  lines?: number;\n  lastLineWidth?: number | string;\n  radius?: number | string;\n  animate?: boolean;\n  color?: string;\n  highlight?: string;\n  label?: string;\n}\n\nexport interface SkeletonCompositeProps extends React.HTMLAttributes<HTMLDivElement> {\n  animate?: boolean;\n  color?: string;\n  highlight?: string;\n  label?: string;\n}\n\nexport interface SkeletonCardProps extends SkeletonCompositeProps {\n  media?: boolean;\n  mediaHeight?: number;\n  lines?: number;\n}\n\nexport interface SkeletonListProps extends SkeletonCompositeProps {\n  rows?: number;\n  avatarSize?: number;\n}\n\nconst css = `\n.hb-skl, .hb-skl-card, .hb-skl-list, .hb-skl-profile {\n  --hb-skl-base: #1d1d1d;\n  --hb-skl-hl: rgba(255, 255, 255, 0.075);\n  box-sizing: border-box;\n}\n.hb-skl *, .hb-skl-card *, .hb-skl-list *, .hb-skl-profile * { box-sizing: border-box; }\n.hb-skl { display: block; width: 100%; }\n.hb-skl[data-variant=\"text\"] { display: flex; flex-direction: column; gap: 8px; }\n.hb-skl-b {\n  position: relative;\n  display: block;\n  flex: none;\n  overflow: hidden;\n  width: 100%;\n  background: var(--hb-skl-base);\n}\n.hb-skl-b[data-animate=\"true\"]::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(100deg, transparent 20%, var(--hb-skl-hl) 50%, transparent 80%);\n  transform: translateX(-100%);\n  animation: hb-skl-sweep 1.7s ease-in-out infinite;\n}\n.hb-skl-card {\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  width: 100%;\n  padding: 12px;\n  border: 1px solid #262626;\n  border-radius: 14px;\n  background: #111111;\n}\n.hb-skl-foot { display: flex; align-items: center; gap: 10px; }\n.hb-skl-foot .hb-skl { flex: 1; min-width: 0; }\n.hb-skl-list { display: flex; flex-direction: column; gap: 14px; width: 100%; }\n.hb-skl-row { display: flex; align-items: center; gap: 12px; }\n.hb-skl-row > .hb-skl { flex: 1; min-width: 0; }\n.hb-skl-profile { display: flex; flex-direction: column; gap: 16px; width: 100%; }\n.hb-skl-head { display: flex; align-items: center; gap: 14px; }\n.hb-skl-head > .hb-skl { flex: 1; min-width: 0; }\n.hb-skl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }\n.hb-skl[data-variant=\"circle\"] { flex: none; width: auto; }\n@keyframes hb-skl-sweep { to { transform: translateX(100%); } }\n@keyframes hb-skl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-skl-b[data-animate=\"true\"]::after { display: none; animation: none; }\n  .hb-skl-b[data-animate=\"true\"] { animation: hb-skl-pulse 2.4s ease-in-out infinite; }\n}\n`;\n\nfunction toneVars(color?: string, highlight?: string, style?: React.CSSProperties) {\n  const vars: Record<string, string> = {};\n  if (color) vars[\"--hb-skl-base\"] = color;\n  if (highlight) vars[\"--hb-skl-hl\"] = highlight;\n  return { ...vars, ...style } as React.CSSProperties;\n}\n\nfunction size(value: number | string | undefined) {\n  return typeof value === \"number\" ? `${value}px` : value;\n}\n\nfunction Bar({\n  width,\n  height,\n  radius,\n  animate,\n  circle,\n}: {\n  width?: number | string;\n  height: number | string;\n  radius?: number | string;\n  animate: boolean;\n  circle?: boolean;\n}) {\n  return (\n    <span\n      className=\"hb-skl-b\"\n      data-animate={animate}\n      style={{\n        width: size(width),\n        height: size(height),\n        borderRadius: circle ? \"50%\" : size(radius ?? 8),\n      }}\n    />\n  );\n}\n\nexport function Skeleton({\n  variant = \"rect\",\n  width,\n  height,\n  lines = 1,\n  lastLineWidth = \"62%\",\n  radius,\n  animate = true,\n  color,\n  highlight,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: SkeletonProps) {\n  const a11y = label\n    ? ({ role: \"status\", \"aria-label\": label, \"aria-busy\": true } as const)\n    : ({ \"aria-hidden\": true } as const);\n  let content: React.ReactNode;\n  if (variant === \"circle\") {\n    const d = width ?? height ?? 40;\n    content = <Bar width={d} height={d} animate={animate} circle />;\n  } else if (variant === \"text\") {\n    const count = Math.max(1, Math.floor(lines));\n    content = Array.from({ length: count }, (_, i) => (\n      <Bar\n        key={i}\n        width={count > 1 && i === count - 1 ? lastLineWidth : width}\n        height={height ?? 12}\n        radius={radius ?? 6}\n        animate={animate}\n      />\n    ));\n  } else {\n    content = <Bar width={width} height={height ?? 96} radius={radius} animate={animate} />;\n  }\n  return (\n    <div\n      className={`hb-skl ${className}`}\n      style={toneVars(color, highlight, style)}\n      data-variant={variant}\n      {...a11y}\n      {...rest}\n    >\n      <style href=\"hb-skeleton\" precedence=\"default\">{css}</style>\n      {content}\n    </div>\n  );\n}\n\nfunction compositeProps(label: string | undefined) {\n  return { role: \"status\", \"aria-label\": label ?? \"Loading\", \"aria-busy\": true } as const;\n}\n\nexport function SkeletonCard({\n  media = true,\n  mediaHeight = 110,\n  lines = 2,\n  animate = true,\n  color,\n  highlight,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: SkeletonCardProps) {\n  return (\n    <div className={`hb-skl-card ${className}`} style={toneVars(color, highlight, style)} {...compositeProps(label)} {...rest}>\n      <style href=\"hb-skeleton\" precedence=\"default\">{css}</style>\n      {media && <Skeleton height={mediaHeight} radius={10} animate={animate} />}\n      <Skeleton variant=\"text\" width=\"48%\" height={14} animate={animate} />\n      <Skeleton variant=\"text\" lines={lines} height={10} animate={animate} />\n      <div className=\"hb-skl-foot\">\n        <Skeleton variant=\"circle\" width={24} animate={animate} />\n        <Skeleton variant=\"text\" width=\"42%\" height={10} animate={animate} />\n      </div>\n    </div>\n  );\n}\n\nexport function SkeletonList({\n  rows = 3,\n  avatarSize = 36,\n  animate = true,\n  color,\n  highlight,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: SkeletonListProps) {\n  return (\n    <div className={`hb-skl-list ${className}`} style={toneVars(color, highlight, style)} {...compositeProps(label)} {...rest}>\n      <style href=\"hb-skeleton\" precedence=\"default\">{css}</style>\n      {Array.from({ length: Math.max(1, rows) }, (_, i) => (\n        <div key={i} className=\"hb-skl-row\">\n          <Skeleton variant=\"circle\" width={avatarSize} animate={animate} />\n          <div style={{ display: \"flex\", flexDirection: \"column\", gap: 7, flex: 1, minWidth: 0 }}>\n            <Skeleton variant=\"text\" width={`${52 + ((i * 17) % 28)}%`} height={11} animate={animate} />\n            <Skeleton variant=\"text\" width={`${78 - ((i * 13) % 24)}%`} height={9} animate={animate} />\n          </div>\n        </div>\n      ))}\n    </div>\n  );\n}\n\nexport function SkeletonProfile({\n  animate = true,\n  color,\n  highlight,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: SkeletonCompositeProps) {\n  return (\n    <div className={`hb-skl-profile ${className}`} style={toneVars(color, highlight, style)} {...compositeProps(label)} {...rest}>\n      <style href=\"hb-skeleton\" precedence=\"default\">{css}</style>\n      <div className=\"hb-skl-head\">\n        <Skeleton variant=\"circle\" width={56} animate={animate} />\n        <div style={{ display: \"flex\", flexDirection: \"column\", gap: 8, flex: 1, minWidth: 0 }}>\n          <Skeleton variant=\"text\" width=\"55%\" height={14} animate={animate} />\n          <Skeleton variant=\"text\" width=\"35%\" height={10} animate={animate} />\n        </div>\n      </div>\n      <Skeleton variant=\"text\" lines={3} height={10} animate={animate} />\n      <div className=\"hb-skl-stats\">\n        <Skeleton height={44} radius={10} animate={animate} />\n        <Skeleton height={44} radius={10} animate={animate} />\n        <Skeleton height={44} radius={10} animate={animate} />\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}