{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "core-tag-suggestions",
  "type": "registry:ui",
  "title": "Tag Suggestions",
  "description": "Tag Suggestions shared by module faces and application hosts.",
  "dependencies": [
    "maruaudio@>=0.0.3 <0.1.0"
  ],
  "registryDependencies": [
    "https://pluginui.com/r/core-tag-browser.json"
  ],
  "files": [
    {
      "path": "components/ui/tag-suggestions.tsx",
      "content": "/**\n * Source: https://maru.audio/ui-kit/tag-suggestions\n * Copyright © [Maru](https://maru.audio)\n *\n * Maru UI Kit — https://maru.audio/ui-kit\n *\n * Installed from the Maru UI registry. This file is yours now: edit it\n * freely, it will not be overwritten unless you re-run the add command.\n *\n * Keep this item’s companion files and CSS imports together. Dependencies\n * declared by the registry are installed with the source.\n */\nimport type { TagOption } from \"maruaudio/ui/shared/tag-browser-model\"\n\n/** Result tags first, then optional vocabulary fill, without duplicate IDs. */\nexport function tagSuggestionOptions(\n  options: readonly TagOption[],\n  suggestions: readonly string[],\n  fill: readonly string[] = [],\n  limit = 10\n): TagOption[] {\n  const byId = new Map(options.map((option) => [option.id, option]))\n  return [...new Set([...suggestions, ...fill])]\n    .flatMap((id) => (byId.has(id) ? [byId.get(id)!] : []))\n    .slice(0, Math.max(0, limit))\n}\n\n/** Controlled suggestion chips; vocabulary, state and query effects are host-owned. */\nexport function TagSuggestionRow({\n  options,\n  selected = [],\n  onSelect,\n  className,\n  chipClassName,\n  label = \"Suggested tags\",\n}: {\n  options: readonly TagOption[]\n  selected?: readonly string[]\n  onSelect: (id: string) => void\n  className?: string\n  chipClassName?: string\n  label?: string\n}) {\n  return (\n    <div\n      role=\"group\"\n      aria-label={label}\n      className={className}\n      data-tag-suggestions=\"\"\n      style={{\n        display: \"flex\",\n        flexWrap: \"wrap\",\n        alignItems: \"center\",\n        gap: 6,\n      }}\n    >\n      {options.map((option) => (\n        <button\n          key={option.id}\n          type=\"button\"\n          className={chipClassName}\n          aria-pressed={selected.includes(option.id)}\n          disabled={option.disabled}\n          onClick={() => onSelect(option.id)}\n        >\n          {option.label}\n        </button>\n      ))}\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "@ui/tag-suggestions.tsx"
    }
  ]
}
