{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-dot-matrix",
  "type": "registry:component",
  "title": "Button Dot Matrix",
  "description": "A terminal style button printed on a dot grid: a scan beam sweeps it while idle, dots light up in a halo around the cursor, and a click sends a bright ring of dots rippling out from the pointer.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "buttons",
    "button",
    "dot matrix",
    "pixel",
    "terminal",
    "ripple",
    "hover"
  ],
  "docs": "https://hyperblur.dev/effects/button-dot-matrix",
  "files": [
    {
      "path": "registry/hyperblur/button-dot-matrix.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/button-dot-matrix.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ButtonDotMatrixProps\n  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"color\"> {\n  accent?: string;\n  pitch?: number;\n  status?: string;\n  size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst css = `\n@property --hb-xa10-r {\n  syntax: \"<length>\";\n  inherits: false;\n  initial-value: 0px;\n}\n.hb-xa10 {\n  --hb-xa10-c: #3dffa2;\n  --hb-xa10-p: 6px;\n  --hb-xa10-x: 50%;\n  --hb-xa10-y: 50%;\n  --hb-xa10-cx: 50%;\n  --hb-xa10-cy: 50%;\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 0.7em;\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0.95em 1.4em;\n  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);\n  font-size: 13px;\n  font-weight: 600;\n  line-height: 1;\n  letter-spacing: 0.12em;\n  text-transform: uppercase;\n  color: #e9fff3;\n  background: #07100b;\n  border: 0;\n  border-radius: 10px;\n  box-shadow: inset 0 0 0 1px #17301f, inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 28px -18px rgba(0, 0, 0, 0.9);\n  cursor: pointer;\n  overflow: hidden;\n  isolation: isolate;\n  user-select: none;\n  -webkit-tap-highlight-color: transparent;\n  transition: box-shadow 0.3s ease, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);\n}\n.hb-xa10 *, .hb-xa10 *::before, .hb-xa10 *::after { box-sizing: border-box; }\n.hb-xa10[data-size=\"sm\"] { font-size: 11px; }\n.hb-xa10[data-size=\"lg\"] { font-size: 15px; }\n.hb-xa10:hover:not(:disabled), .hb-xa10:focus-visible { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hb-xa10-c) 45%, #17301f), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 32px -18px color-mix(in srgb, var(--hb-xa10-c) 55%, transparent); }\n.hb-xa10:active:not(:disabled) { transform: scale(0.97); }\n.hb-xa10:focus-visible { outline: 2px solid var(--hb-xa10-c); outline-offset: 3px; }\n.hb-xa10:disabled { opacity: 0.45; cursor: not-allowed; }\n.hb-xa10-dots, .hb-xa10-lit, .hb-xa10-scan, .hb-xa10-ring {\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  pointer-events: none;\n  background-image: radial-gradient(circle, var(--hb-xa10-dc) 0.9px, transparent 1.3px);\n  background-size: var(--hb-xa10-p) var(--hb-xa10-p);\n  background-position: center;\n}\n.hb-xa10-dots { --hb-xa10-dc: color-mix(in srgb, var(--hb-xa10-c) 16%, #0f1a14); }\n.hb-xa10-lit {\n  --hb-xa10-dc: var(--hb-xa10-c);\n  opacity: 0;\n  transition: opacity 0.35s ease;\n  -webkit-mask: radial-gradient(60px circle at var(--hb-xa10-x) var(--hb-xa10-y), #000, rgba(0, 0, 0, 0.35) 45%, transparent 75%);\n  mask: radial-gradient(60px circle at var(--hb-xa10-x) var(--hb-xa10-y), #000, rgba(0, 0, 0, 0.35) 45%, transparent 75%);\n  filter: drop-shadow(0 0 2px var(--hb-xa10-c));\n}\n.hb-xa10:hover:not(:disabled) .hb-xa10-lit, .hb-xa10:focus-visible .hb-xa10-lit { opacity: 1; }\n.hb-xa10-scan {\n  --hb-xa10-dc: color-mix(in srgb, var(--hb-xa10-c) 70%, transparent);\n  -webkit-mask: linear-gradient(90deg, transparent 0%, #000 50%, transparent 100%) no-repeat;\n  mask: linear-gradient(90deg, transparent 0%, #000 50%, transparent 100%) no-repeat;\n  -webkit-mask-size: 30% 100%;\n  mask-size: 30% 100%;\n  animation: hb-xa10-scan 3.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;\n  transition: opacity 0.3s ease;\n}\n.hb-xa10:hover:not(:disabled) .hb-xa10-scan, .hb-xa10:focus-visible .hb-xa10-scan { opacity: 0; }\n.hb-xa10-ring {\n  --hb-xa10-dc: #fff;\n  --hb-xa10-r: 0px;\n  opacity: 0;\n  -webkit-mask: radial-gradient(circle at var(--hb-xa10-cx) var(--hb-xa10-cy), transparent calc(var(--hb-xa10-r) - 16px), #000 var(--hb-xa10-r), transparent calc(var(--hb-xa10-r) + 10px));\n  mask: radial-gradient(circle at var(--hb-xa10-cx) var(--hb-xa10-cy), transparent calc(var(--hb-xa10-r) - 16px), #000 var(--hb-xa10-r), transparent calc(var(--hb-xa10-r) + 10px));\n  filter: drop-shadow(0 0 3px var(--hb-xa10-c));\n}\n.hb-xa10[data-pulse=\"a\"] .hb-xa10-ring { animation: hb-xa10-ra 0.9s cubic-bezier(0.2, 0.7, 0.3, 1); }\n.hb-xa10[data-pulse=\"b\"] .hb-xa10-ring { animation: hb-xa10-rb 0.9s cubic-bezier(0.2, 0.7, 0.3, 1); }\n.hb-xa10-led {\n  position: relative;\n  width: 0.62em;\n  height: 0.62em;\n  flex: none;\n  border-radius: 2px;\n  background: var(--hb-xa10-c);\n  box-shadow: 0 0 8px var(--hb-xa10-c), inset 0 0 0 1px rgba(255, 255, 255, 0.35);\n  animation: hb-xa10-blink 2.2s steps(1, end) infinite;\n}\n.hb-xa10-label { white-space: nowrap; text-shadow: 0 0 12px color-mix(in srgb, var(--hb-xa10-c) 40%, transparent); }\n.hb-xa10-status {\n  padding: 0.35em 0.5em;\n  font-size: 0.78em;\n  letter-spacing: 0.08em;\n  color: var(--hb-xa10-c);\n  background: color-mix(in srgb, var(--hb-xa10-c) 10%, transparent);\n  border-radius: 4px;\n  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hb-xa10-c) 30%, transparent);\n  white-space: nowrap;\n}\n@keyframes hb-xa10-scan {\n  0% { -webkit-mask-position: -40% 0; mask-position: -40% 0; }\n  100% { -webkit-mask-position: 140% 0; mask-position: 140% 0; }\n}\n@keyframes hb-xa10-ra { 0% { opacity: 1; --hb-xa10-r: 0px; } 100% { opacity: 0; --hb-xa10-r: 220px; } }\n@keyframes hb-xa10-rb { 0% { opacity: 1; --hb-xa10-r: 0px; } 100% { opacity: 0; --hb-xa10-r: 220px; } }\n@keyframes hb-xa10-blink { 0%, 86% { opacity: 1; } 90% { opacity: 0.25; } 94% { opacity: 1; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xa10, .hb-xa10-lit, .hb-xa10-scan { transition: none; }\n  .hb-xa10-scan { animation: none; opacity: 0; }\n  .hb-xa10-led { animation: none; }\n  .hb-xa10[data-pulse] .hb-xa10-ring { animation: none; }\n}\n`;\n\nexport function ButtonDotMatrix({\n  children = \"Deploy to edge\",\n  accent = \"#3dffa2\",\n  pitch = 6,\n  status = \"v2.4.1\",\n  size = \"md\",\n  type = \"button\",\n  disabled = false,\n  className = \"\",\n  style,\n  onClick,\n  onPointerMove,\n  ...rest\n}: ButtonDotMatrixProps) {\n  const ref = React.useRef<HTMLButtonElement>(null);\n  const [pulse, setPulse] = React.useState<\"a\" | \"b\" | undefined>(undefined);\n\n  function pos(e: React.PointerEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>, kx: string, ky: string) {\n    const el = ref.current;\n    if (!el) return;\n    const r = el.getBoundingClientRect();\n    const hasPoint = e.clientX !== 0 || e.clientY !== 0;\n    const x = hasPoint ? e.clientX - r.left : r.width / 2;\n    const y = hasPoint ? e.clientY - r.top : r.height / 2;\n    el.style.setProperty(kx, `${x.toFixed(1)}px`);\n    el.style.setProperty(ky, `${y.toFixed(1)}px`);\n  }\n\n  const vars = {\n    \"--hb-xa10-c\": accent,\n    \"--hb-xa10-p\": `${Math.max(3, pitch).toFixed(1)}px`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <>\n      <style href=\"hb-button-dot-matrix\" precedence=\"default\">{css}</style>\n      <button\n        ref={ref}\n        type={type}\n        className={`hb-xa10 ${className}`}\n        style={vars}\n        data-size={size}\n        data-pulse={pulse}\n        disabled={disabled}\n        onPointerMove={(e) => {\n          pos(e, \"--hb-xa10-x\", \"--hb-xa10-y\");\n          onPointerMove?.(e);\n        }}\n        onClick={(e) => {\n          pos(e, \"--hb-xa10-cx\", \"--hb-xa10-cy\");\n          setPulse((p) => (p === \"a\" ? \"b\" : \"a\"));\n          onClick?.(e);\n        }}\n        {...rest}\n      >\n        <span className=\"hb-xa10-dots\" aria-hidden=\"true\" />\n        <span className=\"hb-xa10-scan\" aria-hidden=\"true\" />\n        <span className=\"hb-xa10-lit\" aria-hidden=\"true\" />\n        <span className=\"hb-xa10-ring\" aria-hidden=\"true\" />\n        <span className=\"hb-xa10-led\" aria-hidden=\"true\" />\n        <span className=\"hb-xa10-label\">{children}</span>\n        {status ? <span className=\"hb-xa10-status\">{status}</span> : null}\n      </button>\n    </>\n  );\n}\n"
    }
  ]
}