{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-glitch-hover",
  "type": "registry:component",
  "title": "Button Glitch Hover",
  "description": "Chromatic slices of the label jitter on hover and keyboard focus, then snap clean when the pointer leaves. A brief glitch also fires now and then while idle.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "buttons",
    "button",
    "glitch",
    "chromatic",
    "hover",
    "cyber",
    "retro"
  ],
  "docs": "https://hyperblur.dev/effects/button-glitch-hover",
  "files": [
    {
      "path": "registry/hyperblur/button-glitch-hover.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/button-glitch-hover.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ButtonGlitchHoverProps\n  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"color\"> {\n  variant?: \"outline\" | \"solid\";\n  accent?: string;\n  size?: \"sm\" | \"md\" | \"lg\";\n  loading?: boolean;\n  idle?: boolean;\n}\n\nconst css = `\n.hb-qa3 {\n  --hb-qa3-c: #2f7bff;\n  --hb-qa3-d: #ff2e63;\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0.8em 1.7em;\n  font: inherit;\n  font-size: 15px;\n  font-weight: 700;\n  letter-spacing: 0.04em;\n  line-height: 1.2;\n  color: #ededed;\n  background: #101010;\n  border: 0;\n  border-radius: 4px;\n  box-shadow: inset 0 0 0 1px #2c2c2c;\n  cursor: pointer;\n  isolation: isolate;\n  user-select: none;\n  -webkit-tap-highlight-color: transparent;\n  touch-action: manipulation;\n  transition: box-shadow 0.15s ease, background-color 0.15s ease;\n}\n.hb-qa3[data-size=\"sm\"] { font-size: 13px; }\n.hb-qa3[data-size=\"lg\"] { font-size: 17px; }\n.hb-qa3[data-variant=\"solid\"] { color: #ffffff; background: var(--hb-qa3-c); box-shadow: none; }\n.hb-qa3-t, .hb-qa3-r, .hb-qa3-b {\n  display: inline-flex;\n  align-items: center;\n  gap: 0.6em;\n  white-space: nowrap;\n}\n.hb-qa3-t { position: relative; z-index: 2; }\n.hb-qa3-r, .hb-qa3-b {\n  position: absolute;\n  inset: 0;\n  z-index: 3;\n  justify-content: center;\n  pointer-events: none;\n  opacity: 0;\n  mix-blend-mode: screen;\n}\n.hb-qa3-r { color: var(--hb-qa3-d); }\n.hb-qa3-b { color: var(--hb-qa3-c); }\n.hb-qa3[data-variant=\"solid\"] .hb-qa3-r, .hb-qa3[data-variant=\"solid\"] .hb-qa3-b { mix-blend-mode: normal; }\n.hb-qa3[data-variant=\"solid\"] .hb-qa3-b { color: #7fe9ff; }\n.hb-qa3:hover:not(:disabled), .hb-qa3:focus-visible:not(:disabled) {\n  box-shadow: inset 0 0 0 1px var(--hb-qa3-c);\n}\n.hb-qa3:hover:not(:disabled) .hb-qa3-t, .hb-qa3:focus-visible:not(:disabled) .hb-qa3-t {\n  animation: hb-qa3-main 0.42s steps(1, end) infinite;\n}\n.hb-qa3:hover:not(:disabled) .hb-qa3-r, .hb-qa3:focus-visible:not(:disabled) .hb-qa3-r {\n  opacity: 1;\n  animation: hb-qa3-red 0.5s steps(1, end) infinite;\n}\n.hb-qa3:hover:not(:disabled) .hb-qa3-b, .hb-qa3:focus-visible:not(:disabled) .hb-qa3-b {\n  opacity: 1;\n  animation: hb-qa3-blue 0.38s steps(1, end) infinite;\n}\n.hb-qa3[data-idle=\"true\"]:not(:hover):not(:focus-visible):not(:disabled) .hb-qa3-r {\n  animation: hb-qa3-burst-r 4.2s steps(1, end) infinite;\n}\n.hb-qa3[data-idle=\"true\"]:not(:hover):not(:focus-visible):not(:disabled) .hb-qa3-b {\n  animation: hb-qa3-burst-b 4.2s steps(1, end) infinite;\n}\n.hb-qa3:active:not(:disabled) { transform: translate(1px, 1px); }\n.hb-qa3:focus-visible { outline: 2px solid var(--hb-qa3-c); outline-offset: 3px; }\n.hb-qa3:disabled { cursor: not-allowed; }\n.hb-qa3:disabled:not([aria-busy=\"true\"]) { opacity: 0.45; }\n.hb-qa3-sp {\n  width: 1em;\n  height: 1em;\n  flex: none;\n  border: 2px solid currentColor;\n  border-right-color: transparent;\n  border-radius: 50%;\n  animation: hb-qa3-spin 0.7s linear infinite;\n}\n@keyframes hb-qa3-spin { to { transform: rotate(360deg); } }\n@keyframes hb-qa3-main {\n  0% { transform: translate(0, 0); }\n  20% { transform: translate(-1px, 0); }\n  40% { transform: translate(1px, 1px); }\n  60% { transform: translate(0, -1px); }\n  80% { transform: translate(1px, 0); }\n}\n@keyframes hb-qa3-red {\n  0% { clip-path: inset(10% 0 62% 0); transform: translate(-3px, 0); }\n  16% { clip-path: inset(58% 0 12% 0); transform: translate(3px, 0); }\n  33% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 1px); }\n  50% { clip-path: inset(72% 0 4% 0); transform: translate(4px, 0); }\n  66% { clip-path: inset(2% 0 78% 0); transform: translate(-4px, 0); }\n  83% { clip-path: inset(44% 0 30% 0); transform: translate(2px, -1px); }\n}\n@keyframes hb-qa3-blue {\n  0% { clip-path: inset(64% 0 8% 0); transform: translate(3px, 0); }\n  20% { clip-path: inset(6% 0 70% 0); transform: translate(-3px, 0); }\n  40% { clip-path: inset(40% 0 34% 0); transform: translate(2px, 1px); }\n  60% { clip-path: inset(18% 0 56% 0); transform: translate(-4px, 0); }\n  80% { clip-path: inset(78% 0 2% 0); transform: translate(3px, -1px); }\n}\n@keyframes hb-qa3-burst-r {\n  0%, 88% { opacity: 0; }\n  89% { opacity: 1; clip-path: inset(12% 0 60% 0); transform: translate(-3px, 0); }\n  92% { opacity: 1; clip-path: inset(56% 0 14% 0); transform: translate(3px, 0); }\n  95% { opacity: 1; clip-path: inset(34% 0 36% 0); transform: translate(-2px, 0); }\n  97%, 100% { opacity: 0; }\n}\n@keyframes hb-qa3-burst-b {\n  0%, 89% { opacity: 0; }\n  90% { opacity: 1; clip-path: inset(60% 0 10% 0); transform: translate(3px, 0); }\n  93% { opacity: 1; clip-path: inset(8% 0 66% 0); transform: translate(-3px, 0); }\n  96% { opacity: 1; clip-path: inset(42% 0 28% 0); transform: translate(2px, 0); }\n  98%, 100% { opacity: 0; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qa3 { transition: none; }\n  .hb-qa3 .hb-qa3-t, .hb-qa3 .hb-qa3-r, .hb-qa3 .hb-qa3-b { animation: none !important; }\n  .hb-qa3:hover:not(:disabled) .hb-qa3-r, .hb-qa3:focus-visible:not(:disabled) .hb-qa3-r { opacity: 0.7; transform: translate(-2px, 0); }\n  .hb-qa3:hover:not(:disabled) .hb-qa3-b, .hb-qa3:focus-visible:not(:disabled) .hb-qa3-b { opacity: 0.7; transform: translate(2px, 0); }\n  .hb-qa3:active:not(:disabled) { transform: none; }\n  .hb-qa3-sp { animation-duration: 1.6s; }\n}\n`;\n\nexport function ButtonGlitchHover({\n  children = \"Reconnect\",\n  variant = \"outline\",\n  accent = \"#2f7bff\",\n  size = \"md\",\n  loading = false,\n  disabled = false,\n  idle = true,\n  type = \"button\",\n  className = \"\",\n  style,\n  ...rest\n}: ButtonGlitchHoverProps) {\n  const vars = { \"--hb-qa3-c\": accent, ...style } as React.CSSProperties;\n  const label = (\n    <>\n      {loading ? <span className=\"hb-qa3-sp\" aria-hidden=\"true\" /> : null}\n      {children}\n    </>\n  );\n\n  return (\n    <>\n      <style href=\"hb-button-glitch-hover\" precedence=\"default\">{css}</style>\n      <button\n        type={type}\n        className={`hb-qa3 ${className}`}\n        style={vars}\n        data-variant={variant}\n        data-size={size}\n        data-idle={idle ? \"true\" : \"false\"}\n        disabled={disabled || loading}\n        aria-busy={loading || undefined}\n        {...rest}\n      >\n        <span className=\"hb-qa3-t\">{label}</span>\n        <span className=\"hb-qa3-r\" aria-hidden=\"true\">{label}</span>\n        <span className=\"hb-qa3-b\" aria-hidden=\"true\">{label}</span>\n      </button>\n    </>\n  );\n}\n"
    }
  ]
}