{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "public-profile",
  "title": "Public Profile",
  "description": "Identity, links, follower counts, pinned work, and recent activity.",
  "dependencies": [
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://uaiblocks.dev/r/uai-theme.json",
    "https://uaiblocks.dev/r/activity-timeline.json",
    "https://uaiblocks.dev/r/author-card.json",
    "https://uaiblocks.dev/r/uai-utils.json"
  ],
  "files": [
    {
      "path": "src/registry/uai/blocks/public-profile.tsx",
      "content": "\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { type ComponentProps, createContext, useContext, useId } from \"react\";\nimport {\n  ActivityTimeline,\n  type ActivityTimelineVariant,\n} from \"@/components/ui/uai/activity-timeline\";\nimport {\n  AuthorCard,\n  type AuthorCardProps,\n  type AuthorCardVariant,\n} from \"@/components/ui/uai/author-card\";\nimport { cn } from \"@/lib/uai-utils\";\n\nexport const PUBLIC_PROFILE_VARIANTS = [\"sidebar\", \"banner\", \"compact\"] as const;\nexport type PublicProfileVariant = (typeof PUBLIC_PROFILE_VARIANTS)[number];\nexport type PublicProfileProps = ComponentProps<\"div\"> & { variant?: PublicProfileVariant };\n\nconst Context = createContext<PublicProfileVariant | null>(null);\nfunction useVariant(part: string) {\n  const variant = useContext(Context);\n  if (!variant) throw new Error(`${part} must be used within PublicProfile`);\n  return variant;\n}\nconst SectionContext = createContext<string | null>(null);\n\nconst cardVariants: Record<PublicProfileVariant, AuthorCardVariant> = {\n  sidebar: \"card\",\n  banner: \"inline\",\n  compact: \"compact\",\n};\nconst timelineVariants: Record<PublicProfileVariant, ActivityTimelineVariant> = {\n  sidebar: \"rail\",\n  banner: \"rail\",\n  compact: \"compact\",\n};\n\nconst layoutVariants = cva(\"grid min-w-0 items-start\", {\n  variants: {\n    variant: {\n      sidebar: \"gap-5 @min-[720px]:grid-cols-[280px_minmax(0,1fr)] @min-[720px]:gap-x-7\",\n      banner: \"gap-5\",\n      compact: \"gap-3 @min-[560px]:grid-cols-[220px_minmax(0,1fr)]\",\n    },\n  },\n});\n\n/** A public profile: identity, links, follower counts, work, and recent activity. */\nexport function PublicProfile({\n  variant = \"sidebar\",\n  children,\n  className,\n  ...props\n}: PublicProfileProps) {\n  return (\n    <Context.Provider value={variant}>\n      <div\n        data-slot=\"public-profile\"\n        data-variant={variant}\n        className={cn(\n          \"@container box-border min-w-0 text-[13px]/[18px] text-foreground\",\n          className,\n        )}\n        {...props}\n      >\n        <div className={layoutVariants({ variant })}>{children}</div>\n      </div>\n    </Context.Provider>\n  );\n}\n\n/** Identity and counts. A column beside the main content, or a banner above it. */\nexport function PublicProfileAside({ className, ...props }: ComponentProps<\"div\">) {\n  const variant = useVariant(\"PublicProfileAside\");\n  return (\n    <div\n      data-slot=\"public-profile-aside\"\n      className={cn(\n        \"grid min-w-0 rounded-[14px] border-0\",\n        variant === \"compact\" ? \"gap-2 p-0\" : \"gap-3\",\n        variant === \"sidebar\" && \"p-0 @min-[720px]:sticky @min-[720px]:top-4\",\n        variant === \"banner\" &&\n          \"bg-[linear-gradient(180deg,color-mix(in_oklab,var(--primary)_14%,var(--muted))_0_56px,var(--card)_56px)] p-[clamp(16px,4cqi,28px)] @min-[720px]:grid-cols-[minmax(0,1fr)_auto] @min-[720px]:items-end\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** Identity card. Compose Author Card parts, links, and the follow button inside it. */\nexport function PublicProfileIdentity(props: Omit<AuthorCardProps, \"variant\">) {\n  const variant = useVariant(\"PublicProfileIdentity\");\n  return (\n    <AuthorCard data-slot=\"public-profile-identity\" {...props} variant={cardVariants[variant]} />\n  );\n}\n\n/** Follower, following, and post counts as a description list. */\nexport function PublicProfileStats({ className, ...props }: ComponentProps<\"dl\">) {\n  const variant = useVariant(\"PublicProfileStats\");\n  return (\n    <dl\n      data-slot=\"public-profile-stats\"\n      className={cn(\n        \"m-0 flex flex-wrap\",\n        variant === \"compact\" ? \"gap-3\" : \"gap-5\",\n        variant === \"banner\" ? \"p-0\" : \"px-1 py-0\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** One count. The label comes first in the source so it is read before the value. */\nexport function PublicProfileStat({\n  label,\n  className,\n  children,\n  ...props\n}: ComponentProps<\"div\"> & { label: string }) {\n  const variant = useVariant(\"PublicProfileStat\");\n  return (\n    <div\n      data-slot=\"public-profile-stat\"\n      className={cn(\"flex min-w-0 flex-col-reverse\", className)}\n      {...props}\n    >\n      <dt className=\"text-[12px] text-subtle-foreground\">{label}</dt>\n      <dd\n        className={cn(\n          \"m-0 font-semibold tracking-[-0.01em] tabular-nums\",\n          variant === \"compact\" ? \"text-[14px]/5\" : \"text-[16px]/[22px]\",\n        )}\n      >\n        {children}\n      </dd>\n    </div>\n  );\n}\n\nexport function PublicProfileMain({ className, ...props }: ComponentProps<\"div\">) {\n  const variant = useVariant(\"PublicProfileMain\");\n  return (\n    <div\n      data-slot=\"public-profile-main\"\n      className={cn(\n        \"grid min-w-0 content-start\",\n        variant === \"compact\" ? \"gap-2\" : \"gap-3\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function PublicProfileSection({ className, ...props }: ComponentProps<\"section\">) {\n  const variant = useVariant(\"PublicProfileSection\");\n  const id = useId();\n  const compact = variant === \"compact\";\n  return (\n    <SectionContext.Provider value={id}>\n      <section\n        aria-labelledby={id}\n        data-slot=\"public-profile-section\"\n        className={cn(\n          \"grid min-w-0 bg-card\",\n          compact ? \"gap-2 rounded-xl p-3\" : \"gap-3 rounded-[14px] p-4\",\n          className,\n        )}\n        {...props}\n      />\n    </SectionContext.Provider>\n  );\n}\n\nexport function PublicProfileSectionTitle({ className, ...props }: ComponentProps<\"h2\">) {\n  const id = useContext(SectionContext);\n  if (!id) throw new Error(\"PublicProfileSectionTitle must be used within PublicProfileSection\");\n  return (\n    <h2\n      data-slot=\"public-profile-section-title\"\n      className={cn(\"m-0 text-[13px]/[18px] font-medium\", className)}\n      {...props}\n      id={id}\n    />\n  );\n}\n\n/** Pinned work as a grid of linked tiles. */\nexport function PublicProfileWork({ className, ...props }: ComponentProps<\"ul\">) {\n  const variant = useVariant(\"PublicProfileWork\");\n  return (\n    <ul\n      data-slot=\"public-profile-work\"\n      className={cn(\n        \"m-0 grid list-none gap-2 p-0\",\n        variant === \"compact\"\n          ? \"grid-cols-[repeat(auto-fill,minmax(min(100%,200px),1fr))]\"\n          : \"grid-cols-[repeat(auto-fill,minmax(min(100%,220px),1fr))]\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function PublicProfileWorkItem({ className, children, ...props }: ComponentProps<\"a\">) {\n  const variant = useVariant(\"PublicProfileWorkItem\");\n  return (\n    <li className=\"grid min-w-0\">\n      <a\n        data-slot=\"public-profile-work-item\"\n        className={cn(\n          \"grid min-w-0 content-start gap-1 rounded-[10px] bg-secondary text-foreground no-underline\",\n          \"transition-[background-color,scale] duration-[120ms,140ms] ease-[ease-out,cubic-bezier(0.23,1,0.32,1)] hover:bg-[color-mix(in_oklab,var(--secondary)_88%,var(--foreground))] focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring active:scale-[0.98] motion-reduce:transition-none motion-reduce:active:scale-100\",\n          variant === \"compact\" ? \"p-2.5\" : \"p-3\",\n          className,\n        )}\n        {...props}\n      >\n        {children}\n      </a>\n    </li>\n  );\n}\n\nexport function PublicProfileWorkTitle({ className, ...props }: ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"public-profile-work-title\"\n      className={cn(\"font-medium wrap-anywhere\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function PublicProfileWorkDescription({ className, ...props }: ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"public-profile-work-description\"\n      className={cn(\"text-[12.5px] text-pretty text-muted-foreground\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function PublicProfileWorkMeta({ className, ...props }: ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"public-profile-work-meta\"\n      className={cn(\n        \"flex flex-wrap gap-x-2.5 gap-y-0 pt-1 text-[12px] text-subtle-foreground tabular-nums\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** Recent activity. Compose Activity Timeline parts inside it. */\nexport function PublicProfileActivity(\n  props: Omit<ComponentProps<typeof ActivityTimeline>, \"variant\">,\n) {\n  const variant = useVariant(\"PublicProfileActivity\");\n  return (\n    <ActivityTimeline\n      data-slot=\"public-profile-activity\"\n      {...props}\n      variant={timelineVariants[variant]}\n    />\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/uai/public-profile.tsx"
    }
  ],
  "categories": [
    "content",
    "community"
  ],
  "type": "registry:block"
}