{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "icon-button",
  "type": "registry:ui",
  "title": "Icon Button",
  "description": "Square icon-only button with a mandatory accessible label and an automatic tooltip (with optional shortcut).",
  "dependencies": [],
  "registryDependencies": [
    "https://kuro.abstergo.fyi/r/kura-theme.json",
    "https://kuro.abstergo.fyi/r/button.json",
    "https://kuro.abstergo.fyi/r/kura-keys.json",
    "https://kuro.abstergo.fyi/r/tooltip.json",
    "utils"
  ],
  "files": [
    {
      "path": "registry/kura/icon-button/icon-button.tsx",
      "type": "registry:ui",
      "target": "components/kura/icon-button/icon-button.tsx",
      "content": "\"use client\";\n\nimport type * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport type { KeyName } from \"@/lib/kura/keys\";\nimport { Button, type ButtonProps } from \"@/components/kura/button\";\nimport { Tooltip } from \"@/components/kura/tooltip\";\n\nexport interface IconButtonProps extends Omit<ButtonProps, \"children\" | \"aria-label\"> {\n  /** Required accessible name. Also used as the tooltip text. */\n  label: string;\n  /** The icon, e.g. `<ArrowUp />` from lucide-react. Sized automatically. */\n  icon: React.ReactNode;\n  /** Show `label` (and `shortcut`) in a tooltip. Default true. */\n  tooltip?: boolean;\n  /** Shortcut displayed in the tooltip. Display only — bind it with `useHotkey`. */\n  shortcut?: readonly KeyName[];\n  tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\";\n}\n\nconst square = {\n  xs: \"size-6 px-0\",\n  sm: \"size-7 px-0\",\n  md: \"size-8 px-0\",\n  lg: \"size-10 px-0\",\n} as const;\n\n/**\n * Square, icon-only button with a mandatory accessible label and an automatic tooltip.\n * Defaults to the `ghost` variant.\n */\nexport function IconButton({\n  label,\n  icon,\n  tooltip = true,\n  shortcut,\n  tooltipSide = \"top\",\n  variant = \"ghost\",\n  size = \"md\",\n  className,\n  ...props\n}: IconButtonProps) {\n  const button = (\n    <Button\n      data-slot=\"icon-button\"\n      aria-label={label}\n      variant={variant}\n      size={size}\n      className={cn(square[size], className)}\n      {...props}\n    >\n      {icon}\n    </Button>\n  );\n  if (!tooltip) return button;\n  return (\n    <Tooltip content={label} shortcut={shortcut} side={tooltipSide}>\n      {button}\n    </Tooltip>\n  );\n}\n"
    },
    {
      "path": "registry/kura/icon-button/index.ts",
      "type": "registry:ui",
      "target": "components/kura/icon-button/index.ts",
      "content": "export { IconButton, type IconButtonProps } from \"./icon-button\";\n"
    }
  ],
  "categories": [
    "primitives",
    "button",
    "icon",
    "toolbar",
    "action"
  ],
  "docs": "Docs: https://kuro.abstergo.fyi/components/icon-button · Markdown for agents: https://kuro.abstergo.fyi/components/icon-button.md",
  "meta": {
    "kura": {
      "status": "stable",
      "whenToUse": [
        "Toolbar and composer actions: attach, mic, send, stop, copy, retry.",
        "Any action represented only by an icon."
      ],
      "whenNotToUse": [
        "Actions that need a visible text label — use button.",
        "Toggles with on/off state in a group — compose button with aria-pressed."
      ]
    }
  }
}
