{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card",
  "type": "registry:ui",
  "title": "Card",
  "description": "Card is a flexible surface for grouping related content, media, and actions into one container.",
  "dependencies": [
    "@radix-ui/react-slot@^1.2.4",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/scroll-area.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/card/Card.context.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/Card.context.ts",
      "content": "'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport type { CardContextType } from './Card.types';\n\nexport const CardContext = createContext<CardContextType | undefined>(undefined);\n\nexport const useCardContext = () => {\n  const context = useContext(CardContext);\n\n  if (context === undefined) {\n    throw new Error('useCardContext must be used within a Card');\n  }\n  return context;\n};\n"
    },
    {
      "path": "src/components/card/Card.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/Card.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { CardContext } from './Card.context';\nimport type { CardProps, CardWithSubComponents } from './Card.types';\nimport { cardVariants } from './Card.variants';\nimport { CardAction } from './CardAction';\nimport { CardContent } from './CardContent';\nimport { CardDescription } from './CardDescription';\nimport { CardFooter } from './CardFooter';\nimport { CardHeader } from './CardHeader';\nimport { CardMedia } from './CardMedia';\nimport { CardTitle } from './CardTitle';\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(\n  ({ variant, className, children, ...props }, ref) => (\n    <CardContext.Provider value={{ variant }}>\n      <div\n        ref={ref}\n        data-slot=\"card\"\n        className={cn(cardVariants({ variant }), className)}\n        {...props}\n      >\n        {children}\n      </div>\n    </CardContext.Provider>\n  ),\n) as CardWithSubComponents;\n\nCard.displayName = 'Card';\n\nCard.Content = CardContent;\nCard.Footer = CardFooter;\nCard.Header = CardHeader;\nCard.Media = CardMedia;\n\n/** Header subcomponents */\nCard.Title = CardTitle;\nCard.Description = CardDescription;\nCard.Action = CardAction;\n"
    },
    {
      "path": "src/components/card/Card.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/Card.types.ts",
      "content": "import type { VariantProps } from 'class-variance-authority';\nimport type {\n  ForwardRefExoticComponent,\n  HTMLAttributes,\n  PropsWithoutRef,\n  ReactNode,\n  RefAttributes,\n} from 'react';\n\nimport type { cardVariants } from './Card.variants';\nimport type { CardAction } from './CardAction';\nimport type { CardContent } from './CardContent';\nimport type { CardDescription } from './CardDescription';\nimport type { CardFooter } from './CardFooter';\nimport type { CardHeader } from './CardHeader';\nimport type { CardMedia } from './CardMedia';\nimport type { CardTitle } from './CardTitle';\n\n/** A surface grouping related content, media, and actions. */\nexport type CardProps = HTMLAttributes<HTMLDivElement> &\n  VariantProps<typeof cardVariants> & {\n    /** Card content composed from the available Card subcomponents. */\n    children?: ReactNode;\n    /** Additional CSS classes merged with the card root. */\n    className?: string;\n  };\n\n/** The media area with a configurable aspect ratio. */\nexport type CardMediaProps = HTMLAttributes<HTMLDivElement> & {\n  /** Additional CSS classes merged with the media container. */\n  className?: string;\n  /** Media rendered inside the card, typically an image, illustration, or video. */\n  children?: ReactNode;\n  /** Aspect ratio applied to the media container. Accepts CSS ratio strings like `16/9` or numeric values. */\n  ratio?: string | number;\n};\n\n/** The content surface rendered within `Card`. */\nexport type CardContentProps = HTMLAttributes<HTMLDivElement> & {\n  /** Card body content rendered inside the scrollable content area. */\n  children?: ReactNode;\n  /** Additional CSS classes merged with the scroll container wrapping the content. */\n  className?: string;\n  /** Additional CSS classes merged with the inner content wrapper. Useful for overriding default padding. */\n  contentClassName?: string;\n};\n\n/** The header area for a title and supporting content. */\nexport type CardHeaderProps = HTMLAttributes<HTMLDivElement> & {\n  /** Header content, usually Card.Title, Card.Description, and optional Card.Action elements. */\n  children?: ReactNode;\n  /** Additional CSS classes merged with the header styling. */\n  className?: string;\n};\n\n/** The action area beneath the main content. */\nexport type CardFooterProps = HTMLAttributes<HTMLDivElement> & {\n  /** Footer content, usually action buttons or supplementary controls. */\n  children?: ReactNode;\n  /** Additional CSS classes merged with the footer styling. */\n  className?: string;\n};\n\n/** The primary title text. */\nexport type CardTitleProps = HTMLAttributes<HTMLHeadingElement> & {\n  /** Renders onto the child instead of the default `<h3>`, to set the heading level. */\n  asChild?: boolean;\n  /** Card title content. */\n  children?: ReactNode;\n  /** Additional CSS classes merged with the title styling. */\n  className?: string;\n};\n\n/** Supporting descriptive text. */\nexport type CardDescriptionProps = HTMLAttributes<HTMLParagraphElement> & {\n  /** Supporting description shown below the card title. */\n  children?: ReactNode;\n  /** Additional CSS classes merged with the description styling. */\n  className?: string;\n};\n\n/** An action styled for `Card`. */\nexport type CardActionProps = HTMLAttributes<HTMLDivElement> & {\n  /** Action content aligned with the card header, such as an icon button, badge, or tag. */\n  children?: ReactNode;\n  /** Additional CSS classes merged with the action container. */\n  className?: string;\n};\n\nexport type CardWithSubComponents = ForwardRefExoticComponent<\n  PropsWithoutRef<CardProps> & RefAttributes<HTMLDivElement>\n> & {\n  Content: typeof CardContent;\n  Footer: typeof CardFooter;\n  Header: typeof CardHeader;\n  Media: typeof CardMedia;\n  Title: typeof CardTitle;\n  Description: typeof CardDescription;\n  Action: typeof CardAction;\n};\n\nexport type CardContextType = Pick<CardProps, 'variant'>;\n"
    },
    {
      "path": "src/components/card/Card.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/Card.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nexport const cardVariants = cva(\n  cn('flex w-full flex-col overflow-clip [overflow-clip-margin:border-box]'),\n  {\n    variants: {\n      variant: {\n        bordered: 'rounded-ws-container-lg bg-ws-static-container border-ws-static-base border',\n        flat: '',\n      },\n    },\n    defaultVariants: {\n      variant: 'bordered',\n    },\n  },\n);\n\nexport const CARD_HEADER_CLASS = 'ws-card-header';\n\nexport const cardHeaderVariants = cva(cn('flex flex-col'), {\n  variants: {\n    variant: {\n      bordered: 'border-ws-static-base px-ws-11 pt-ws-9 pb-ws-8 [&:not(:last-child)]:border-b',\n      flat: 'pb-ws-9 [&:not(:first-child)]:pt-ws-9',\n    },\n  },\n  defaultVariants: {\n    variant: 'bordered',\n  },\n});\n\nexport const cardContentVariants = cva(cn('min-h-full'), {\n  variants: {\n    variant: {\n      bordered: 'p-ws-11',\n      flat: '',\n    },\n  },\n  defaultVariants: {\n    variant: 'bordered',\n  },\n});\n\nexport const cardFooterVariants = cva(cn('flex'), {\n  variants: {\n    variant: {\n      bordered:\n        'border-ws-static-base px-ws-11 py-ws-9 [&:not(:first-child)]:border-t [.ws-card-header+&]:border-t-0',\n      flat: 'pt-ws-9',\n    },\n  },\n  defaultVariants: {\n    variant: 'bordered',\n  },\n});\n\nexport const cardMediaVariants = cva(cn('overflow-hidden'), {\n  variants: {\n    variant: {\n      bordered: '-mx-px [&:first-child]:-mt-px [&:last-child]:-mb-px',\n      flat: 'rounded-ws-container-md',\n    },\n  },\n  defaultVariants: {\n    variant: 'bordered',\n  },\n});\n"
    },
    {
      "path": "src/components/card/CardAction.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/CardAction.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { CardActionProps } from './Card.types';\n\nconst CardAction = ({ className, children, ...props }: CardActionProps) => (\n  <div data-slot=\"card-action\" className={cn('flex', className)} {...props}>\n    {children}\n  </div>\n);\n\nCardAction.displayName = 'Card.Action';\n\nexport { CardAction };\n"
    },
    {
      "path": "src/components/card/CardContent.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/CardContent.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { ScrollArea } from '../scroll-area/ScrollArea';\nimport { useCardContext } from './Card.context';\nimport type { CardContentProps } from './Card.types';\nimport { cardContentVariants } from './Card.variants';\n\nconst CardContent = ({ className, contentClassName, ...props }: CardContentProps) => {\n  const { variant } = useCardContext();\n\n  return (\n    <ScrollArea data-slot=\"card-content\" className={cn('grow', className)}>\n      <div className={cn(cardContentVariants({ variant }), contentClassName)} {...props} />\n    </ScrollArea>\n  );\n};\n\nCardContent.displayName = 'Card.Content';\n\nexport { CardContent };\n"
    },
    {
      "path": "src/components/card/CardDescription.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/CardDescription.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { CardDescriptionProps } from './Card.types';\n\nconst CardDescription = ({ className, ...props }: CardDescriptionProps) => (\n  <p\n    data-slot=\"card-description\"\n    className={cn('text-ws-static-subtle typography-body-md mt-ws-5 mb-ws-2', className)}\n    {...props}\n  />\n);\n\nCardDescription.displayName = 'Card.Description';\n\nexport { CardDescription };\n"
    },
    {
      "path": "src/components/card/CardFooter.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/CardFooter.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useCardContext } from './Card.context';\nimport type { CardFooterProps } from './Card.types';\nimport { cardFooterVariants } from './Card.variants';\n\nconst CardFooter = ({ className, ...props }: CardFooterProps) => {\n  const { variant } = useCardContext();\n\n  return (\n    <div\n      data-slot=\"card-footer\"\n      className={cn(cardFooterVariants({ variant }), className)}\n      {...props}\n    />\n  );\n};\n\nCardFooter.displayName = 'Card.Footer';\n\nexport { CardFooter };\n"
    },
    {
      "path": "src/components/card/CardHeader.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/CardHeader.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useCardContext } from './Card.context';\nimport type { CardHeaderProps } from './Card.types';\nimport { CARD_HEADER_CLASS, cardHeaderVariants } from './Card.variants';\n\nconst CardHeader = ({ className, ...props }: CardHeaderProps) => {\n  const { variant } = useCardContext();\n\n  return (\n    <div\n      data-slot=\"card-header\"\n      className={cn(CARD_HEADER_CLASS, cardHeaderVariants({ variant }), className)}\n      {...props}\n    />\n  );\n};\n\nCardHeader.displayName = 'Card.Header';\n\nexport { CardHeader };\n"
    },
    {
      "path": "src/components/card/CardMedia.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/CardMedia.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useCardContext } from './Card.context';\nimport type { CardMediaProps } from './Card.types';\nimport { cardMediaVariants } from './Card.variants';\n\nconst CardMedia = ({ ratio = '16/9', className, children, style, ...props }: CardMediaProps) => {\n  const { variant } = useCardContext();\n\n  return (\n    <div\n      data-slot=\"card-media\"\n      className={cn(cardMediaVariants({ variant }), className)}\n      style={{ aspectRatio: ratio, ...style }}\n      {...props}\n    >\n      {children}\n    </div>\n  );\n};\n\nCardMedia.displayName = 'Card.Media';\n\nexport { CardMedia };\n"
    },
    {
      "path": "src/components/card/CardTitle.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/card/CardTitle.tsx",
      "content": "'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { CardTitleProps } from './Card.types';\n\nconst CardTitle = ({ asChild, className, children, ...props }: CardTitleProps) => {\n  const Comp = asChild ? Slot : 'h3';\n\n  return (\n    <Comp\n      data-slot=\"card-title\"\n      className={cn('text-ws-static-strong typography-subtitle-sm mt-ws-2', className)}\n      {...props}\n    >\n      {children}\n    </Comp>\n  );\n};\n\nCardTitle.displayName = 'Card.Title';\n\nexport { CardTitle };\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
