{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "setup-card",
  "title": "Setup Card",
  "description": "Finish-setup card with a media header, a badge, copy and a step-progress footer.",
  "dependencies": [
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "@pestoui/progress-circle",
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/components/setup-card.tsx",
      "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { ProgressCircle } from \"@/components/ui/progress-circle\"\nimport { cn } from \"@/lib/utils\"\n\n/* Finish-setup card for a sidebar footer: a pastel media header, a circular\n * badge floating on the seam below it, the copy, and a step-progress footer.\n *\n * Deliberately not built on Card, for one reason: Card is `overflow-hidden`,\n * which is the one thing a badge overhanging the media edge cannot survive.\n * Everything else follows from that. The root re-states Card's surface — same\n * radius, border, ink, hairline elevation — and each part carries its own\n * `px-(--setup-card-spacing)`, the same idiom `--card-spacing` uses, so the\n * rhythm matches a real Card even though the chrome is re-declared.\n *\n * The media carries no background of its own. The four `gradient-*` utilities\n * are whole-background shorthands (a colour plus four stacked radials), so a\n * placeholder `bg-secondary` underneath would not lose to them predictably —\n * twMerge cannot pair the two class names, both would ship, and the winner\n * would come down to stylesheet order. Passing one of the gradients in\n * `className` is the contract, not a convenience. */\nconst setupCardVariants = cva(\n  \"group/setup-card flex w-full flex-col rounded-xl border border-border bg-card text-card-foreground shadow-hairline\",\n  {\n    variants: {\n      /* Only spacing lives here. Everything the size changes further down the\n         tree hangs off `data-size` instead, because the parts that need it are\n         separated from the root by caller-supplied children. */\n      size: {\n        sm: \"[--setup-card-spacing:--spacing(4)]\",\n        default: \"[--setup-card-spacing:--spacing(5)]\",\n      },\n    },\n    defaultVariants: { size: \"default\" },\n  },\n)\n\ntype SetupCardSize = NonNullable<VariantProps<typeof setupCardVariants>[\"size\"]>\n\ninterface SetupCardMediaProps extends React.ComponentProps<\"div\"> {\n  /**\n   * Circular mark centred on the media/body seam. Decorative — see the note on\n   * the slot below.\n   */\n  badge?: React.ReactNode\n  /** Overlaid control, pinned to the top-right corner and forced to a pill. */\n  action?: React.ReactNode\n}\n\ninterface SetupCardStepsProps extends React.ComponentProps<\"span\"> {\n  /** Steps completed. Values outside `[0, max]` are clamped by the ring. */\n  current: number\n  /** Total number of steps. */\n  max: number\n  /** Names the count for assistive tech, read ahead of the visible \"2 of 4\". */\n  srLabel?: string\n}\n\nfunction SetupCard({\n  className,\n  size = \"default\",\n  ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof setupCardVariants>) {\n  return (\n    <div\n      data-slot=\"setup-card\"\n      data-size={size}\n      className={cn(setupCardVariants({ size }), className)}\n      {...props}\n    />\n  )\n}\n\n/**\n * The media header. Pass one of `gradient-sky` · `gradient-sunrise` ·\n * `gradient-blossom` · `gradient-meadow` in `className`, and an illustration as\n * `children`.\n */\nfunction SetupCardMedia({\n  className,\n  badge,\n  action,\n  children,\n  ...props\n}: SetupCardMediaProps) {\n  return (\n    <div\n      data-slot=\"setup-card-media\"\n      className={cn(\n        \"relative shrink-0 rounded-t-xl\",\n        \"h-28 group-data-[size=sm]/setup-card:h-24\",\n        /* The badge overhangs the bottom edge by half its own box, so the gap\n           to the title is measured from the badge rather than from the media:\n           36px clears a 56px badge with 8px to spare, 32px clears a 48px one. */\n        badge\n          ? \"mb-9 group-data-[size=sm]/setup-card:mb-8\"\n          : \"mb-4 group-data-[size=sm]/setup-card:mb-3\",\n        className,\n      )}\n      {...props}\n    >\n      {/* The gradient is a background, so the radius clips it for free. An\n          illustration is not — it needs a layer of its own to be clipped by,\n          and that layer cannot be this element: clipping here would also cut\n          off the badge and the action. */}\n      {children ? (\n        <div\n          data-slot=\"setup-card-media-fill\"\n          className=\"absolute inset-0 overflow-hidden rounded-t-xl\"\n        >\n          {children}\n        </div>\n      ) : null}\n\n      {action ? (\n        /* The pill is enforced rather than documented. This is the only control\n           that sits on the pastel, and its shape is what separates it from the\n           illustration behind it — a square-cornered button here reads as a\n           mis-crop of the artwork. */\n        <div\n          data-slot=\"setup-card-media-action\"\n          className=\"absolute top-3 right-3 flex items-center gap-2 [&_[data-slot=button]]:rounded-full\"\n        >\n          {action}\n        </div>\n      ) : null}\n\n      {badge ? (\n        <span\n          data-slot=\"setup-card-media-badge\"\n          /* aria-hidden: the mark is a wayfinding cue for a title that sits\n             directly beneath it and already names the step. Announcing it would\n             just prepend noise to that title. */\n          aria-hidden=\"true\"\n          className={cn(\n            \"absolute bottom-0 left-1/2 flex -translate-x-1/2 translate-y-1/2 items-center justify-center rounded-full bg-card text-foreground shadow-soft ring-4 ring-card\",\n            \"size-14 group-data-[size=sm]/setup-card:size-12\",\n            \"[&_svg]:size-6 [&_svg]:shrink-0 group-data-[size=sm]/setup-card:[&_svg]:size-5\",\n          )}\n        >\n          {badge}\n        </span>\n      ) : null}\n    </div>\n  )\n}\n\n/* A div rather than a heading. This card turns up in a sidebar footer, in an\n   onboarding column and inside a dialog, and only the page around it knows\n   which level is correct; a fixed one would break heading order in two of the\n   three. Callers who need a heading pass their own element as children. */\nfunction SetupCardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"setup-card-title\"\n      className={cn(\n        \"px-(--setup-card-spacing) text-center text-base leading-snug font-semibold\",\n        \"group-data-[size=sm]/setup-card:text-sm\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SetupCardDescription({\n  className,\n  ...props\n}: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"setup-card-description\"\n      className={cn(\n        \"mt-1.5 px-(--setup-card-spacing) text-center text-sm leading-normal text-pretty text-muted-foreground\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Progress on one side, actions on the other. The border is on the footer and\n   not on the card, so a card without one ends on its own bottom padding rather\n   than on a rule that has nothing under it. */\nfunction SetupCardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"setup-card-footer\"\n      className={cn(\n        \"mt-4 flex items-center justify-between gap-3 border-t border-border px-(--setup-card-spacing) py-3\",\n        \"group-data-[size=sm]/setup-card:mt-3 group-data-[size=sm]/setup-card:py-2.5\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/** The ring and its readout: `current` of `max`, as a count and as an arc. */\nfunction SetupCardSteps({\n  className,\n  current,\n  max,\n  srLabel = \"Setup progress\",\n  ...props\n}: SetupCardStepsProps) {\n  return (\n    <span\n      data-slot=\"setup-card-steps\"\n      className={cn(\n        \"inline-flex shrink-0 items-center gap-2 text-xs font-medium text-muted-foreground tabular-nums\",\n        className,\n      )}\n      {...props}\n    >\n      {/* Hidden outright rather than left to announce \"50%\" a beat after the\n          text beside it has said \"2 of 4\" — the same quantity twice, in two\n          different units, is worse than one terse reading.\n\n          A numeric size because the named ones start at 36px, which is taller\n          than the row it sits in; the component derives its own stroke from the\n          box, so this stays one number rather than two. */}\n      <ProgressCircle\n        aria-hidden=\"true\"\n        value={current}\n        max={max}\n        size={16}\n        tone=\"selected\"\n      />\n      <span className=\"sr-only\">{srLabel}: </span>\n      {current} of {max}\n    </span>\n  )\n}\n\nexport {\n  SetupCard,\n  SetupCardDescription,\n  SetupCardFooter,\n  SetupCardMedia,\n  SetupCardSteps,\n  SetupCardTitle,\n  setupCardVariants,\n}\nexport type { SetupCardMediaProps, SetupCardSize, SetupCardStepsProps }\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}