{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tooltip",
  "title": "Tooltip",
  "description": "A small cut label that appears on hover or focus.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/tooltip.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Tooltip as SdkTooltip, TooltipContent, TooltipShortcut, TooltipTrigger } from \"@ui-sdk/react/tooltip\"\nimport \"@/registry/cyber/ui/cyber/tooltip.css\"\n\ntype ContentProps = React.ComponentProps<typeof TooltipContent>\n\n// A cut label that appears beside whatever it wraps, once the pointer has\n// rested there or keyboard focus has reached it, with a signal-colored edge\n// on the side that faces it. Moving along a row of them, the next opens at\n// once, without tearing in again.\n//\n// - `children` is the one element it belongs to: a Button, a link, anything\n//   that takes a ref and can be focused. The tooltip names it when it has no\n//   name of its own, so an icon key needs no aria-label, and describes it\n//   when it does.\n// - `content` is the label: a few plain words. It can't be focused, so\n//   nothing interactive goes in it, and touch screens never show it, so it\n//   is never the only place something is said.\n// - `side` and `align` place it; it flips when there isn't room.\n// - `shortcut` (like \"mod+k\") prints the keys beside the label. It's a hint\n//   only: bind the keys on the control itself.\nfunction Tooltip({\n  content,\n  children,\n  side = \"top\",\n  align = \"center\",\n  ...props\n}: Omit<React.ComponentProps<typeof SdkTooltip>, \"children\"> & {\n  content: string\n  children: React.ReactElement<Record<string, unknown>>\n  side?: ContentProps[\"side\"]\n  align?: ContentProps[\"align\"]\n}) {\n  return (\n    <SdkTooltip {...props}>\n      <TooltipTrigger render={children} />\n      {/* A span, so it can sit beside a link inside a paragraph. */}\n      <TooltipContent data-kit=\"tooltip\" data-frame=\"br\" render={<span />} side={side} align={align} sideOffset={6} collisionPadding={8}>\n        {content}\n        <TooltipShortcut data-kit=\"tooltip-shortcut\" />\n      </TooltipContent>\n    </SdkTooltip>\n  )\n}\n\nexport { Tooltip }\n",
      "type": "registry:ui",
      "target": "@ui/tooltip.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/tooltip.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  /* A label, not a panel: one line of mono in a small cut frame, edged in\n     the dim signal color, with a bright bar on the side that faces what it\n     names. ui-sdk reports that side, flips included, as data-side. */\n  [data-skin=\"cyber\"] [data-kit=\"tooltip\"] {\n    --frame-cut: 5px;\n    --frame-line: var(--cy-signal-dim);\n    --frame-fill: var(--cy-panel-2);\n    /* Frame variables inherit; this one is never patterned. */\n    --frame-image: none;\n    --tooltip-bar: 0 -2px;\n\n    width: max-content;\n    max-width: min(232px, calc(100vw - 16px));\n    margin: 0;\n    padding: 4px 9px;\n    font-family: var(--cy-mono);\n    font-size: var(--cy-text-xs);\n    font-weight: 500;\n    line-height: 1.45;\n    letter-spacing: 0.06em;\n    text-transform: uppercase;\n    white-space: normal;\n    color: var(--cy-ink-hi);\n    box-shadow: inset var(--tooltip-bar) 0 0 var(--cy-signal);\n    /* The pointer can cross onto it without closing it, but it never takes\n       a selection or a press meant for what's under it. */\n    user-select: none;\n\n    &[data-side=\"bottom\"] {\n      --tooltip-bar: 0 2px;\n    }\n    &[data-side=\"left\"] {\n      --tooltip-bar: -2px 0;\n    }\n    &[data-side=\"right\"] {\n      --tooltip-bar: 2px 0;\n    }\n\n    &[data-open] {\n      animation: var(--cy-fx-in) 160ms var(--cy-ease-snap) backwards;\n    }\n    /* The next one along a row is already \"there\": it switches, it doesn't\n       arrive. */\n    &[data-instant] {\n      animation: none;\n    }\n    &[data-ending-style] {\n      animation: var(--cy-fx-out) 90ms var(--cy-ease-snap) both;\n    }\n  }\n\n  /* The keys that do the same thing, as a keycap after the label. */\n  [data-skin=\"cyber\"] [data-kit=\"tooltip-shortcut\"] {\n    display: inline-block;\n    margin-inline-start: 8px;\n    padding-inline: 4px;\n    border: 1px solid var(--cy-signal-dim);\n    font-size: 10px;\n    letter-spacing: 0;\n    color: var(--cy-signal);\n\n    &:empty {\n      display: none;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/tooltip.css"
    }
  ],
  "type": "registry:ui"
}
