{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "border-beam-button",
  "type": "registry:component",
  "title": "Border Beam Button",
  "description": "A thin beam of light travels around the border of a dark button and brightens on hover.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "buttons",
    "button",
    "border",
    "beam",
    "gradient",
    "glow"
  ],
  "docs": "https://hyperblur.dev/effects/border-beam-button",
  "files": [
    {
      "path": "registry/hyperblur/border-beam-button.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/border-beam-button.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface BorderBeamButtonProps\n  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"color\"> {\n  children: React.ReactNode;\n  color?: string;\n  secondary?: string;\n  duration?: number;\n  borderWidth?: number;\n  rounded?: number;\n  size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst css = `\n@property --hb-a {\n  syntax: \"<angle>\";\n  inherits: false;\n  initial-value: 0deg;\n}\n.hb-bb {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 0.5em;\n  margin: 0;\n  padding: 0.8em 1.7em;\n  font-family: inherit;\n  font-size: 15px;\n  font-weight: 600;\n  line-height: 1.2;\n  white-space: nowrap;\n  color: #f4f6fb;\n  background: #0a0c11;\n  border: 0;\n  border-radius: var(--hb-r);\n  box-shadow: inset 0 0 0 var(--hb-w) rgba(255, 255, 255, 0.1);\n  cursor: pointer;\n  -webkit-tap-highlight-color: transparent;\n  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, background-color 0.3s ease;\n}\n.hb-bb[data-size=\"sm\"] { font-size: 13px; padding: 0.65em 1.4em; }\n.hb-bb[data-size=\"lg\"] { font-size: 17px; padding: 0.9em 2em; }\n.hb-bb::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  padding: var(--hb-w);\n  border-radius: inherit;\n  pointer-events: none;\n  background: conic-gradient(\n    from var(--hb-a),\n    transparent 0deg,\n    transparent 225deg,\n    var(--hb-c2) 290deg,\n    var(--hb-c) 338deg,\n    transparent 360deg\n  );\n  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n  -webkit-mask-composite: xor;\n  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n  mask-composite: exclude;\n  opacity: 0.8;\n  filter: saturate(1.1);\n  animation: hb-bb-spin var(--hb-d) linear infinite;\n  transition: opacity 0.35s ease, filter 0.35s ease;\n}\n.hb-bb:hover {\n  transform: translateY(-1px);\n  background-color: #0e1117;\n  box-shadow:\n    inset 0 0 0 var(--hb-w) rgba(255, 255, 255, 0.16),\n    0 0 26px -8px color-mix(in srgb, var(--hb-c) 65%, transparent);\n}\n.hb-bb:hover::before { opacity: 1; filter: saturate(1.4) brightness(1.35); }\n.hb-bb:active { transform: scale(0.97); }\n.hb-bb:focus-visible { outline: 2px solid var(--hb-c); outline-offset: 3px; }\n.hb-bb:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }\n@keyframes hb-bb-spin {\n  to { --hb-a: 360deg; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-bb { transition: box-shadow 0.2s ease, background-color 0.2s ease; }\n  .hb-bb::before { animation: none; --hb-a: 215deg; transition: opacity 0.2s ease; }\n  .hb-bb:hover, .hb-bb:active { transform: none; }\n}\n`;\n\nexport function BorderBeamButton({\n  children,\n  color = \"#2f7bff\",\n  secondary = \"#19c3f5\",\n  duration = 3,\n  borderWidth = 1.5,\n  rounded = 9999,\n  size = \"md\",\n  type = \"button\",\n  className = \"\",\n  style,\n  ...rest\n}: BorderBeamButtonProps) {\n  const vars = {\n    \"--hb-c\": color,\n    \"--hb-c2\": secondary,\n    \"--hb-d\": `${Math.max(0.2, duration)}s`,\n    \"--hb-w\": `${Math.max(0.5, borderWidth)}px`,\n    \"--hb-r\": `${rounded}px`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <>\n      <style href=\"hb-border-beam-button\" precedence=\"default\">{css}</style>\n      <button\n        type={type}\n        className={`hb-bb ${className}`}\n        style={vars}\n        data-size={size}\n        {...rest}\n      >\n        {children}\n      </button>\n    </>\n  );\n}\n"
    }
  ]
}