{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card",
  "title": "Card",
  "description": "A surface that groups related content: a header with a title, a description and an action, the content, a picture to the edges and a tinted footer. A card that leads somewhere stretches its title’s link over the whole of it, and its border darkens on hover.",
  "dependencies": [
    "@ui-sdk/react",
    "@ui-sdk/core"
  ],
  "registryDependencies": [
    "https://kinoui.com/r/panel.json",
    "https://kinoui.com/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/components/kino/card.tsx",
      "content": "'use client'\n\nimport { panelDescriptionClassName, panelTitleClassName } from '@/registry/lib/panel'\nimport { mergeProps, type PartProps, renderElement } from '@ui-sdk/react/primitive'\nimport type { ComponentProps } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/*\n * A surface on the page that groups related content. It has the edge of the\n * Checkbox and Radio cards and the Accordion's card, the corner of every\n * surface, and the Dialog's title and description. Its parts keep the sides'\n * padding, so a `CardSection` runs to the edges.\n *\n * A card that leads somewhere puts a `CardLink` in its title: the link's hit\n * area stretches over the whole card, the card's border darkens on hover as a\n * choice card's does, and it takes the controls' ring while the link has\n * focus. The link's name stays the title, never the whole card's text.\n */\n\nfunction Card({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<'div'>, 'className'> & { className?: string }) {\n  return renderElement(\n    'div',\n    mergeProps(\n      {\n        'data-slot': 'card',\n        className: cn(\n          'group/card bg-card text-card-foreground relative flex min-w-0 flex-col gap-(--surface-gap) rounded-(--surface-radius) border py-(--surface-padding) text-sm shadow-xs',\n          // A footer, and a section at either end, reach the card's edge.\n          'has-[>[data-slot=card-footer]:last-child]:pb-0 has-[>[data-slot=card-section]:first-child]:pt-0 has-[>[data-slot=card-section]:last-child]:pb-0',\n          className,\n        ),\n      },\n      props,\n    ),\n    render,\n  )\n}\n\n/** The title, the description and an action. With a `CardAction`, the action takes the end of the first row. */\nfunction CardHeader({ className, ...props }: ComponentProps<'div'>) {\n  return (\n    <div\n      data-slot='card-header'\n      className={cn(\n        'grid auto-rows-min grid-cols-[minmax(0,1fr)] items-start gap-x-(--surface-gap) gap-y-1.5 px-(--surface-padding) has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto] [.border-b]:pb-(--surface-padding)',\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/** An `<h3>`, as a card usually sits under a section's `<h2>`; `render` gives it the page's level. */\nfunction CardTitle({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<'h3'>, 'className'> & { className?: string }) {\n  return renderElement(\n    'h3',\n    mergeProps(\n      {\n        'data-slot': 'card-title',\n        className: cn(panelTitleClassName, className),\n      },\n      props,\n    ),\n    render,\n  )\n}\n\nfunction CardDescription({ className, ...props }: ComponentProps<'div'>) {\n  return (\n    <div\n      data-slot='card-description'\n      className={cn(panelDescriptionClassName, className)}\n      {...props}\n    />\n  )\n}\n\n/**\n * Its controls sit above a `CardLink`'s stretched area and still take the\n * pointer; the rest of it, such as a status badge, still leads to the link.\n */\nfunction CardAction({ className, ...props }: ComponentProps<'div'>) {\n  return (\n    <div\n      data-slot='card-action'\n      className={cn(\n        'relative z-1 col-start-2 group-has-data-[slot=card-link]/card:pointer-events-none group-has-data-[slot=card-link]/card:[&_:is(a,button,input,select,textarea,[tabindex])]:pointer-events-auto row-span-2 row-start-1 flex items-center gap-1 self-start justify-self-end',\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction CardContent({ className, ...props }: ComponentProps<'div'>) {\n  return (\n    <div\n      data-slot='card-content'\n      className={cn('min-w-0 px-(--surface-padding)', className)}\n      {...props}\n    />\n  )\n}\n\n/**\n * What runs to the card's edges: a picture, a list of rows, a table. First or\n * last, it also takes the card's corner. Give a picture its shape with an\n * Aspect ratio inside it, or a class such as `aspect-video`; one inside fills it.\n */\nfunction CardSection({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<'div'>, 'className'> & { className?: string }) {\n  return renderElement(\n    'div',\n    mergeProps(\n      {\n        'data-slot': 'card-section',\n        className: cn(\n          // Rows meet a header's border, with no gap. `min-h-0` lets an `aspect-*` hold a taller picture to its ratio. Inside the border, its corner is the card's less the border's width.\n          'relative min-h-0 min-w-0 overflow-clip [[data-slot=card-header].border-b+&]:-mt-(--surface-gap) first:rounded-t-[calc(var(--surface-radius)-1px)] last:rounded-b-[calc(var(--surface-radius)-1px)] [&>img,&>video]:size-full [&>img,&>video]:object-cover',\n          className,\n        ),\n      },\n      props,\n    ),\n    render,\n  )\n}\n\n/**\n * Tinted, under a border, as the Dialog's footer is. Last in the card, it\n * reaches the bottom edge, and it meets a section above it. In a linked card,\n * its controls sit above the link's stretched area, as a `CardAction`'s do.\n */\nfunction CardFooter({ className, ...props }: ComponentProps<'div'>) {\n  return (\n    <div\n      data-slot='card-footer'\n      className={cn(\n        'bg-muted/50 relative z-1 group-has-data-[slot=card-link]/card:pointer-events-none group-has-data-[slot=card-link]/card:[&_:is(a,button,input,select,textarea,[tabindex])]:pointer-events-auto flex [[data-slot=card-section]+&]:-mt-(--surface-gap) min-w-0 items-center gap-2 border-t p-(--surface-padding) last:rounded-b-[calc(var(--surface-radius)-1px)]',\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/**\n * The link a card leads to, around its title's text. Its hit area covers the\n * whole card; a `CardAction` and a `CardFooter` sit above it.\n */\nfunction CardLink({\n  className,\n  render,\n  ...props\n}: Omit<PartProps<'a'>, 'className'> & { className?: string }) {\n  return renderElement(\n    'a',\n    mergeProps(\n      {\n        'data-slot': 'card-link',\n        className: cn(\n          // Its hit area lies over the card's border box, and draws the card's hover\n          // border and focus ring on it, on `press` as the choice cards do.\n          'after:absolute after:-inset-px after:z-1 after:rounded-(--surface-radius) after:border after:border-transparent after:transition-[border-color,box-shadow] after:duration-(--motion-press-duration) after:ease-(--motion-press-fade-easing) hover:after:border-muted-foreground/50 focus-visible:outline-hidden focus-visible:after:ring-3 focus-visible:after:ring-ring/50',\n          className,\n        ),\n      },\n      props,\n    ),\n    render,\n  )\n}\n\nexport {\n  Card,\n  CardAction,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardLink,\n  CardSection,\n  CardTitle,\n}\n",
      "type": "registry:component",
      "target": "@components/kino/card.tsx"
    }
  ],
  "type": "registry:component"
}