{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "attention-card",
  "title": "AttentionCard",
  "description": "Something that waits on the person: a mention, a question asked of them or a request still unanswered.",
  "registryDependencies": [
    "@ouro/badge",
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-env",
    "@ouro/lib-focus-handoff",
    "@ouro/lib-refs",
    "@ouro/lib-tones",
    "@ouro/lib-touch-target",
    "@ouro/lib-use-dev-messages"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/attention-card/attention-card.tsx",
      "content": "\"use client\";\n\nimport { useId, type HTMLAttributes, type JSX, type ReactNode, type Ref } from \"react\";\nimport { Badge } from \"@/registry/ouro/components/ouro/badge/badge\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { useFocusHandoff } from \"@/registry/ouro/lib/ouro/focus-handoff\";\nimport { useMergedRef } from \"@/registry/ouro/lib/ouro/refs\";\nimport { toneWarning } from \"@/registry/ouro/lib/ouro/tones\";\nimport { TouchTarget } from \"@/registry/ouro/lib/ouro/touch-target\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\n\n/** The props AttentionCard adds to the `<article>` attributes it passes through. */\nexport interface AttentionCardOwnProps {\n  /** Why it needs the person, as a short label in a badge (\"Mentioned you\", \"Asked you\"). */\n  reason: string;\n  /**\n   * The badge's color role from the theme, named after its token: `warning` for a question\n   * that waits on an answer, `secondary` for something quieter.\n   * @default \"primary\"\n   */\n  tone?:\n    | \"primary\"\n    | \"secondary\"\n    | \"destructive\"\n    | \"success\"\n    | \"warning\"\n    | (string & { 'danger is \"destructive\"; accent is \"primary\"; neutral is \"secondary\"': never })\n    | undefined;\n  /** Where it happened: the conversation, thread or document's name. */\n  title: string;\n  /** Who is asking. Their name comes before the message. */\n  from: string;\n  /** When, already formatted (\"9:41\", `<RelativeTime>`). */\n  time?: ReactNode;\n  /**\n   * What they wrote, cut to two lines.\n   *\n   * @claim \"What they wrote, cut to two\" registry/ouro/components/ouro/attention-card/attention-card.test.tsx verify:testExists(registry/ouro/components/ouro/attention-card/attention-card.test.tsx::AttentionCard > cuts a long message to two lines)\n   */\n  children?: ReactNode;\n  /** Makes the message a button that opens where it happened. */\n  onOpen?: (() => void) | undefined;\n  /** Buttons under the message, such as a quick reply or Dismiss. */\n  actions?: ReactNode;\n  /** Layout only: width, margins, grid placement (`mt-2`). Appearance classes warn in development; use `tone`. */\n  className?: string | undefined;\n  ref?: Ref<HTMLElement> | undefined;\n\n  /** Not a prop. What they wrote is the children: `<AttentionCard reason=\"Asked you\" title=\"Review\" from=\"Ana\">Can you review?</AttentionCard>`. */\n  message?: { 'Use <AttentionCard reason=\"Asked you\" title=\"Review\" from=\"Ana\">Can you review?</AttentionCard>': never };\n  /** Not a prop. What they wrote is the children: `<AttentionCard reason=\"Asked you\" title=\"Review\" from=\"Ana\">Can you review?</AttentionCard>`. */\n  text?: { 'Use <AttentionCard reason=\"Asked you\" title=\"Review\" from=\"Ana\">Can you review?</AttentionCard>': never };\n  /** Not a prop. The message opens with `onOpen`: `<AttentionCard onOpen={open}>`. */\n  onClick?: { 'Use onOpen={open}': never };\n}\n\n/** Props for {@link AttentionCard}: its own props and the `<article>` attributes it passes through. */\nexport type AttentionCardProps = Omit<HTMLAttributes<HTMLElement>, keyof AttentionCardOwnProps> & AttentionCardOwnProps;\n\nconst tones = [\"primary\", \"secondary\", \"destructive\", \"success\", \"warning\"] as const;\ntype Tone = (typeof tones)[number];\nconst quiet = \"text-[color-mix(in_oklab,var(--muted-foreground)_80%,var(--foreground))]\";\n\nconst open =\n  \"press relative box-border block w-full min-w-0 cursor-pointer rounded-ouro-md border-0 bg-transparent p-0 text-start text-inherit \" +\n  \"touch-manipulation [-webkit-tap-highlight-color:transparent] outline-ring outline-offset-2 focus-visible:outline-2 focus-visible:outline-solid \" +\n  \"pointer-fine:hover:underline pointer-fine:hover:underline-offset-4\";\n\n/**\n * Something that waits on the person: a mention, a question asked of them or a request\n * still unanswered. A badge says why, then where and when, who is asking and what they\n * wrote, with buttons to act on it. Screen readers hear the card by its reason and where\n * it happened (\"Asked you, Design review\"). With `onOpen` the message is a button that\n * opens where it happened. When an action removes the card (Dismiss, Done), focus moves on\n * to the next card, or the one before when it was the last, so a keyboard user keeps their\n * place in the list.\n *\n * Use `Message` instead for a message inside its conversation, `Alert` for a notice from\n * the app itself, and `Item` for a row in a plain list.\n *\n * @group Chat\n * @see https://ui.ouroboros.bot/docs/attention-card\n *\n * @example\n * <AttentionCard reason=\"Asked you\" tone=\"warning\" title=\"Design review\" from=\"Ana Lind\" time=\"9:41\" onOpen={open}>\n *   Can you look at the second draft before noon?\n * </AttentionCard>\n * @claim \"When an action removes the card\" registry/ouro/components/ouro/attention-card/attention-card.test.tsx verify:testExists(registry/ouro/components/ouro/attention-card/attention-card.test.tsx::AttentionCard > hands focus to the next card when its own action dismisses it)\n * @claim \"Screen readers hear the card by\" registry/ouro/components/ouro/attention-card/attention-card.test.tsx verify:testExists(registry/ouro/components/ouro/attention-card/attention-card.test.tsx::AttentionCard > is an article named by its reason and where it happened)\n */\nexport function AttentionCard(props: AttentionCardProps): JSX.Element {\n  const {\n    reason,\n    tone: toneProp = \"primary\",\n    title,\n    from,\n    time,\n    children,\n    onOpen,\n    actions,\n    className,\n    // Guard props (hint types), dropped here so they never reach the DOM.\n    message,\n    text,\n    onClick,\n    ref,\n    ...rest\n  } = props;\n  // A card its own action removes (Dismiss, Done) hands focus to the next card's first control, or the one before.\n  const merged = useMergedRef(ref, useFocusHandoff<HTMLElement>());\n  const tone: Tone = (tones as readonly string[]).includes(toneProp) ? (toneProp as Tone) : \"primary\";\n  const id = useId();\n  useAppearanceClassNameCheck(\n    \"AttentionCard\",\n    className,\n    process.env.NODE_ENV !== \"production\"\n      ? (token: string) => `remove \"${token}\"; the badge's color is tone`\n      : // Stryker disable next-line StringLiteral: production only; the check never runs there.\n        /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"AttentionCard\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          reason === undefined && [\"reason is missing, so the card does not say why it needs the person\", '<AttentionCard reason=\"Asked you\" title=\"Design review\" from=\"Ana\">'],\n          title === undefined && [\"title is missing, so the card does not say where it happened\", '<AttentionCard reason=\"Asked you\" title=\"Design review\" from=\"Ana\">'],\n          from === undefined && [\"from is missing, so the card does not say who is asking\", '<AttentionCard reason=\"Asked you\" title=\"Design review\" from=\"Ana\">'],\n          tone !== toneProp && toneWarning(\"AttentionCard\", String(toneProp), tones),\n          (message !== undefined || text !== undefined) && [\n            `${message !== undefined ? \"message\" : \"text\"} is not a prop; what they wrote is the children`,\n            '<AttentionCard reason=\"Asked you\" title=\"Review\" from=\"Ana\">Can you review?</AttentionCard>',\n          ],\n          onClick !== undefined && [\"onClick is not a prop; the message opens with onOpen\", \"<AttentionCard onOpen={open}>\"],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n\n  const body = (\n    <span data-ouro-attention-message=\"\" className=\"line-clamp-2 text-sm [overflow-wrap:anywhere]\">\n      <span className=\"font-semibold\">{from}:</span> {children}\n    </span>\n  );\n  return (\n    <article\n      {...rest}\n      ref={merged}\n      data-ouro=\"attention-card\"\n      aria-labelledby={`${id}-reason ${id}-title`}\n      className={cn(\"box-border flex min-w-0 flex-col gap-1.5 rounded-ouro-xl border border-solid border-border bg-card p-3 text-card-foreground\", className)}\n    >\n      <div className=\"flex min-w-0 items-center gap-2\">\n        <Badge id={`${id}-reason`} tone={tone} variant=\"soft\">\n          {reason}\n        </Badge>\n        <span id={`${id}-title`} className=\"min-w-0 truncate text-sm font-semibold\">\n          {title}\n        </span>\n        {time !== undefined && time !== null && <span className={cn(\"ms-auto shrink-0 text-xs\", quiet)}>{time}</span>}\n      </div>\n      {onOpen ? (\n        <button type=\"button\" data-ouro-control=\"attention-card\" data-ouro-part=\"open\" onClick={onOpen} className={open}>\n          <TouchTarget />\n          {body}\n        </button>\n      ) : (\n        body\n      )}\n      {actions !== undefined && actions !== null && <div className=\"flex flex-wrap items-center gap-2 pt-1\">{actions}</div>}\n    </article>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/attention-card/attention-card.tsx"
    }
  ],
  "docs": "Something that waits on the person: a mention, a question asked of them or a request still unanswered. Import: import { AttentionCard } from \"@/components/ouro/attention-card/attention-card\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: badge, the helpers they import in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/attention-card.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}