{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "kbd",
  "type": "registry:ui",
  "title": "Kbd",
  "description": "Show a key or shortcut hint beside a caller-owned action.",
  "dependencies": [
    "lucide-react@0.561.0"
  ],
  "registryDependencies": [
    "https://ghost-ui.com/r/ghost-tokens.json",
    "https://ghost-ui.com/r/foundation.json"
  ],
  "files": [
    {
      "path": "src/components/ui/kbd.tsx",
      "type": "registry:component",
      "target": "@ui/kbd.tsx",
      "content": "import \"./foundation.css\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { ArrowBigUp, ArrowDown, ArrowLeft, ArrowRight, ArrowRightToLine, ArrowUp, ChevronUp, Command, CornerDownLeft, Delete, Option } from \"lucide-react\";\nimport \"./kbd.css\";\n\nconst keyIcons = {\n  Enter: CornerDownLeft,\n  Command,\n  Shift: ArrowBigUp,\n  Option,\n  Control: ChevronUp,\n  Tab: ArrowRightToLine,\n  Backspace: Delete,\n  ArrowUp,\n  ArrowDown,\n  ArrowLeft,\n  ArrowRight,\n};\n\nexport type KbdKey = keyof typeof keyIcons | \"Escape\";\n\nconst keyLabels: Record<KbdKey, string> = {\n  Enter: \"Enter\", Command: \"Command\", Shift: \"Shift\", Option: \"Option\", Control: \"Control\",\n  Tab: \"Tab\", Backspace: \"Backspace\", Escape: \"Escape\",\n  ArrowUp: \"Up arrow\", ArrowDown: \"Down arrow\", ArrowLeft: \"Left arrow\", ArrowRight: \"Right arrow\",\n};\n\nexport type KbdProps = Omit<ComponentProps<\"kbd\">, \"children\"> & {\n  variant?: \"outline\" | \"subtle\" | \"plain\";\n  size?: \"base\" | \"sm\";\n} & ({ keyName: KbdKey; keyLabel?: string; children?: never } | { keyName?: never; keyLabel?: never; children?: ReactNode });\n\n/** Displays a key; the caller owns its binding and platform-specific wording. */\nexport function Kbd({ className, variant = \"outline\", size = \"base\", keyName, keyLabel, children, ...props }: KbdProps) {\n  const Icon = keyName && keyName !== \"Escape\" ? keyIcons[keyName] : undefined;\n  return <kbd {...props} data-variant={variant} data-size={size} className={[\"ui-kbd\", className].filter(Boolean).join(\" \")}>\n    {keyName ? <><span className=\"ui-kbd-label\">{keyLabel ?? keyLabels[keyName]}</span>{Icon ? <Icon aria-hidden=\"true\" /> : <span aria-hidden=\"true\">Esc</span>}</> : children}\n  </kbd>;\n}\n\nexport function KbdGroup({ className, ...props }: ComponentProps<\"div\">) {\n  return <div role=\"group\" {...props} className={[\"ui-kbd-group\", className].filter(Boolean).join(\" \")} />;\n}\n"
    },
    {
      "path": "src/components/ui/kbd.css",
      "type": "registry:file",
      "target": "@ui/kbd.css",
      "content": "@import \"./tokens.css\";\n\n.ui-kbd {\n  box-sizing: border-box;\n  display: inline-flex;\n  flex-shrink: 0;\n  align-items: center;\n  justify-content: center;\n  min-inline-size: var(--space-5);\n  min-block-size: var(--space-5);\n  max-inline-size: 100%;\n  gap: var(--space-1);\n  padding-inline: var(--space-1);\n  border: 1px solid var(--border);\n  border-radius: var(--radius-control-keycap);\n  background: var(--ui-kbd-background, var(--secondary));\n  color: var(--muted-foreground);\n  font-family: var(--font-sans);\n  font-size: var(--font-size-caption);\n  font-weight: var(--font-weight-regular);\n  line-height: var(--leading-tight);\n  white-space: normal;\n  text-align: center;\n  overflow-wrap: anywhere;\n  user-select: none;\n}\n\n.ui-kbd[data-variant=\"subtle\"] {\n  border-color: transparent;\n}\n\n.ui-kbd[data-size=\"sm\"] {\n  min-inline-size: 18px;\n  min-block-size: 18px;\n  padding-inline: 3px;\n  font-size: 10px;\n  line-height: 12px;\n}\n\n.ui-kbd[data-variant=\"plain\"] {\n  min-inline-size: 0;\n  padding-inline: 0;\n  border: 0;\n  border-radius: 0;\n  background: transparent;\n}\n\n.ui-kbd[data-size] svg {\n  display: block;\n  inline-size: calc(var(--font-size-caption) - var(--space-1) / 2);\n  block-size: calc(var(--font-size-caption) - var(--space-1) / 2);\n  flex: none;\n  stroke-width: var(--icon-stroke);\n}\n\n.ui-kbd[data-size=\"sm\"] svg {\n  inline-size: 10px;\n  block-size: 10px;\n}\n\n.ui-kbd-group {\n  display: inline-flex;\n  align-items: center;\n  gap: var(--space-1);\n  max-inline-size: 100%;\n  flex-wrap: wrap;\n  direction: ltr;\n}\n\n.ui-kbd-label {\n  position: absolute;\n  inline-size: 1px;\n  block-size: 1px;\n  padding: 0;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n}\n"
    }
  ]
}
