{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tooltips-rich",
  "title": "Rich tooltips",
  "description": "Styled tooltips: the Rich set. 5 decorative tooltips variations (TitleTooltip, IconTooltip, KbdTooltip, MediaTooltip, MenuTooltip) on the ai2 token system, driven by CSS token transitions and sized sm to xl. Part of the free styled layer.",
  "dependencies": [],
  "registryDependencies": [
    "@ai2/tokens"
  ],
  "files": [
    {
      "path": "registry/ai2/styled/tooltips-rich.tsx",
      "content": "\"use client\"\n\nimport type * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Rich tooltip family: 5 bubbles with multi-part content. Self-contained (no radix,\n   no new deps) - it opens on hover/focus with CSS, and the transform transitions are\n   protected with motion-reduce. Color comes ONLY from tokens. size = the bubble\n   padding/text. children = the trigger, content = the tooltip text. */\n\nexport type StyledSize = \"sm\" | \"md\" | \"lg\" | \"xl\"\n\nconst bubbleSize: Record<StyledSize, string> = {\n  sm: \"px-2 py-1.5 text-xs\",\n  md: \"px-2.5 py-2 text-xs\",\n  lg: \"px-3 py-2.5 text-sm\",\n  xl: \"px-3.5 py-3 text-sm\",\n}\n\nconst bubbleBase =\n  \"pointer-events-none absolute bottom-full left-1/2 z-10 mb-2 w-max max-w-64 -translate-x-1/2 translate-y-1 rounded-lg font-medium opacity-0 shadow-md transition-[opacity,transform] duration-(--motion-base) ease-(--motion-ease) group-hover:translate-y-0 group-hover:opacity-100 group-focus-within:translate-y-0 group-focus-within:opacity-100 motion-reduce:transition-none\"\n\ninterface Props {\n  size?: StyledSize\n  content: React.ReactNode\n  children: React.ReactNode\n  className?: string\n}\n\nfunction Wrapper({ children, bubble }: { children: React.ReactNode; bubble: React.ReactNode }) {\n  return (\n    <span data-slot=\"styled-tooltip\" className=\"group relative inline-flex\">\n      {children}\n      {bubble}\n    </span>\n  )\n}\n\n/* Title: kalin baslik satiri + altinda icerik. */\nexport function TitleTooltip({ size = \"md\", content, children, className, title }: Props & { title?: React.ReactNode }) {\n  return (\n    <Wrapper\n      bubble={\n        <span role=\"tooltip\" className={cn(bubbleBase, bubbleSize[size], \"flex flex-col gap-0.5 border border-border bg-popover text-popover-foreground\", className)}>\n          {title ? <span className=\"font-semibold text-foreground\">{title}</span> : null}\n          <span className=\"text-muted-foreground\">{content}</span>\n        </span>\n      }\n    >\n      {children}\n    </Wrapper>\n  )\n}\n\n/* Icon: icerigin yaninda one alinan ikon yuvasi. */\nexport function IconTooltip({ size = \"md\", content, children, className, icon }: Props & { icon?: React.ReactNode }) {\n  return (\n    <Wrapper\n      bubble={\n        <span\n          role=\"tooltip\"\n          className={cn(bubbleBase, bubbleSize[size], \"inline-flex items-center gap-1.5 border border-border bg-popover text-popover-foreground [&_i]:text-base [&_i]:leading-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-info\", className)}\n        >\n          {icon ? <span className=\"inline-flex text-info\">{icon}</span> : null}\n          {content}\n        </span>\n      }\n    >\n      {children}\n    </Wrapper>\n  )\n}\n\n/* Kbd: icerik + token klavye-tusu cipi. */\nexport function KbdTooltip({ size = \"md\", content, children, className, keys }: Props & { keys?: string }) {\n  return (\n    <Wrapper\n      bubble={\n        <span role=\"tooltip\" className={cn(bubbleBase, bubbleSize[size], \"inline-flex items-center gap-2 border border-border bg-popover text-popover-foreground\", className)}>\n          {content}\n          {keys ? (\n            <kbd className=\"inline-flex h-5 min-w-5 items-center justify-center rounded border border-border bg-muted px-1.5 font-mono text-[0.65rem] text-muted-foreground\">\n              {keys}\n            </kbd>\n          ) : null}\n        </span>\n      }\n    >\n      {children}\n    </Wrapper>\n  )\n}\n\n/* Media: kucuk token kucuk-resim blogu + icerik. */\nexport function MediaTooltip({ size = \"md\", content, children, className, thumb }: Props & { thumb?: React.ReactNode }) {\n  return (\n    <Wrapper\n      bubble={\n        <span role=\"tooltip\" className={cn(bubbleBase, bubbleSize[size], \"inline-flex items-center gap-2.5 border border-border bg-popover text-popover-foreground\", className)}>\n          <span className=\"inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-[linear-gradient(135deg,var(--color-surface-2),var(--color-surface-3))] text-muted-foreground [&_svg]:size-4\">\n            {thumb}\n          </span>\n          {content}\n        </span>\n      }\n    >\n      {children}\n    </Wrapper>\n  )\n}\n\n/* Menu: icerik kucuk dikey liste olarak gosterilir. */\nexport function MenuTooltip({ size = \"md\", content, children, className, items }: Props & { items?: string[] }) {\n  return (\n    <Wrapper\n      bubble={\n        <span role=\"tooltip\" className={cn(bubbleBase, bubbleSize[size], \"flex flex-col gap-1 border border-border bg-popover text-popover-foreground\", className)}>\n          {content ? <span className=\"font-semibold text-foreground\">{content}</span> : null}\n          {items && items.length > 0 ? (\n            <span className=\"flex flex-col gap-0.5\">\n              {items.map((item, i) => (\n                <span key={i} className=\"inline-flex items-center gap-1.5 text-muted-foreground\">\n                  <span className=\"size-1 shrink-0 rounded-full bg-info\" />\n                  {item}\n                </span>\n              ))}\n            </span>\n          ) : null}\n        </span>\n      }\n    >\n      {children}\n    </Wrapper>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/ui/tooltips-rich.tsx"
    }
  ],
  "categories": [
    "styled",
    "tooltips"
  ],
  "type": "registry:component"
}