{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tooltip",
  "title": "Tooltip",
  "description": "Hint on hover or keyboard focus, with an optional shortcut; neighbours open instantly.",
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "@ikas/kbd",
    "@ikas/utils"
  ],
  "files": [
    {
      "path": "registry/ui/tooltip.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Kbd } from \"@/components/ui/kbd\"\n\n/**\n * Put one at the root. The first tooltip waits for intent; once one has been open, its neighbours\n * open at once until the pointer has been away for `skipDelayDuration`.\n */\nfunction TooltipProvider({ delayDuration = 400, skipDelayDuration = 300, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n  return <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delayDuration={delayDuration} skipDelayDuration={skipDelayDuration} {...props} />\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n  return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n  return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Content> & {\n  /** Keyboard shortcut shown after the label, e.g. \"⌘K\". Only for a real shortcut. */\n  shortcut?: React.ReactNode\n}\n\n/**\n * The bubble grows from the edge that faces its trigger: 125ms on the reveal curve, out in 100ms with a fade only.\n * A neighbour or keyboard focus opens it instantly (Radix's `instant-open`) with no motion, and the bubble it\n * replaces disappears at once instead of fading under the new one. Reduced motion keeps the fade and drops the scale.\n */\nfunction TooltipContent({ className, sideOffset = 6, shortcut, children, ...props }: TooltipContentProps) {\n  return (\n    <TooltipPrimitive.Portal>\n      <TooltipPrimitive.Content\n        data-slot=\"tooltip-content\"\n        sideOffset={sideOffset}\n        className={cn(\n          \"z-50 inline-flex w-fit max-w-70 origin-(--radix-tooltip-content-transform-origin) items-center gap-2 rounded-lg bg-foreground px-2.5 py-1.5 text-xs font-medium text-background shadow-[0_2px_6px_0_var(--shade-2)] select-none has-data-[slot=kbd]:pr-1.5\",\n          \"data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-96 data-[state=delayed-open]:duration-125 data-[state=delayed-open]:ease-(--ease-reveal)\",\n          \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-100 data-[state=closed]:ease-(--ease-out)\",\n          // The bubble a neighbour replaces goes invisible at once but keeps its exit running: Radix unmounts on animationend,\n          // and removing the animation instead would leave it mounted.\n          \"data-[state=instant-open]:animate-none [body:has([data-slot=tooltip-content][data-state=instant-open])_&]:data-[state=closed]:opacity-0\",\n          \"motion-reduce:data-[state=delayed-open]:zoom-in-100 motion-reduce:data-[state=delayed-open]:duration-100\",\n          className,\n        )}\n        {...props}\n      >\n        {children}\n        {shortcut != null && <Kbd>{shortcut}</Kbd>}\n      </TooltipPrimitive.Content>\n    </TooltipPrimitive.Portal>\n  )\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TooltipContentProps }\n",
      "type": "registry:ui"
    }
  ],
  "docs": "https://builders.ikas.com/tr/docs/app-development/ui-kit/components/primitives",
  "categories": [
    "primitives",
    "overlays"
  ],
  "type": "registry:ui"
}