{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-icon-slide-expand",
  "type": "registry:component",
  "title": "Button Icon Slide Expand",
  "description": "A round icon button that grows to reveal its label on hover or focus. The width animates, so neighboring items in a flex row glide aside.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "buttons",
    "button",
    "icon",
    "expand",
    "toolbar",
    "label",
    "hover"
  ],
  "docs": "https://hyperblur.dev/effects/button-icon-slide-expand",
  "files": [
    {
      "path": "registry/hyperblur/button-icon-slide-expand.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/button-icon-slide-expand.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ButtonIconSlideExpandProps\n  extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"color\"> {\n  icon?: React.ReactNode;\n  variant?: \"solid\" | \"outline\" | \"ghost\";\n  accent?: string;\n  size?: \"sm\" | \"md\" | \"lg\";\n  open?: boolean;\n  loading?: boolean;\n}\n\nconst defaultIcon = (\n  <svg viewBox=\"0 0 24 24\" width=\"100%\" height=\"100%\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n    <path d=\"M5 12h14\" />\n    <path d=\"M13 6l6 6-6 6\" />\n  </svg>\n);\n\nconst css = `\n.hb-ya3 {\n  --hb-ya3-h: 2.75rem;\n  --hb-ya3-i: 1.15rem;\n  --hb-ya3-fs: 0.9375rem;\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  flex: none;\n  box-sizing: border-box;\n  height: var(--hb-ya3-h);\n  min-width: var(--hb-ya3-h);\n  margin: 0;\n  padding: 0 calc((var(--hb-ya3-h) - var(--hb-ya3-i)) / 2 - 1px);\n  font: inherit;\n  font-size: var(--hb-ya3-fs);\n  font-weight: 600;\n  line-height: 1;\n  white-space: nowrap;\n  border: 1px solid transparent;\n  border-radius: 999px;\n  cursor: pointer;\n  user-select: none;\n  -webkit-user-select: none;\n  -webkit-tap-highlight-color: transparent;\n  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.18s cubic-bezier(0.3, 1.4, 0.5, 1), filter 0.2s ease;\n}\n.hb-ya3 *, .hb-ya3 *::before, .hb-ya3 *::after { box-sizing: border-box; }\n.hb-ya3[data-size=\"sm\"] { --hb-ya3-h: 2.25rem; --hb-ya3-i: 1rem; --hb-ya3-fs: 0.8125rem; }\n.hb-ya3[data-size=\"lg\"] { --hb-ya3-h: 3.25rem; --hb-ya3-i: 1.35rem; --hb-ya3-fs: 1.0625rem; }\n.hb-ya3[data-variant=\"solid\"] { color: #fff; background: var(--hb-ya3-c); }\n.hb-ya3[data-variant=\"outline\"] {\n  color: #ededed;\n  background: #111111;\n  border-color: #2a2a2a;\n}\n.hb-ya3[data-variant=\"ghost\"] {\n  color: color-mix(in srgb, var(--hb-ya3-c) 70%, #fff);\n  background: color-mix(in srgb, var(--hb-ya3-c) 12%, transparent);\n}\n.hb-ya3[data-variant=\"solid\"]:not(:disabled):hover { filter: brightness(1.1); }\n.hb-ya3[data-variant=\"outline\"]:not(:disabled):hover,\n.hb-ya3[data-variant=\"outline\"][data-open=\"true\"] { border-color: var(--hb-ya3-c); }\n.hb-ya3[data-variant=\"ghost\"]:not(:disabled):hover { background: color-mix(in srgb, var(--hb-ya3-c) 20%, transparent); }\n.hb-ya3:not(:disabled):active { transform: scale(0.96); }\n.hb-ya3:focus-visible { outline: 2px solid var(--hb-ya3-c); outline-offset: 3px; }\n.hb-ya3:disabled { opacity: 0.45; cursor: not-allowed; }\n.hb-ya3[aria-busy=\"true\"] { cursor: progress; }\n.hb-ya3-icon {\n  display: grid;\n  flex: none;\n  place-items: center;\n  width: var(--hb-ya3-i);\n  height: var(--hb-ya3-i);\n  transition: transform 0.4s cubic-bezier(0.3, 0.9, 0.3, 1);\n}\n.hb-ya3-icon > svg { display: block; width: 100%; height: 100%; }\n.hb-ya3-wrap {\n  display: grid;\n  grid-template-columns: 0fr;\n  transition: grid-template-columns 0.42s cubic-bezier(0.3, 0.9, 0.3, 1);\n}\n.hb-ya3-clip { min-width: 0; overflow: hidden; }\n.hb-ya3-text {\n  display: block;\n  padding: 0 0.3em 0 0.6em;\n  opacity: 0;\n  transform: translateX(-8px);\n  transition: opacity 0.25s ease, transform 0.42s cubic-bezier(0.3, 0.9, 0.3, 1);\n}\n.hb-ya3:not(:disabled):hover .hb-ya3-wrap,\n.hb-ya3:not(:disabled):focus-visible .hb-ya3-wrap,\n.hb-ya3[data-open=\"true\"]:not(:disabled) .hb-ya3-wrap { grid-template-columns: 1fr; }\n.hb-ya3:not(:disabled):hover .hb-ya3-text,\n.hb-ya3:not(:disabled):focus-visible .hb-ya3-text,\n.hb-ya3[data-open=\"true\"]:not(:disabled) .hb-ya3-text {\n  opacity: 1;\n  transform: none;\n  transition-delay: 0.08s;\n}\n.hb-ya3:not(:disabled):hover .hb-ya3-icon,\n.hb-ya3:not(:disabled):focus-visible .hb-ya3-icon,\n.hb-ya3[data-open=\"true\"]:not(:disabled) .hb-ya3-icon { transform: scale(1.08); }\n.hb-ya3-spin {\n  width: 100%;\n  height: 100%;\n  border: 2px solid currentColor;\n  border-right-color: transparent;\n  border-radius: 50%;\n  animation: hb-ya3-turn 0.7s linear infinite;\n}\n@keyframes hb-ya3-turn {\n  to { transform: rotate(360deg); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-ya3, .hb-ya3-icon, .hb-ya3-wrap, .hb-ya3-text { transition: none; }\n  .hb-ya3:not(:disabled):active { transform: none; }\n  .hb-ya3-spin { animation-duration: 2s; }\n}\n`;\n\nexport function ButtonIconSlideExpand({\n  icon = defaultIcon,\n  variant = \"solid\",\n  accent = \"#2f7bff\",\n  size = \"md\",\n  open = false,\n  loading = false,\n  disabled = false,\n  type = \"button\",\n  className = \"\",\n  style,\n  children,\n  onClick,\n  ...rest\n}: ButtonIconSlideExpandProps) {\n  const vars = { \"--hb-ya3-c\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <>\n      <style href=\"hb-button-icon-slide-expand\" precedence=\"default\">{css}</style>\n      <button\n        type={type}\n        className={`hb-ya3 ${className}`}\n        style={vars}\n        data-variant={variant}\n        data-size={size}\n        data-open={open}\n        disabled={disabled}\n        aria-busy={loading || undefined}\n        onClick={(e) => {\n          if (loading) {\n            e.preventDefault();\n            return;\n          }\n          onClick?.(e);\n        }}\n        {...rest}\n      >\n        <span className=\"hb-ya3-icon\" aria-hidden=\"true\">\n          {loading ? <span className=\"hb-ya3-spin\" /> : icon}\n        </span>\n        <span className=\"hb-ya3-wrap\">\n          <span className=\"hb-ya3-clip\">\n            <span className=\"hb-ya3-text\">{children}</span>\n          </span>\n        </span>\n      </button>\n    </>\n  );\n}\n"
    }
  ]
}