{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "suggestion-chip",
  "type": "registry:ui",
  "title": "Suggestion chip",
  "description": "One question the recognizer asks at middle confidence, beside its block: Chip(suggestion) with the question, its confidence as a small engraving, and mini accept and dismiss buttons. Faint until the block is hovered.",
  "dependencies": [],
  "registryDependencies": [
    "https://metalui.dev/r/tokens.json"
  ],
  "files": [
    {
      "path": "packages/metalui/src/blocks/suggestion-chip/suggestion-chip.tsx",
      "type": "registry:ui",
      "target": "components/metalui/blocks/suggestion-chip/suggestion-chip.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { Chip } from '../../components/chip/chip';\nimport { Label } from '../../components/label/label';\nimport { IconButton } from '../../components/icon-button/icon-button';\n\n/* ─────────────────────────────────────────────────────────\n * SUGGESTION CHIP (the reference design's .sugg): a composition\n *   Chip(suggestion) › Chip.Text (the question) + Label(small, the confidence) + Chip.Actions › IconButton(mini) ✓ ×\n *\n *   arrives   on settle, from 3 above and .96 (a footprint, no overshoot)\n *   rest      at .62: the person decides, the chip does not shout\n *   host      the block is hovered, or the chip has focus: 1, on settle\n *   ✓         accept: the host applies it (finishing the block first), undoable\n *   ×         dismiss: stored as a correction, never asked twice\n * At most one chip per block, and only for cues that change behaviour\n * (task, measurement, date, region). Never for a kind or a glyph.\n * ───────────────────────────────────────────────────────── */\n\n/* Faint until its block (the host, .mu-icon-trigger) is hovered or it holds focus; it arrives on settle\n * from 3 above and .96. Layout from the suggestion group. */\nconst CHIP = 'mu-suggestion opacity-suggestion-rest-opacity transition-opacity ease-settle duration-settle animate-suggestion-in in-[.mu-icon-trigger:hover]:opacity-100 hover:opacity-100 focus-within:opacity-100 data-host-hover:opacity-100';\nconst CONF = 'mu-suggestion-conf ml-suggestion-conf-margin-start mr-suggestion-conf-margin-end';\n\nexport interface SuggestionChipProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {\n  /** The question, as a person would ask it: \"Task?\", \"Date friday?\", \"Track as sleep?\", \"Move to Done?\". */\n  label: string;\n  /** The recognizer's confidence, 0–1, shown as an engraving (hidden confidence is a bug). */\n  confidence: number;\n  onAccept: () => void;\n  onDismiss: () => void;\n  /** Force the hovered-host brightness (the host usually drives it through .mu-icon-trigger:hover). */\n  hostHovered?: boolean;\n}\n\n/** One question the recognizer asks at middle confidence, beside its block. */\nexport const SuggestionChip = React.forwardRef<HTMLSpanElement, SuggestionChipProps>(function SuggestionChip(\n  { label, confidence, onAccept, onDismiss, hostHovered, className, ...props },\n  ref,\n) {\n  const conf = confidence.toFixed(2);\n  return (\n    <Chip.Root\n      ref={ref}\n      variant=\"suggestion\"\n      role=\"group\"\n      aria-label={`Suggestion: ${label} Confidence ${conf}`}\n      data-host-hover={hostHovered ? '' : undefined}\n      className={className ? `${CHIP} ${className}` : CHIP}\n      {...props}\n    >\n      <Chip.Text>{label}</Chip.Text>\n      <Label variant=\"small\" aria-hidden className={CONF}>{conf}</Label>\n      <Chip.Actions>\n        <IconButton variant=\"mini\" accept label=\"Accept\" icon=\"✓\" onClick={onAccept} />\n        <IconButton variant=\"mini\" label=\"Dismiss\" icon=\"×\" onClick={onDismiss} />\n      </Chip.Actions>\n    </Chip.Root>\n  );\n});\n"
    }
  ],
  "docs": "Agent guide: https://metalui.dev/r/suggestion-chip.md. SwiftUI: MetalSuggestionChip in the MetalUI Swift package."
}
