{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "loader-dot-field",
  "type": "registry:component",
  "title": "Loader Dot Field",
  "description": "A grid of dots breathes in a ripple, a traveling wave or a diagonal sweep, each dot swelling and glowing as the crest passes. Reads like a voice or audio engine at work.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "loaders",
    "loader",
    "dots",
    "grid",
    "ripple",
    "voice",
    "css"
  ],
  "docs": "https://hyperblur.dev/effects/loader-dot-field",
  "files": [
    {
      "path": "registry/hyperblur/loader-dot-field.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/loader-dot-field.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoaderDotFieldProps extends React.HTMLAttributes<HTMLSpanElement> {\n  cols?: number;\n  rows?: number;\n  dot?: number;\n  gap?: number;\n  pattern?: \"ripple\" | \"wave\" | \"diagonal\";\n  color?: string;\n  accent?: string;\n  speed?: number;\n  label?: string;\n}\n\nconst css = `\n.hb-vk6 {\n  display: inline-flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 0.8em;\n  box-sizing: border-box;\n  font-family: inherit;\n  color: #ededed;\n  vertical-align: middle;\n}\n.hb-vk6 *, .hb-vk6 *::before, .hb-vk6 *::after { box-sizing: border-box; }\n.hb-vk6-grid {\n  display: grid;\n  grid-template-columns: repeat(var(--hb-vk6-cols), var(--hb-vk6-dot));\n  gap: var(--hb-vk6-gap);\n}\n.hb-vk6-d {\n  width: var(--hb-vk6-dot);\n  height: var(--hb-vk6-dot);\n  border-radius: 50%;\n  background: var(--hb-vk6-c);\n  opacity: 0.22;\n  transform: scale(0.55);\n  animation: hb-vk6-pulse var(--hb-vk6-t) cubic-bezier(0.37, 0, 0.63, 1) infinite;\n  animation-delay: var(--hb-vk6-delay);\n}\n.hb-vk6-l { font-size: 12px; line-height: 1.3; color: #a1a1a1; white-space: nowrap; }\n.hb-vk6-sr {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n}\n@keyframes hb-vk6-pulse {\n  0%, 100% { opacity: 0.2; transform: scale(0.5); background: var(--hb-vk6-c); box-shadow: none; }\n  45% { opacity: 1; transform: scale(1.2); background: var(--hb-vk6-a); box-shadow: 0 0 calc(var(--hb-vk6-dot) * 1.4) color-mix(in srgb, var(--hb-vk6-a) 60%, transparent); }\n  70% { opacity: 0.45; transform: scale(0.8); background: var(--hb-vk6-c); box-shadow: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vk6-d { animation: none; opacity: calc(0.25 + var(--hb-vk6-still) * 0.75); transform: scale(calc(0.55 + var(--hb-vk6-still) * 0.45)); }\n}\n`;\n\nexport function LoaderDotField({\n  cols = 13,\n  rows = 5,\n  dot = 5,\n  gap = 7,\n  pattern = \"ripple\",\n  color = \"#2f7bff\",\n  accent = \"#bcd6ff\",\n  speed = 1.8,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: LoaderDotFieldProps) {\n  const c = Math.max(2, Math.min(32, Math.round(cols)));\n  const r = Math.max(1, Math.min(16, Math.round(rows)));\n  const t = Math.max(0.5, speed);\n  const cx = (c - 1) / 2;\n  const cy = (r - 1) / 2;\n  const maxD = Math.hypot(cx, cy) || 1;\n  const vars = {\n    \"--hb-vk6-cols\": c,\n    \"--hb-vk6-dot\": `${dot}px`,\n    \"--hb-vk6-gap\": `${gap}px`,\n    \"--hb-vk6-c\": color,\n    \"--hb-vk6-a\": accent,\n    \"--hb-vk6-t\": `${t}s`,\n    ...style,\n  } as React.CSSProperties;\n\n  const cells = Array.from({ length: c * r }, (_, i) => {\n    const x = i % c;\n    const y = Math.floor(i / c);\n    let phase: number;\n    if (pattern === \"wave\") {\n      phase = x / c + Math.sin((y / Math.max(1, r - 1)) * Math.PI) * 0.18;\n    } else if (pattern === \"diagonal\") {\n      phase = (x + y) / (c + r - 2 || 1);\n    } else {\n      phase = Math.hypot(x - cx, (y - cy) * 1.4) / (maxD * 1.2);\n    }\n    const still = Math.max(0, 1 - Math.hypot(x - cx, y - cy) / maxD);\n    return { delay: ((phase * 0.9 - 1) * t).toFixed(3), still: still.toFixed(3) };\n  });\n\n  return (\n    <>\n      <style href=\"hb-loader-dot-field\" precedence=\"default\">{css}</style>\n      <span role=\"status\" className={`hb-vk6 ${className}`} style={vars} {...rest}>\n        <span className=\"hb-vk6-grid\" aria-hidden=\"true\">\n          {cells.map((cell, i) => (\n            <span\n              key={i}\n              className=\"hb-vk6-d\"\n              style={{ \"--hb-vk6-delay\": `${cell.delay}s`, \"--hb-vk6-still\": cell.still } as React.CSSProperties}\n            />\n          ))}\n        </span>\n        <span className={label ? \"hb-vk6-l\" : \"hb-vk6-sr\"}>{label ?? \"Loading\"}</span>\n      </span>\n    </>\n  );\n}\n"
    }
  ]
}