{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "prompt-list",
  "type": "registry:ui",
  "title": "Prompt List",
  "description": "Starter prompts to pick from, with the apps each one uses.",
  "categories": [
    "ai-&-chat"
  ],
  "dependencies": [
    "@hugeicons/core-free-icons@4.4.0",
    "@hugeicons/react@1.1.10"
  ],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json",
    "https://sprout.tulipfarm.ai/r/brand-icon.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/prompt-list.tsx",
      "type": "registry:ui",
      "target": "components/ui/prompt-list.tsx",
      "content": "'use client';\n\nimport { useId, type ComponentProps, type CSSProperties, type ReactNode } from 'react';\nimport { ArrowRightIcon } from '@/lib/sprout/icons/arrow-right-icon';\nimport { cn } from '@/lib/sprout/classes';\nimport { BrandStack, type BrandStackItem } from '@/components/ui/brand-icon';\n\nexport interface PromptListItem {\n  id: string;\n  label: string;\n  icon: ReactNode;\n  brands?: readonly BrandStackItem[] | undefined;\n}\n\nexport interface PromptListProps extends Omit<ComponentProps<'section'>, 'title' | 'children' | 'onSelect'> {\n  title: string;\n  showTitle?: boolean | undefined;\n  items: readonly PromptListItem[];\n  onSelect: (id: string) => void;\n  disabled?: boolean | undefined;\n}\n\nexport function PromptList({\n  title,\n  showTitle = true,\n  items,\n  onSelect,\n  disabled = false,\n  className,\n  ...props\n}: PromptListProps) {\n  const heading = useId();\n  return (\n    <section\n      data-slot=\"prompt-list\"\n      data-disabled={disabled || undefined}\n      {...props}\n      aria-labelledby={showTitle ? heading : undefined}\n      aria-label={showTitle ? undefined : title}\n      className={cn('sprout-prompt-list', className)}\n    >\n      {showTitle && (\n        <h3 id={heading} className=\"sprout-prompt-list-title\">\n          {title}\n        </h3>\n      )}\n      <ul className=\"sprout-prompt-list-items\">\n        {items.map((item, index) => (\n          <li\n            key={item.id}\n            data-slot=\"prompt-list-item\"\n            className=\"sprout-prompt-list-item\"\n            style={{ '--sprout-prompt-index': index } as CSSProperties}\n          >\n            <span aria-hidden=\"true\" className=\"sprout-prompt-list-icon\">\n              {item.icon}\n            </span>\n            <button\n              type=\"button\"\n              disabled={disabled}\n              title={item.label}\n              onClick={() => onSelect(item.id)}\n              className=\"sprout-prompt-list-button\"\n            >\n              {item.label}\n            </button>\n            {!!item.brands?.length && <BrandStack brands={item.brands} className=\"sprout-prompt-list-brands\" />}\n            <ArrowRightIcon aria-hidden=\"true\" className=\"sprout-prompt-list-arrow\" />\n          </li>\n        ))}\n      </ul>\n    </section>\n  );\n}\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/arrow-right-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/arrow-right-icon.tsx",
      "content": "import { ArrowRight02Icon as glyph } from '@hugeicons/core-free-icons';\nimport { createIcon } from '@/lib/sprout/icons/create-icon';\n\nexport const ArrowRightIcon = /* @__PURE__ */ createIcon(glyph, 'ArrowRightIcon');\n"
    },
    {
      "path": "registry/sprout/lib/sprout/icons/create-icon.tsx",
      "type": "registry:lib",
      "target": "lib/sprout/icons/create-icon.tsx",
      "content": "import { HugeiconsIcon, type IconSvgElement } from '@hugeicons/react';\nimport type { ReactElement, Ref, SVGProps } from 'react';\n\nexport const iconSizes = {\n  xs: 12,\n  sm: 14,\n  md: 16,\n  lg: 18,\n  xl: 20,\n  '2xl': 24,\n} as const;\n\nexport type IconSize = keyof typeof iconSizes;\n\nexport const iconStrokeWidth = 1.5;\n\nexport type IconProps = Omit<SVGProps<SVGSVGElement>, 'ref'> & {\n  size?: IconSize | number;\n  ref?: Ref<SVGSVGElement>;\n};\n\nexport type IconComponent = (props: IconProps) => ReactElement;\n\nexport function createIcon(glyph: IconSvgElement, name: string): IconComponent {\n  const Icon = ({ size = '2xl', strokeWidth = iconStrokeWidth, ...props }: IconProps) => (\n    <HugeiconsIcon\n      icon={glyph}\n      size={typeof size === 'number' ? size : iconSizes[size]}\n      strokeWidth={Number(strokeWidth)}\n      {...props}\n    />\n  );\n  Icon.displayName = name;\n  return Icon;\n}\n"
    }
  ],
  "css": {
    "@layer components": {
      ".sprout-prompt-list": {
        "width": "100%",
        "min-width": "0",
        "font-family": "var(--sprout-font)",
        "color": "var(--sprout-text)"
      },
      ".sprout-prompt-list-title": {
        "font-size": "var(--sprout-text-xs)",
        "color": "var(--sprout-muted)",
        "margin": "0",
        "padding": "0 12px 6px",
        "font-weight": "500",
        "line-height": "1rem"
      },
      ".sprout-prompt-list-items": {
        "flex-direction": "column",
        "margin": "0",
        "padding": "0",
        "list-style": "none",
        "display": "flex"
      },
      ".sprout-prompt-list-item": {
        "--sprout-brand-ring": "var(--sprout-canvas)",
        "border-radius": "var(--sprout-radius-panel)",
        "min-width": "0",
        "min-height": "32px",
        "font-size": "var(--sprout-text-sm)",
        "outline-offset": "0",
        "outline": "0 solid #0000",
        "align-items": "center",
        "gap": "12px",
        "padding": "0 12px",
        "line-height": "1.25rem",
        "display": "flex",
        "position": "relative"
      },
      "@media (pointer: coarse)": {
        ".sprout-prompt-list-item": {
          "min-height": "44px"
        }
      },
      "@media (hover: hover)": {
        ".sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):hover": {
          "--sprout-brand-ring": "var(--sprout-hover)",
          "background": "var(--sprout-hover)"
        }
      },
      ".sprout-prompt-list-item:has(.sprout-prompt-list-button:focus-visible)": {
        "--sprout-brand-ring": "var(--sprout-hover)",
        "background": "var(--sprout-hover)",
        "outline": "var(--sprout-focus-width) solid var(--sprout-focus-ring)"
      },
      ".sprout-prompt-list-item:has(.sprout-prompt-list-button:disabled)": {
        "opacity": ".5"
      },
      ".sprout-prompt-list-icon": {
        "width": "20px",
        "height": "20px",
        "color": "color-mix(in oklab, var(--sprout-text) 72%, var(--sprout-muted))",
        "flex-shrink": "0",
        "place-items": "center",
        "display": "grid"
      },
      ".sprout-prompt-list-icon svg": {
        "width": "16px",
        "height": "16px"
      },
      ".sprout-prompt-list-button": {
        "min-width": "0",
        "font": "inherit",
        "color": "inherit",
        "text-align": "start",
        "white-space": "nowrap",
        "text-overflow": "ellipsis",
        "cursor": "pointer",
        "-webkit-tap-highlight-color": "transparent",
        "background": "none",
        "border": "0",
        "outline": "none",
        "margin": "0",
        "padding": "0",
        "overflow": "hidden"
      },
      ".sprout-prompt-list-button:after": {
        "content": "\"\"",
        "border-radius": "inherit",
        "position": "absolute",
        "inset": "0"
      },
      ".sprout-prompt-list-button:disabled": {
        "cursor": "not-allowed"
      },
      ".sprout-prompt-list-brands": {
        "z-index": "1",
        "position": "relative"
      },
      ".sprout-prompt-list-arrow": {
        "width": "14px",
        "height": "14px",
        "color": "var(--sprout-muted)",
        "flex-shrink": "0",
        "margin-inline-start": "auto"
      },
      ".sprout-prompt-list-item:dir(rtl) .sprout-prompt-list-arrow": {
        "transform": "scaleX(-1)"
      },
      ".sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(:hover, :focus-within) :is(.sprout-prompt-list-icon, .sprout-prompt-list-arrow)": {
        "color": "var(--sprout-text)"
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-prompt-list-item": {
          "animation": "sprout-prompt-rise var(--sprout-motion-normal) var(--sprout-motion-ease) both",
          "animation-delay": "calc(var(--sprout-prompt-index, 0) * 40ms)",
          "transition": "background-color var(--sprout-motion-fast) var(--sprout-motion-ease)"
        },
        ".sprout-prompt-list-icon, .sprout-prompt-list-arrow": {
          "transition": "transform var(--sprout-motion-fast) var(--sprout-motion-ease),\n        color var(--sprout-motion-fast) var(--sprout-motion-ease)"
        },
        ".sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(:hover, :focus-within) .sprout-prompt-list-icon": {
          "transform": "scale(1.08)"
        },
        ".sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(:hover, :focus-within) .sprout-prompt-list-arrow:not(:dir(rtl))": {
          "transform": "translateX(2px)"
        }
      },
      "@keyframes sprout-prompt-rise": {
        "from": {
          "opacity": "0",
          "transform": "translateY(4px)"
        }
      },
      "@media (forced-colors: active)": {
        ".sprout-prompt-list-item:has(.sprout-prompt-list-button:focus-visible)": {
          "outline-color": "highlight"
        }
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/prompt-list/",
  "meta": {
    "source": "packages/sprout/src/components/prompt-list.tsx"
  }
}
