{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-3d-press",
  "type": "registry:component",
  "title": "Button 3D Press",
  "description": "A chunky tactile button with a solid depth edge. It squashes flat on press and springs back with overshoot.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "buttons",
    "button",
    "3d",
    "press",
    "tactile",
    "spring",
    "game"
  ],
  "docs": "https://hyperblur.dev/effects/button-3d-press",
  "files": [
    {
      "path": "registry/hyperblur/button-3d-press.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/button-3d-press.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface Button3dPressProps\n  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"color\"> {\n  variant?: \"solid\" | \"light\";\n  accent?: string;\n  size?: \"sm\" | \"md\" | \"lg\";\n  depth?: number;\n  loading?: boolean;\n}\n\nconst css = `\n.hb-qa4 {\n  --hb-qa4-c: #2f7bff;\n  --hb-qa4-d: 6px;\n  --hb-qa4-face: var(--hb-qa4-c);\n  --hb-qa4-edge: color-mix(in srgb, var(--hb-qa4-c) 55%, #000000);\n  --hb-qa4-ink: #ffffff;\n  position: relative;\n  display: inline-flex;\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0 0 var(--hb-qa4-d);\n  font: inherit;\n  font-size: 15px;\n  font-weight: 700;\n  line-height: 1.2;\n  color: var(--hb-qa4-ink);\n  background: none;\n  border: 0;\n  border-radius: 14px;\n  cursor: pointer;\n  user-select: none;\n  -webkit-user-select: none;\n  -webkit-tap-highlight-color: transparent;\n  touch-action: manipulation;\n}\n.hb-qa4[data-size=\"sm\"] { font-size: 13px; }\n.hb-qa4[data-size=\"lg\"] { font-size: 17px; }\n.hb-qa4[data-variant=\"light\"] {\n  --hb-qa4-face: #f2f2f2;\n  --hb-qa4-edge: #8a8a8a;\n  --hb-qa4-ink: #0a0a0a;\n}\n.hb-qa4-e {\n  position: absolute;\n  top: var(--hb-qa4-d);\n  right: 0;\n  bottom: 0;\n  left: 0;\n  border-radius: inherit;\n  background: var(--hb-qa4-edge);\n  box-shadow: 0 8px 14px -4px rgba(0, 0, 0, 0.55);\n}\n.hb-qa4-f {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 0.6em;\n  width: 100%;\n  box-sizing: border-box;\n  padding: 0.85em 1.9em;\n  overflow: hidden;\n  white-space: nowrap;\n  border-radius: inherit;\n  background: linear-gradient(180deg, color-mix(in srgb, var(--hb-qa4-face) 86%, #ffffff), var(--hb-qa4-face));\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.08);\n  transform-origin: 50% 100%;\n  transition: transform 0.38s cubic-bezier(0.34, 1.9, 0.5, 1);\n}\n.hb-qa4-f::after {\n  content: \"\";\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  width: 40%;\n  pointer-events: none;\n  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);\n  transform: translateX(-130%) skewX(-18deg);\n  animation: hb-qa4-sheen 4.4s ease-in-out 1.2s infinite;\n}\n.hb-qa4:hover:not(:disabled) .hb-qa4-f { transform: translateY(-1px); }\n.hb-qa4:active:not(:disabled) .hb-qa4-f,\n.hb-qa4[data-pressed=\"true\"]:not(:disabled) .hb-qa4-f {\n  transform: translateY(var(--hb-qa4-d)) scale(1.03, 0.95);\n  transition-duration: 0.07s;\n  transition-timing-function: ease-out;\n}\n.hb-qa4[aria-busy=\"true\"] .hb-qa4-f { transform: translateY(calc(var(--hb-qa4-d) * 0.6)); }\n.hb-qa4:focus-visible { outline: 2px solid var(--hb-qa4-c); outline-offset: 4px; }\n.hb-qa4:disabled { cursor: not-allowed; }\n.hb-qa4:disabled:not([aria-busy=\"true\"]) { opacity: 0.45; }\n.hb-qa4:disabled:not([aria-busy=\"true\"]) .hb-qa4-f { transform: translateY(calc(var(--hb-qa4-d) * 0.7)); }\n.hb-qa4-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-qa4-spin 0.7s linear infinite;\n}\n@keyframes hb-qa4-spin { to { transform: rotate(360deg); } }\n@keyframes hb-qa4-sheen {\n  0%, 55% { transform: translateX(-130%) skewX(-18deg); }\n  80%, 100% { transform: translateX(340%) skewX(-18deg); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qa4-f { transition: none; }\n  .hb-qa4-f::after { animation: none; display: none; }\n  .hb-qa4:active:not(:disabled) .hb-qa4-f,\n  .hb-qa4[data-pressed=\"true\"]:not(:disabled) .hb-qa4-f { transform: translateY(var(--hb-qa4-d)); }\n  .hb-qa4-sp { animation-duration: 1.6s; }\n}\n`;\n\nexport function Button3dPress({\n  children = \"Continue\",\n  variant = \"solid\",\n  accent = \"#2f7bff\",\n  size = \"md\",\n  depth = 6,\n  loading = false,\n  disabled = false,\n  type = \"button\",\n  className = \"\",\n  style,\n  onKeyDown,\n  onKeyUp,\n  onBlur,\n  ...rest\n}: Button3dPressProps) {\n  const vars = {\n    \"--hb-qa4-c\": accent,\n    \"--hb-qa4-d\": `${Math.max(2, depth)}px`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <>\n      <style href=\"hb-button-3d-press\" precedence=\"default\">{css}</style>\n      <button\n        type={type}\n        className={`hb-qa4 ${className}`}\n        style={vars}\n        data-variant={variant}\n        data-size={size}\n        disabled={disabled || loading}\n        aria-busy={loading || undefined}\n        onKeyDown={(e) => {\n          if (e.key === \"Enter\" || e.key === \" \") e.currentTarget.dataset.pressed = \"true\";\n          onKeyDown?.(e);\n        }}\n        onKeyUp={(e) => {\n          delete e.currentTarget.dataset.pressed;\n          onKeyUp?.(e);\n        }}\n        onBlur={(e) => {\n          delete e.currentTarget.dataset.pressed;\n          onBlur?.(e);\n        }}\n        {...rest}\n      >\n        <span className=\"hb-qa4-e\" aria-hidden=\"true\" />\n        <span className=\"hb-qa4-f\">\n          {loading ? <span className=\"hb-qa4-sp\" aria-hidden=\"true\" /> : null}\n          {children}\n        </span>\n      </button>\n    </>\n  );\n}\n"
    }
  ]
}