{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-stacked-text",
  "type": "registry:component",
  "title": "Button Stacked Text",
  "description": "The label is stacked above an alternate label. Hover rolls the letters upward one by one to reveal the second line.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "buttons",
    "button",
    "text",
    "roll",
    "stagger",
    "hover",
    "label"
  ],
  "docs": "https://hyperblur.dev/effects/button-stacked-text",
  "files": [
    {
      "path": "registry/hyperblur/button-stacked-text.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/button-stacked-text.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ButtonStackedTextProps\n  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"color\" | \"children\"> {\n  children?: string;\n  hoverLabel?: string;\n  stagger?: number;\n  variant?: \"outline\" | \"solid\";\n  accent?: string;\n  size?: \"sm\" | \"md\" | \"lg\";\n  loading?: boolean;\n  idle?: boolean;\n}\n\nconst css = `\n.hb-qaa {\n  --hb-qaa-c: #2f7bff;\n  --hb-qaa-bg: transparent;\n  --hb-qaa-fg: #ededed;\n  --hb-qaa-ring: #333333;\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 0.6em;\n  box-sizing: border-box;\n  margin: 0;\n  padding: 0.8em 1.8em;\n  font: inherit;\n  font-size: 15px;\n  font-weight: 600;\n  line-height: 1.25;\n  color: var(--hb-qaa-fg);\n  background: var(--hb-qaa-bg);\n  border: 0;\n  border-radius: 999px;\n  box-shadow: inset 0 0 0 1px var(--hb-qaa-ring);\n  cursor: pointer;\n  user-select: none;\n  -webkit-tap-highlight-color: transparent;\n  touch-action: manipulation;\n  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, background-color 0.25s ease;\n}\n.hb-qaa[data-size=\"sm\"] { font-size: 13px; }\n.hb-qaa[data-size=\"lg\"] { font-size: 17px; }\n.hb-qaa[data-variant=\"solid\"] {\n  --hb-qaa-bg: var(--hb-qaa-c);\n  --hb-qaa-fg: #ffffff;\n  --hb-qaa-ring: transparent;\n}\n.hb-qaa:hover:not(:disabled), .hb-qaa:focus-visible:not(:disabled) { --hb-qaa-ring: var(--hb-qaa-c); }\n.hb-qaa[data-variant=\"solid\"]:hover:not(:disabled) { filter: brightness(1.1); }\n.hb-qaa-w {\n  display: inline-flex;\n  flex-direction: column;\n  align-items: center;\n  height: 1.25em;\n  overflow: hidden;\n}\n.hb-qaa-row {\n  display: block;\n  height: 1.25em;\n  white-space: pre;\n}\n.hb-qaa-ch {\n  display: inline-block;\n  transform: translateY(0);\n  transition: transform 0.5s cubic-bezier(0.7, 0, 0.2, 1);\n  transition-delay: calc(var(--hb-qaa-i) * var(--hb-qaa-s));\n}\n.hb-qaa:hover:not(:disabled):not([aria-busy=\"true\"]) .hb-qaa-ch,\n.hb-qaa:focus-visible:not(:disabled):not([aria-busy=\"true\"]) .hb-qaa-ch {\n  transform: translateY(-100%);\n}\n.hb-qaa[data-idle=\"true\"]:not(:hover):not(:focus-visible):not(:disabled) .hb-qaa-ch {\n  animation: hb-qaa-roll 5.2s cubic-bezier(0.7, 0, 0.2, 1) infinite;\n  animation-delay: calc(1.2s + var(--hb-qaa-i) * var(--hb-qaa-s));\n}\n.hb-qaa:active:not(:disabled) { transform: scale(0.97); }\n.hb-qaa:focus-visible { outline: 2px solid var(--hb-qaa-c); outline-offset: 3px; }\n.hb-qaa:disabled { cursor: not-allowed; }\n.hb-qaa:disabled:not([aria-busy=\"true\"]) { opacity: 0.45; }\n.hb-qaa-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-qaa-spin 0.7s linear infinite;\n}\n@keyframes hb-qaa-spin { to { transform: rotate(360deg); } }\n@keyframes hb-qaa-roll {\n  0%, 62% { transform: translateY(0); }\n  72%, 86% { transform: translateY(-100%); }\n  96%, 100% { transform: translateY(0); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qaa { transition: none; }\n  .hb-qaa .hb-qaa-ch { animation: none !important; transition-duration: 0.01s; transition-delay: 0s; }\n  .hb-qaa:active:not(:disabled) { transform: none; }\n  .hb-qaa-sp { animation-duration: 1.6s; }\n}\n`;\n\nfunction Letters({ text, step }: { text: string; step: number }) {\n  return (\n    <>\n      {Array.from(text).map((ch, i) => (\n        <span\n          key={i}\n          className=\"hb-qaa-ch\"\n          style={{ \"--hb-qaa-i\": i, \"--hb-qaa-s\": `${step}ms` } as React.CSSProperties}\n        >\n          {ch === \" \" ? \" \" : ch}\n        </span>\n      ))}\n    </>\n  );\n}\n\nexport function ButtonStackedText({\n  children = \"Get started\",\n  hoverLabel = \"Let's go\",\n  stagger = 24,\n  variant = \"outline\",\n  accent = \"#2f7bff\",\n  size = \"md\",\n  loading = false,\n  idle = true,\n  disabled = false,\n  type = \"button\",\n  className = \"\",\n  style,\n  \"aria-label\": ariaLabel,\n  ...rest\n}: ButtonStackedTextProps) {\n  const vars = { \"--hb-qaa-c\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <>\n      <style href=\"hb-button-stacked-text\" precedence=\"default\">{css}</style>\n      <button\n        type={type}\n        className={`hb-qaa ${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        aria-label={ariaLabel ?? children}\n        {...rest}\n      >\n        {loading ? <span className=\"hb-qaa-sp\" aria-hidden=\"true\" /> : null}\n        <span className=\"hb-qaa-w\" aria-hidden=\"true\">\n          <span className=\"hb-qaa-row\">\n            <Letters text={children} step={stagger} />\n          </span>\n          <span className=\"hb-qaa-row\">\n            <Letters text={hoverLabel} step={stagger} />\n          </span>\n        </span>\n      </button>\n    </>\n  );\n}\n"
    }
  ]
}