{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "list-item",
  "title": "List Item",
  "description": "List Item from the Get IT Done design system.",
  "dependencies": [
    "@radix-ui/react-slot@^1.5.0",
    "lucide-react@^0.379.0"
  ],
  "registryDependencies": [
    "https://zero-design.itdone.de/r/recipes.json",
    "https://zero-design.itdone.de/r/utils.json",
    "https://zero-design.itdone.de/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ui/list-item.tsx",
      "content": "'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { ChevronRight } from 'lucide-react';\nimport * as React from 'react';\n\nimport { focusRing, transitionBase } from '@/lib/recipes';\nimport { cn } from '@/lib/utils';\n\n// Figma: ListItem 10231:319727 (Lead=Icon|Avatar|Checkbox|None, Trailing=Chevron|Count|Switch|Status|None, states Default|Hover|Active|Focused|Selected|Disabled).\nexport interface ListItemProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title' | 'onClick'> {\n  title: React.ReactNode;\n  subtitle?: React.ReactNode;\n  // Icon, avatar or checkbox before the text.\n  lead?: React.ReactNode;\n  // Count, status chip or switch at the end. Do not combine an interactive trailing control with onClick.\n  trailing?: React.ReactNode;\n  // Shows a trailing chevron (navigation rows).\n  chevron?: boolean;\n  // Container-responsive row: the trailing controls sit under the title (full width, wrapping) until the nearest container is at least the `@area-2xs` container screen (420px) wide, then they move to the end of the row. The width is measured on the nearest ancestor with the `@container` class, for example `<Card container>`, not on the viewport. Without such an ancestor the controls stay under the title.\n  responsive?: boolean;\n  selected?: boolean;\n  disabled?: boolean;\n  // Makes the row a real button.\n  onClick?: React.MouseEventHandler<HTMLButtonElement>;\n  // Link mode: renders the row as an anchor. Pass `target` and `rel` as usual.\n  href?: string;\n  target?: string;\n  rel?: string;\n  // Link mode with your own link component (router Link): the single child is the link element and receives the row styles and content.\n  asChild?: boolean;\n}\n\nconst ListItem = React.forwardRef<HTMLElement, ListItemProps>(\n  ({ className, title, subtitle, lead, trailing, chevron = false, responsive = false, selected = false, disabled = false, onClick, href, asChild = false, children, ...props }, ref) => {\n    const isLink = Boolean(href) || asChild;\n    const interactive = (Boolean(onClick) || isLink) && !disabled;\n    const classes = cn(\n      'flex min-h-row w-full items-center gap-3 rounded-item px-3 py-1 text-left',\n      responsive && 'flex-wrap gap-y-2 py-2 @area-2xs:flex-nowrap @area-2xs:gap-y-0 @area-2xs:py-1',\n      ...transitionBase,\n      interactive && ['group cursor-pointer', ...focusRing, 'hover:bg-muted', 'active:bg-muted-strong'],\n      selected && 'bg-muted',\n      disabled && 'pointer-events-none opacity-disabled',\n      className,\n    );\n    const content = (\n      <>\n        {lead ? <span className=\"flex shrink-0 items-center text-icon-default\">{lead}</span> : null}\n        <span className=\"flex min-w-0 flex-1 flex-col\">\n          <span className=\"typography-ui-medium truncate text-text-default\">{title}</span>\n          {subtitle ? <span className={cn('typography-ui truncate', selected ? 'text-text-subtle-on-muted' : interactive ? 'text-text-subtle group-hover:text-text-subtle-on-muted' : 'text-text-subtle')}>{subtitle}</span> : null}\n        </span>\n        {trailing ? <span className={cn('typography-ui flex shrink-0 items-center', responsive && 'w-full flex-wrap gap-2 @area-2xs:w-auto @area-2xs:flex-nowrap @area-2xs:justify-end', selected ? 'text-text-subtle-on-muted' : interactive ? 'text-text-subtle group-hover:text-text-subtle-on-muted' : 'text-text-subtle')}>{trailing}</span> : null}\n        {chevron ? <ChevronRight className=\"h-icon-sm w-icon-sm shrink-0 text-icon-subtle\" aria-hidden=\"true\" /> : null}\n      </>\n    );\n    if (asChild && React.isValidElement(children)) {\n      return (\n        <Slot\n          ref={ref as React.Ref<HTMLElement>}\n          className={classes}\n          aria-disabled={disabled || undefined}\n          aria-current={selected ? 'true' : undefined}\n          {...(props as React.HTMLAttributes<HTMLElement>)}\n        >\n          {React.cloneElement(children as React.ReactElement<{ children?: React.ReactNode }>, undefined, content)}\n        </Slot>\n      );\n    }\n    if (href) {\n      return (\n        <a\n          ref={ref as React.Ref<HTMLAnchorElement>}\n          className={classes}\n          href={disabled ? undefined : href}\n          aria-disabled={disabled || undefined}\n          aria-current={selected ? 'true' : undefined}\n          {...(props as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n        >\n          {content}\n        </a>\n      );\n    }\n    if (onClick) {\n      return (\n        <button\n          ref={ref as React.Ref<HTMLButtonElement>}\n          type=\"button\"\n          className={classes}\n          disabled={disabled}\n          aria-current={selected ? 'true' : undefined}\n          onClick={onClick}\n          {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n        >\n          {content}\n        </button>\n      );\n    }\n    return (\n      <div\n        ref={ref as React.Ref<HTMLDivElement>}\n        className={classes}\n        aria-disabled={disabled || undefined}\n        data-selected={selected || undefined}\n        {...(props as React.HTMLAttributes<HTMLDivElement>)}\n      >\n        {content}\n      </div>\n    );\n  },\n);\nListItem.displayName = 'ListItem';\n\nexport { ListItem };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}