{
  "name": "armed-row",
  "type": "registry:ui",
  "title": "ArmedRow",
  "description": "The list row that composes the grammar: arm ring, live chip, readiness dot, in-place rename, hover-revealed actions, context menu, reorder handle.",
  "dependencies": [
    "@candlelight-ds/tokens",
    "clsx",
    "tailwind-merge"
  ],
  "registryDependencies": [
    "ink",
    "menu",
    "tooltip",
    "chip",
    "status-dot",
    "utils"
  ],
  "files": [
    {
      "path": "components/instruments/ArmedRow.tsx",
      "type": "registry:ui",
      "content": "'use client'\n\n/**\n * ArmedRow — the list row that composes the grammar: arm ring (G1),\n * live chip (G7), readiness dot (G6), in-place rename (G8),\n * hover-revealed actions (G10), context menu, reorder handle (G9).\n * A composition of Ink, ReadinessDot, Chip, and the Menu engine; the\n * armed row carries the accent ring the Sheet's adjacency contract\n * expects.\n *\n * Use when: rows in a SplitShell/StageShell list arm an object for\n * editing or performing.\n * Don't use when: multi-select tables (compose with useSelection's\n * styling contract) or uniform archive rows (C5).\n */\n\nimport { GripVertical, MoreHorizontal, Play, Square } from 'lucide-react'\nimport { Chip } from '@/components/ui/Chip'\nimport { Ink } from '@/components/ui/Ink'\nimport { ContextMenu, Menu } from '@/components/ui/Menu'\nimport { Tooltip } from '@/components/ui/Tooltip'\nimport { ReadinessDot, type ReadinessState } from './StatusDot'\nimport { cn } from '@/lib/utils'\n\ninterface ArmedRowProps {\n  name: string\n  /** Sublabel under the name (summary, counts, tense words). */\n  meta?: React.ReactNode\n  /** Leading 36px visual (swatch, flat tint). */\n  thumbnail?: React.ReactNode\n  /** Armed = staged for editing (G1). Accent ring; the sheet's anchor. */\n  armed?: boolean\n  /** Live = happening in the room right now (G7). */\n  live?: boolean\n  /** Present-tense accent (C5): a 3px identity-light rule marks the one\n   *  row that is \"next\", never history. */\n  accent?: string\n  readiness?: { state: ReadinessState; label: string }\n  /** Trailing chips. */\n  chips?: React.ReactNode\n  /** Menu items — used for both right-click and the hover \"…\" trigger. */\n  menu?: React.ReactNode\n  /** Extra hover-revealed trailing actions, before the play/menu cluster. */\n  trailing?: React.ReactNode\n  /** Inline rename (G8): controlled editing state (the R key flips it). */\n  editing?: boolean\n  onEditingChange?: (editing: boolean) => void\n  onRenameCommit?: (name: string) => void\n  renameDisabled?: boolean\n  onArm?: () => void\n  /** Explicit audition trigger (G3) — revealed on hover, never on it. */\n  onPlay?: () => void\n  playHint?: string\n  /** Show the reorder handle (pair with useDragReorder; ⌥↑/↓ path). */\n  reorderable?: boolean\n  /** Copy (§9) — every word reaches your copy module; English defaults. */\n  liveLabel?: string\n  menuLabel?: string\n  nameLabel?: string\n  className?: string\n}\n\nexport function ArmedRow({\n  name,\n  meta,\n  thumbnail,\n  armed = false,\n  live = false,\n  accent,\n  readiness,\n  chips,\n  menu,\n  editing = false,\n  onEditingChange,\n  onRenameCommit,\n  renameDisabled = false,\n  onArm,\n  onPlay,\n  playHint = 'Play',\n  reorderable = false,\n  trailing,\n  liveLabel = 'Live',\n  menuLabel = `Actions for ${name}`,\n  nameLabel = 'Name',\n  className,\n}: ArmedRowProps) {\n  const row = (\n    <div\n      onClick={() => {\n        if (!editing) onArm?.()\n      }}\n      className={cn(\n        'group relative flex w-full cursor-pointer items-center gap-3 rounded-sm px-3 py-2 text-start transition-colors',\n        // Density (§2.6) is ambient, never a prop — and rows are\n        // PADDING-BUILT (§2.6a): height = leading + padding, exact on\n        // the grid, no min-h centering leftovers. Base/bench: 20+16=36.\n        // Performance: 24+24=48 (the name's leading grows with it).\n        '[[data-density=performance]_&]:py-3',\n        live ? 'bg-fill-selected' : armed ? 'bg-fill-active' : 'hover:bg-fill-hover',\n        armed && 'ring-1 ring-inset ring-brass-rim',\n        accent && 'ps-4',\n        className\n      )}\n    >\n      {accent ? (\n        <span\n          aria-hidden\n          className=\"absolute inset-y-1.5 start-0 w-[3px] rounded-full\"\n          style={{ background: accent }}\n        />\n      ) : null}\n      {reorderable ? (\n        <GripVertical\n          aria-hidden\n          className=\"h-3.5 w-3.5 shrink-0 cursor-grab text-ink-faint opacity-0 transition-opacity group-hover:opacity-100\"\n        />\n      ) : null}\n\n      {thumbnail ? (\n        <div className=\"relative h-9 w-9 shrink-0 overflow-hidden rounded-sm bg-fill-active [[data-density=bench]_&]:h-7 [[data-density=bench]_&]:w-7\">\n          {thumbnail}\n        </div>\n      ) : null}\n\n      <div className=\"min-w-0 flex-1\">\n        <div className=\"flex items-center gap-2\">\n          {readiness ? <ReadinessDot state={readiness.state} label={readiness.label} /> : null}\n          {/* The name is Ink (G8): the R key focuses-and-selects; the\n              row's own click stays arm-first (readOnly until editing). */}\n          <Ink\n            kind=\"line\"\n            value={name}\n            editing={editing}\n            onEditingChange={onEditingChange}\n            readOnly={renameDisabled || !editing}\n            onSave={(next) => onRenameCommit?.(next)}\n            ariaLabel={name || nameLabel}\n            textClassName={cn(\n              'text-body font-medium',\n              '[[data-density=performance]_&]:text-body-lg [[data-density=performance]_&]:leading-6',\n              armed || live || accent ? 'text-ink' : 'text-ink-mute'\n            )}\n            className=\"max-w-full\"\n          />\n          {live ? (\n            <Chip variant=\"live\" size=\"sm\" dot=\"pulse\">\n              {liveLabel}\n            </Chip>\n          ) : null}\n          {chips}\n        </div>\n        {meta && !editing ? (\n          <div className=\"truncate text-eyebrow leading-4 tracking-normal text-ink-faint\">{meta}</div>\n        ) : null}\n      </div>\n\n      <div\n        className=\"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100\"\n        onClick={(event) => event.stopPropagation()}\n      >\n        {trailing}\n        {onPlay ? (\n          <Tooltip content={playHint}>\n            <button\n              type=\"button\"\n              aria-label={`${playHint} ${name}`}\n              onClick={onPlay}\n              className=\"flex h-7 w-7 items-center justify-center rounded-sm text-ink-faint transition-colors hover:bg-fill-active hover:text-ink\"\n            >\n              {live ? <Square className=\"h-3 w-3 fill-current\" /> : <Play className=\"h-3.5 w-3.5 fill-current\" />}\n            </button>\n          </Tooltip>\n        ) : null}\n        {menu ? (\n          <Menu\n            trigger={\n              <button\n                type=\"button\"\n                aria-label={menuLabel}\n                className=\"flex h-7 w-7 items-center justify-center rounded-sm text-ink-faint transition-colors hover:bg-fill-active hover:text-ink\"\n              >\n                <MoreHorizontal className=\"h-3.5 w-3.5\" />\n              </button>\n            }\n          >\n            {menu}\n          </Menu>\n        ) : null}\n      </div>\n    </div>\n  )\n\n  if (!menu) return row\n  return <ContextMenu content={menu}>{row}</ContextMenu>\n}\n",
      "target": "components/instruments/ArmedRow.tsx"
    }
  ],
  "meta": {
    "candlelight": {
      "category": "instrument",
      "gRules": [
        "G1",
        "G3",
        "G6",
        "G7",
        "G8",
        "G9",
        "G10"
      ],
      "useWhen": "Rows in a SplitShell/StageShell list that arm an object for editing or performing.",
      "dontUseWhen": "Multi-select tables (compose useSelection's styling contract yourself) or uniform archive rows (C5).",
      "states": [
        "resting",
        "hover (actions reveal)",
        "armed (fill-active + accent ring)",
        "live (fill-selected + chip)",
        "renaming (Ink line seat)",
        "present-tense accent rule"
      ],
      "keyboard": [
        {
          "keys": "click / ↑↓ via surface map",
          "does": "arms — staging, never execution (G1)"
        },
        {
          "keys": "R via surface map",
          "does": "flips `editing` — the Ink seat selects all"
        }
      ],
      "acceptanceTests": [
        "Clicking the row arms; it never plays (G3 — the audition trigger is explicit).",
        "Hover reveals affordances or nothing — no dead hover (G10)."
      ]
    }
  }
}