{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checklist-02",
  "description": "The stages of a multi-stage setup as a row of rules, side by side when wide and stacked when narrow.",
  "registryDependencies": [
    "card",
    "button",
    "https://www.dashboardblocks.com/r/radix/block-state.json",
    "https://www.dashboardblocks.com/r/radix/checklist.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/checklist/checklist-02.tsx",
      "content": "'use client'\n\nimport {\n  BlockReady,\n  BlockStateProvider,\n  BlockStateRows,\n  type BlockStateProps,\n  getBlockState,\n} from '@/registry/components/dashboardblocks/block-state'\nimport {\n  type StepState,\n  StepRail,\n  StepRailItem,\n  getChecklistProgress,\n  getNextStep,\n} from '@/registry/components/dashboardblocks/checklist'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\n\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent } from '@/components/ui/card'\n\ninterface SetupStage {\n  id: string\n  state: StepState\n  title: string\n}\n\ninterface Checklist2Props extends BlockStateProps {\n  /** @default 'Continue setup' */\n  continueLabel?: string\n  description: string\n  onContinue?: () => void\n  /** Leave out, or pass none, to show the empty state. */\n  stages?: SetupStage[]\n  title: string\n}\n\nconst exampleProps: Checklist2Props = {\n  description: 'Sync your production database into the warehouse.',\n  stages: [\n    { id: 'source', state: 'done', title: 'Choose source' },\n    { id: 'connect', state: 'done', title: 'Connect' },\n    { id: 'tables', state: 'current', title: 'Select tables' },\n    { id: 'schedule', state: 'todo', title: 'Schedule sync' },\n    { id: 'review', state: 'todo', title: 'Review and launch' },\n  ],\n  title: 'New connection',\n}\n\nconst Checklist2 = (props: Checklist2Props) => {\n  const {\n    continueLabel = 'Continue setup',\n    description,\n    onContinue,\n    stages = [],\n    errorMessage,\n    status,\n    title,\n  } = props\n  const state = getBlockState(status, stages)\n  const progress = getChecklistProgress(stages)\n  const next = getNextStep(stages)\n  const position = next ? stages.indexOf(next) + 1 : stages.length\n\n  return (\n    <BlockStateProvider errorMessage={errorMessage} state={state}>\n      <Card>\n        <CardContent>\n          <section className='@container flex flex-col gap-4'>\n            <header className='flex flex-wrap items-start justify-between gap-3'>\n              <div className='flex min-w-0 flex-col gap-0.5'>\n                <h2 className='font-semibold tracking-tight'>{title}</h2>\n                <p className='text-muted-foreground text-sm'>\n                  {description}{' '}\n                  <BlockReady className='text-sm'>\n                    {progress.remaining === 0\n                      ? 'Every stage is done.'\n                      : `Stage ${position} of ${stages.length}.`}\n                  </BlockReady>\n                </p>\n              </div>\n              {(state || progress.remaining > 0) && (\n                <Button size='sm' disabled={state !== undefined} onClick={onContinue}>\n                  {continueLabel}\n                  <IconPlaceholder\n                    lucide='ArrowRightIcon'\n                    tabler='IconArrowRight'\n                    hugeicons='ArrowRight01Icon'\n                    phosphor='ArrowRightIcon'\n                    remixicon='RiArrowRightLine'\n                    data-icon='inline-end'\n                  />\n                </Button>\n              )}\n            </header>\n            <BlockStateRows className='border-t' rows={stages.length || 5} />\n            {!state && (\n              <StepRail aria-label='Setup stages'>\n                {stages.map((stage, index) => (\n                  <StepRailItem\n                    key={stage.id}\n                    index={index + 1}\n                    state={stage.state}\n                    title={stage.title}\n                  />\n                ))}\n              </StepRail>\n            )}\n          </section>\n        </CardContent>\n      </Card>\n    </BlockStateProvider>\n  )\n}\n\nexport { Checklist2, exampleProps as checklist2ExampleProps, type Checklist2Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/checklist/checklist-02.tsx"
    }
  ],
  "meta": {
    "shows": "The stages of a multi-stage setup as a row of rules, side by side when wide and stacked when narrow.",
    "size": "full",
    "usedWith": [
      "checklist-01",
      "onboarding-02"
    ],
    "component": "Checklist2",
    "props": "{ continueLabel?: string; description: string; onContinue?: () => void; stages?: { id: string; state: \"done\" | \"todo\" | \"current\" | \"skipped\"; title: string }[]; title: string; errorMessage?: string; status?: \"loading\" | \"error\" }"
  },
  "type": "registry:component"
}
