{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tooltip",
  "title": "Tooltip",
  "description": "The plain Material tooltip.",
  "dependencies": [
    "@base-ui/react@^1.7.0"
  ],
  "registryDependencies": [
    "https://guillermo-rebolledo.github.io/materialcn/r/materialcn-theme.json",
    "https://guillermo-rebolledo.github.io/materialcn/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/ui/tooltip.tsx",
      "content": "import { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\n/**\n * How long a pointer must rest on a trigger before its tooltip opens.\n *\n * Material does not specify a value, so this is the library's. 500ms sits\n * between the two failure modes: a pointer crossing a dense icon row is over\n * any one target for well under 200ms, so a shorter delay fires every tooltip\n * it passes and the toolbar flickers; past roughly 700ms a deliberate hover\n * starts to feel like nothing is going to happen.\n *\n * It applies to hover only. Focus opens immediately — the delay exists to\n * filter out pointer movement that was never aimed at the trigger, and moving\n * focus to something is never accidental in that way.\n */\nconst TOOLTIP_OPEN_DELAY = 500\n\n/**\n * Wrap the app once. Besides supplying the delay, the provider is what makes a\n * tooltip that is already open hand over to the next trigger instantly, so\n * reading along a row of icons costs the delay once rather than per icon.\n */\nfunction TooltipProvider({\n  delay = TOOLTIP_OPEN_DELAY,\n  ...props\n}: TooltipPrimitive.Provider.Props) {\n  return (\n    <TooltipPrimitive.Provider\n      data-slot=\"tooltip-provider\"\n      delay={delay}\n      {...props}\n    />\n  )\n}\n\nfunction Tooltip({ ...props }: TooltipPrimitive.Root.Props) {\n  return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n}\n\n/**\n * `delay` is deliberately not defaulted here. A value on the trigger wins over\n * the provider's, so defaulting it would silence the provider for every tooltip\n * in the app and leave the grouping with nothing to group. Pass one only to\n * override a single instance.\n */\nfunction TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {\n  return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\nfunction TooltipContent({\n  className,\n  side = \"top\",\n  sideOffset = 4,\n  align = \"center\",\n  alignOffset = 0,\n  children,\n  ...props\n}: TooltipPrimitive.Popup.Props &\n  Pick<\n    TooltipPrimitive.Positioner.Props,\n    \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n  >) {\n  return (\n    <TooltipPrimitive.Portal>\n      <TooltipPrimitive.Positioner\n        align={align}\n        alignOffset={alignOffset}\n        side={side}\n        sideOffset={sideOffset}\n        className=\"isolate z-(--m3-z-tooltip)\"\n      >\n        <TooltipPrimitive.Popup\n          role=\"tooltip\"\n          data-slot=\"tooltip-content\"\n          className={cn(\n            \"w-fit max-w-56 rounded-m3-xs bg-m3-inverse-surface px-2 py-1 text-m3-body-sm text-m3-inverse-on-surface\",\n            className\n          )}\n          {...props}\n        >\n          {/* The kit's plain tooltip has no caret. */}\n          {children}\n        </TooltipPrimitive.Popup>\n      </TooltipPrimitive.Positioner>\n    </TooltipPrimitive.Portal>\n  )\n}\n\nexport {\n  TOOLTIP_OPEN_DELAY,\n  Tooltip,\n  TooltipTrigger,\n  TooltipContent,\n  TooltipProvider,\n}\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "feedback"
  ],
  "type": "registry:ui"
}