{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "icon-button",
  "title": "Icon Button",
  "description": "A Button that shows only an icon, with a required accessible label and a tooltip-ready target.",
  "registryDependencies": [
    "https://sproutboat.com/ikada/r/theme.json",
    "https://sproutboat.com/ikada/r/button.json",
    "https://sproutboat.com/ikada/r/cn.json",
    "https://sproutboat.com/ikada/r/tooltip.json"
  ],
  "files": [
    {
      "path": "registry/ikada/ui/icon-button.tsx",
      "content": "\"use client\";\n\nimport { tv } from \"@/components/ikada/lib/cn\";\nimport { Button } from \"@/components/ikada/button\";\nimport type { ButtonProps } from \"@/components/ikada/button\";\nimport { Tooltip } from \"@/components/ikada/tooltip\";\n\nconst iconSize = tv({\n  variants: {\n    size: {\n      sm: \"size-(--sb-control-h-sm) px-0 pointer-coarse:min-w-11\",\n      md: \"size-(--sb-control-h) px-0 pointer-coarse:min-w-11\",\n      lg: \"size-10 px-0 pointer-coarse:min-w-11\",\n    },\n  },\n  defaultVariants: { size: \"md\" },\n});\n\nexport interface IconButtonProps extends Omit<ButtonProps, \"children\" | \"aria-label\"> {\n  /** Required. Becomes the accessible name and the tooltip text. */\n  label: string;\n  /** The icon. The accessible name comes from `label`. */\n  children: ButtonProps[\"children\"];\n  /** Set false when a parent already explains the button. */\n  tooltip?: boolean;\n}\n\n/** A Button that shows only an icon. `label` is required: it names the button and becomes its tooltip. */\nexport function IconButton({\n  label,\n  tooltip = true,\n  size,\n  variant = \"ghost\",\n  className,\n  children,\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={iconSize({ size, className })}\n      {...props}\n    >\n      {children}\n    </Button>\n  );\n  return tooltip ? <Tooltip content={label}>{button}</Tooltip> : button;\n}\n",
      "type": "registry:ui",
      "target": "@components/ikada/icon-button.tsx"
    }
  ],
  "categories": [
    "actions"
  ],
  "type": "registry:ui"
}