{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "profile-card",
  "title": "Profile Card",
  "description": "Expanded identity panel for a sidebar: avatar, name, subtitle, meta items and actions.",
  "dependencies": [
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/components/profile-card.tsx",
      "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* ---------------------------------------------------------------------------\n   Profile card — the expanded identity panel for a sidebar: a square avatar\n   tile, a name that can carry a verification mark, a role line, a short list of\n   facts, and the actions that belong to whoever is named. Drops into a\n   SidebarFooter or a SidebarGroup.\n\n   Why this exists next to `SidebarUser`: that one is a *row*. It has one line\n   for the name, one for secondary text, a trailing affordance, and it has to\n   survive collapsing to a 36px rail — so anything beyond those two lines has to\n   hide behind a menu. This is the same identity with room for the facts (plan,\n   region, account number) and for the actions themselves. It does not collapse;\n   a rail has no room for it, and a sidebar shows one or the other.\n\n   The tile is square, and that is the visible difference. A circle reads as\n   \"one person in a list\"; a squircle tile reads as \"the subject of this panel\".\n\n   Compound rather than a props bag because every slot is caller content — a\n   verification glyph, one lucide icon per fact, whatever a Button is in the\n   host app.\n\n     <ProfileCard>\n       <ProfileCardAvatar>OW</ProfileCardAvatar>\n       <ProfileCardName badge={<BadgeCheck />} badgeSrLabel=\"Verified\">\n         Workspace owner\n       </ProfileCardName>\n       <ProfileCardSubtitle>Account 0172</ProfileCardSubtitle>\n       <ProfileCardMeta>\n         <ProfileCardMetaItem icon={<MapPin />}>North region</ProfileCardMetaItem>\n         <ProfileCardMetaItem icon={<Clock />}>Joined this quarter</ProfileCardMetaItem>\n       </ProfileCardMeta>\n       <ProfileCardActions>\n         <Button size=\"sm\">Manage access</Button>\n         <Button size=\"sm\" variant=\"ghost\">View activity</Button>\n       </ProfileCardActions>\n     </ProfileCard>\n--------------------------------------------------------------------------- */\n\n/* `size` moves the box, never the type. A sidebar column leaves roughly 208px\n   of usable width, and dropping the name below `text-sm` to buy a few pixels of\n   height spends legibility where there is none spare — so `sm` buys a smaller\n   tile and tighter padding, and the type scale holds across both.\n\n   The base rhythm is the *tightest* pair, name-to-subtitle, because those two\n   are one unit and the root cannot know which parts a caller passed. Blocks\n   that need more air than that add it themselves, below. */\nconst profileCardVariants = cva(\n  /* Hairline plus a surface shift and no shadow — the separation device the\n     rest of the sidebar chrome already uses, so a panel here does not read as\n     floating above rows that don't. */\n  \"group/profile-card flex w-full min-w-0 flex-col border border-sidebar-border bg-sidebar-accent/40 text-sidebar-foreground\",\n  {\n    variants: {\n      size: {\n        sm: \"gap-1 rounded-md p-2.5\",\n        default: \"gap-1.5 rounded-lg p-3\",\n      },\n    },\n    defaultVariants: { size: \"default\" },\n  },\n)\n\ntype ProfileCardSize = NonNullable<VariantProps<typeof profileCardVariants>[\"size\"]>\n\ntype ProfileCardProps = React.ComponentProps<\"div\"> &\n  VariantProps<typeof profileCardVariants>\n\nfunction ProfileCard({ className, size = \"default\", ...props }: ProfileCardProps) {\n  return (\n    <div\n      data-slot=\"profile-card\"\n      /* Emitted so the parts below can scale off one decision. The root's own\n         classes come from the cva — never read back off this attribute. */\n      data-size={size}\n      className={cn(profileCardVariants({ size }), className)}\n      {...props}\n    />\n  )\n}\n\n/**\n * The square tile slot. Takes initials, an icon, or a bare `<img>`.\n *\n * The radius sits near 0.3 × edge — the ratio every fixed square box in the\n * system uses — and that is only safe because the edge is fixed. The same value\n * on a container that grows would pass half the edge and collapse the shape.\n *\n * `overflow-hidden` is what clips a photo to those corners; sizing the image\n * here means a caller can drop an `<img>` in without remembering object-cover.\n */\nfunction ProfileCardAvatar({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"profile-card-avatar\"\n      className={cn(\n        \"flex size-12 shrink-0 items-center justify-center overflow-hidden\",\n        \"rounded-lg bg-secondary text-sm font-medium text-muted-foreground select-none\",\n        \"[&>img]:size-full [&>img]:object-cover [&_svg]:size-6 [&_svg]:shrink-0\",\n        \"group-data-[size=sm]/profile-card:size-10\",\n        \"group-data-[size=sm]/profile-card:rounded-md\",\n        \"group-data-[size=sm]/profile-card:text-xs\",\n        \"group-data-[size=sm]/profile-card:[&_svg]:size-5\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\ntype ProfileCardNameProps = React.ComponentProps<\"div\"> & {\n  /** Mark shown after the name — a verification glyph, a tier icon. */\n  badge?: React.ReactNode\n  /**\n   * Accessible name for `badge`. A bare glyph is silent to a screen reader, and\n   * \"verified\" is the one thing this line cannot say any other way.\n   */\n  badgeSrLabel?: string\n}\n\nfunction ProfileCardName({\n  className,\n  children,\n  badge,\n  badgeSrLabel,\n  ...props\n}: ProfileCardNameProps) {\n  return (\n    <div\n      data-slot=\"profile-card-name\"\n      className={cn(\"flex min-w-0 items-center gap-1.5\", className)}\n      {...props}\n    >\n      <span className=\"truncate text-sm font-semibold\">{children}</span>\n      {badge != null ? (\n        <span\n          data-slot=\"profile-card-badge\"\n          /* `role=\"img\"` is what makes the label reachable — aria-label on a\n             plain span is ignored by most screen readers. With no label the mark\n             is hidden instead, which is the honest reading of a glyph nobody\n             named: decoration.\n           *\n           * Untinted on purpose. Whether the mark means verified, staff or paid\n           * is the caller's claim to make, and so is its colour. */\n          role={badgeSrLabel ? \"img\" : undefined}\n          aria-label={badgeSrLabel}\n          aria-hidden={badgeSrLabel ? undefined : true}\n          className=\"flex shrink-0 items-center [&_svg]:size-3.5 [&_svg]:shrink-0\"\n        >\n          {badge}\n        </span>\n      ) : null}\n    </div>\n  )\n}\n\n/* The role line. Sits on the root's base gap — this and the name are the pair\n   that rhythm was set for. */\nfunction ProfileCardSubtitle({ className, ...props }: React.ComponentProps<\"p\">) {\n  return (\n    <p\n      data-slot=\"profile-card-subtitle\"\n      className={cn(\"truncate text-xs text-sidebar-foreground/70\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ProfileCardMeta({ className, ...props }: React.ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"profile-card-meta\"\n      /* Preflight strips list-style, which drops list semantics in Safari —\n         restored explicitly, same as the activity feed and the rank list. */\n      role=\"list\"\n      className={cn(\n        \"mt-1.5 flex min-w-0 flex-col gap-1.5\",\n        \"group-data-[size=sm]/profile-card:mt-1\",\n        \"group-data-[size=sm]/profile-card:gap-1\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\ntype ProfileCardMetaItemProps = React.ComponentProps<\"li\"> & {\n  /** Leading mark for the row. */\n  icon?: React.ReactNode\n}\n\n/* Type styles live on the row rather than on the list, so a row composed into\n   some other container still reads as a meta row. */\nfunction ProfileCardMetaItem({\n  className,\n  children,\n  icon,\n  ...props\n}: ProfileCardMetaItemProps) {\n  return (\n    <li\n      data-slot=\"profile-card-meta-item\"\n      className={cn(\n        \"flex min-w-0 items-center gap-2 text-xs text-sidebar-foreground/70\",\n        className,\n      )}\n      {...props}\n    >\n      {icon != null ? (\n        <span\n          /* aria-hidden: the text beside it carries the meaning, and an icon\n             announced here would only prefix the fact with its own category. */\n          aria-hidden=\"true\"\n          className=\"flex shrink-0 items-center [&_svg]:size-3.5 [&_svg]:shrink-0\"\n        >\n          {icon}\n        </span>\n      ) : null}\n      <span className=\"truncate\">{children}</span>\n    </li>\n  )\n}\n\n/* Stacked full width rather than side by side. Two buttons on one line at\n   sidebar width truncate their own labels, and the second action here is\n   normally the quieter one — a stack keeps that rank legible. `*:w-full`\n   reaches the caller's Buttons, which are inline-flex and would otherwise\n   shrink to their text. */\nfunction ProfileCardActions({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"profile-card-actions\"\n      className={cn(\n        \"mt-2 flex flex-col gap-2 *:w-full\",\n        \"group-data-[size=sm]/profile-card:mt-1.5\",\n        \"group-data-[size=sm]/profile-card:gap-1.5\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  ProfileCard,\n  ProfileCardActions,\n  ProfileCardAvatar,\n  ProfileCardMeta,\n  ProfileCardMetaItem,\n  ProfileCardName,\n  ProfileCardSubtitle,\n  profileCardVariants,\n}\nexport type {\n  ProfileCardMetaItemProps,\n  ProfileCardNameProps,\n  ProfileCardProps,\n  ProfileCardSize,\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}