{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "follow-up",
  "title": "Follow Up",
  "description": "Follow-up prompts that stagger in after an answer, with number key shortcuts and a selected state.",
  "dependencies": [
    "cn@^0.3.0",
    "motion@^13.4.0"
  ],
  "registryDependencies": [
    "https://pastaui.com/r/pastaui-styles.json"
  ],
  "files": [
    {
      "path": "src/components/ai/follow-up.tsx",
      "content": "import { MotionConfig, motion } from 'motion/react'\nimport { useId, type ComponentProps, type KeyboardEvent } from 'react'\n\nimport { cn } from 'cn'\n\ninterface FollowUpItem {\n  id: string\n  label: string\n  disabled?: boolean\n}\n\ninterface FollowUpProps extends Omit<ComponentProps<'section'>, 'onSelect'> {\n  items: FollowUpItem[]\n  loading?: boolean\n  onSelect?: (item: FollowUpItem) => void\n  selectedId?: string\n  shortcuts?: boolean\n  title?: string\n}\n\nconst ease = [0.23, 1, 0.32, 1] as const\n\nfunction FollowUp({\n  className,\n  items,\n  loading = false,\n  onSelect,\n  selectedId,\n  shortcuts = true,\n  title = 'Follow up',\n  ...props\n}: FollowUpProps) {\n  const titleId = useId()\n\n  function onKeyDown(event: KeyboardEvent<HTMLElement>) {\n    if (!shortcuts || selectedId || loading) return\n    if (event.metaKey || event.ctrlKey || event.altKey) return\n    const item = items[Number(event.key) - 1]\n    if (item && !item.disabled) {\n      event.preventDefault()\n      onSelect?.(item)\n    }\n  }\n\n  if (items.length === 0 && !loading) return null\n\n  return (\n    <MotionConfig reducedMotion=\"user\">\n      {/* Number shortcuts are delegated from the focused chips. */}\n      {/* oxlint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n      <section\n        aria-busy={loading}\n        aria-labelledby={titleId}\n        onKeyDown={onKeyDown}\n        data-slot=\"follow-up\"\n        className={cn(\n          'font-sans text-sm font-[450] tracking-[-0.05px] text-muted-foreground',\n          className,\n        )}\n        {...props}\n      >\n        <h3 id={titleId} className=\"mb-3 card-heading\">\n          {title}\n        </h3>\n        <ul className=\"flex flex-col items-start gap-2.5\">\n          {loading\n            ? [56, 72, 44].map((width, index) => (\n                <li aria-hidden=\"true\" key={`loading-${index}`}>\n                  <span\n                    className=\"block h-9 animate-pulse rounded-full bg-foreground/6 motion-reduce:animate-none\"\n                    style={{ width: `${width * 4}px`, animationDelay: `${index * 120}ms` }}\n                  />\n                </li>\n              ))\n            : items.map((item, index) => {\n                const selected = item.id === selectedId\n                const faded = selectedId !== undefined && !selected\n                return (\n                  <motion.li\n                    animate={{ opacity: faded ? 0.45 : 1, x: 0, filter: 'blur(0px)' }}\n                    className=\"max-w-full\"\n                    initial={{ opacity: 0, x: -6, filter: 'blur(3px)' }}\n                    key={item.id}\n                    transition={{ delay: selectedId ? 0 : index * 0.07, duration: 0.3, ease }}\n                  >\n                    <button\n                      aria-keyshortcuts={shortcuts && index < 9 ? String(index + 1) : undefined}\n                      aria-pressed={selectedId !== undefined ? selected : undefined}\n                      type=\"button\"\n                      disabled={item.disabled || faded}\n                      onClick={() => onSelect?.(item)}\n                      className={cn(\n                        'group/chip flex min-h-9 max-w-full items-center gap-2 rounded-full px-3 py-1.5 text-left text-sm leading-5 font-[450] transition-[background-color,color,scale] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:scale-[0.97] disabled:pointer-events-none motion-reduce:transition-colors motion-reduce:active:scale-100',\n                        selected\n                          ? 'bg-foreground/10 text-foreground'\n                          : 'bg-foreground/6 hover:bg-foreground/10',\n                      )}\n                    >\n                      <span className=\"grid size-4 shrink-0 *:col-start-1 *:row-start-1 *:transition-[opacity,scale] *:duration-200\">\n                        <svg\n                          aria-hidden=\"true\"\n                          className={cn('size-4', selected && 'scale-75 opacity-0')}\n                          viewBox=\"0 0 24 24\"\n                          fill=\"none\"\n                          stroke=\"currentColor\"\n                          strokeWidth=\"1.5\"\n                          strokeLinecap=\"round\"\n                          strokeLinejoin=\"round\"\n                        >\n                          <path d=\"M5 5v5a2 2 0 0 0 2 2h12m-5-5 5 5-5 5\" />\n                        </svg>\n                        <svg\n                          aria-hidden=\"true\"\n                          className={cn('size-4', !selected && 'scale-75 opacity-0')}\n                          viewBox=\"0 0 24 24\"\n                          fill=\"none\"\n                          stroke=\"currentColor\"\n                          strokeWidth=\"1.5\"\n                          strokeLinecap=\"round\"\n                          strokeLinejoin=\"round\"\n                        >\n                          <path d=\"m5 12.5 4.5 4.5L19 7.5\" />\n                        </svg>\n                      </span>\n                      <span className=\"min-w-0 break-words\">{item.label}</span>\n                      {shortcuts && index < 9 && !selectedId && (\n                        <kbd className=\"ml-1 flex h-5 min-w-5 items-center justify-center rounded-md bg-foreground/6 px-1 font-sans text-[11px] leading-none text-muted-foreground\">\n                          {index + 1}\n                        </kbd>\n                      )}\n                    </button>\n                  </motion.li>\n                )\n              })}\n        </ul>\n      </section>\n    </MotionConfig>\n  )\n}\n\nexport { FollowUp }\nexport type { FollowUpItem, FollowUpProps }\n",
      "type": "registry:component",
      "target": "@components/ai/follow-up.tsx"
    }
  ],
  "type": "registry:component"
}