{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tooltip",
  "title": "Tooltip",
  "description": "One-line hint that appears on hover or focus with no delay and leaves with the pointer, for detail that does not deserve screen space.",
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/miseui/ui/tooltip.tsx",
      "content": "import type * as React from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\n\n/** No hover delay: a tooltip that waits feels like the UI is ignoring the cursor. */\nconst DEFAULT_DELAY_MS = 0\n/** Gap between the trigger and the tooltip, in px. */\nconst SIDE_OFFSET_PX = 4\n\nconst PLAIN_MOTION_CLASS = [\n  \"animate-in fade-in-0 zoom-in-95 duration-(--duration-fast) ease-(--ease-mise)\",\n  \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n  \"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\",\n  \"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n]\n\n/**\n * The enter runs unconditionally: a tooltip's open states are `delayed-open` and `instant-open`, never `open`.\n * The enter and exit values stay unqualified so the media overrides below win on source order.\n */\nconst MATERIALIZE_CLASS = [\n  \"duration-(--duration-base) ease-(--ease-mise-out) will-change-[transform,opacity,filter]\",\n  \"animate-in data-[state=closed]:animate-out\",\n  \"fade-in-0 zoom-in-75 blur-in-xs fade-out-0 zoom-out-75 blur-out-xs\",\n  \"motion-reduce:zoom-in-100 motion-reduce:zoom-out-100 motion-reduce:blur-in-0 motion-reduce:blur-out-0\",\n  \"[@media(prefers-reduced-transparency:reduce)]:blur-in-0 [@media(prefers-reduced-transparency:reduce)]:blur-out-0\",\n]\n\ntype TooltipEffect = \"materialize\"\n\nfunction TooltipProvider({\n  delayDuration = DEFAULT_DELAY_MS,\n  ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n  return <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delayDuration={delayDuration} {...props} />\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n  return (\n    <TooltipProvider>\n      <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n    </TooltipProvider>\n  )\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  /** `materialize` grows the hint out of its trigger with scale, blur and opacity together. */\n  effect?: TooltipEffect\n}\n\nfunction TooltipContent({ className, sideOffset = SIDE_OFFSET_PX, children, effect, ...props }: TooltipContentProps) {\n  return (\n    <TooltipPrimitive.Portal>\n      <TooltipPrimitive.Content\n        data-slot=\"tooltip-content\"\n        data-effect={effect}\n        sideOffset={sideOffset}\n        className={cn(\n          \"z-50 w-fit max-w-xs rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground\",\n          \"origin-(--radix-tooltip-content-transform-origin)\",\n          effect === \"materialize\" ? MATERIALIZE_CLASS : PLAIN_MOTION_CLASS,\n          className,\n        )}\n        {...props}\n      >\n        {children}\n        <TooltipPrimitive.Arrow className=\"z-50 size-2.5 fill-primary\" />\n      </TooltipPrimitive.Content>\n    </TooltipPrimitive.Portal>\n  )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, type TooltipEffect, type TooltipContentProps }\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "overlays"
  ],
  "type": "registry:ui"
}