{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checklist-03",
  "description": "A small block with how many setup steps are done and the next one, to bring people back to finish.",
  "registryDependencies": [
    "card",
    "button",
    "https://www.dashboardblocks.com/r/radix/block-state.json",
    "https://www.dashboardblocks.com/r/radix/checklist.json",
    "https://www.dashboardblocks.com/r/radix/format.json",
    "https://www.dashboardblocks.com/r/radix/kpi.json",
    "https://www.dashboardblocks.com/r/radix/progress-bar.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/checklist/checklist-03.tsx",
      "content": "'use client'\n\nimport {\n  BlockStateProvider,\n  type BlockStateProps,\n  SkeletonText,\n  getBlockState,\n} from '@/registry/components/dashboardblocks/block-state'\nimport {\n  type StepState,\n  describeChecklistProgress,\n  getChecklistProgress,\n  getNextStep,\n} from '@/registry/components/dashboardblocks/checklist'\nimport { KPIValue } from '@/registry/components/dashboardblocks/kpi'\nimport { ProgressBar } from '@/registry/components/dashboardblocks/progress-bar'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport { formatPercent } from '@/registry/lib/dashboardblocks/format'\n\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent } from '@/components/ui/card'\n\ninterface Checklist3Props extends BlockStateProps {\n  /** @default 'Continue' */\n  continueLabel?: string\n  onContinue?: () => void\n  /** Leave out, or pass none, to show the empty state. */\n  steps?: { duration?: string; id: string; state: StepState; title: string }[]\n  title: string\n}\n\nconst exampleProps: Checklist3Props = {\n  steps: [\n    { id: 'profile', state: 'done', title: 'Complete your profile' },\n    { id: 'domain', state: 'done', title: 'Verify your domain' },\n    { id: 'sso', state: 'done', title: 'Turn on single sign-on' },\n    {\n      duration: '2 min',\n      id: 'team',\n      state: 'current',\n      title: 'Invite your team',\n    },\n    {\n      duration: '5 min',\n      id: 'billing',\n      state: 'todo',\n      title: 'Add a payment method',\n    },\n  ],\n  title: 'Account setup',\n}\n\nconst Checklist3 = (props: Checklist3Props) => {\n  const {\n    continueLabel = 'Continue',\n    onContinue,\n    errorMessage,\n    status,\n    steps = [],\n    title,\n  } = props\n  const state = getBlockState(status, steps)\n  const progress = getChecklistProgress(steps)\n  const next = getNextStep(steps)\n  const continueButton = (\n    <Button\n      size='sm'\n      variant='outline'\n      className='self-start @xs:self-center'\n      disabled={state !== undefined}\n      onClick={onContinue}\n    >\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\n  return (\n    <BlockStateProvider errorMessage={errorMessage} state={state}>\n      <Card>\n        <CardContent>\n          <section className='@container flex flex-col gap-3'>\n            <h2 className='font-semibold tracking-tight'>{title}</h2>\n            <div className='flex flex-col gap-2'>\n              <div className='flex flex-wrap items-baseline gap-x-2'>\n                <KPIValue\n                  value={progress.percentage}\n                  format={(value) =>\n                    formatPercent(value / 100, { maximumFractionDigits: 0 })\n                  }\n                />\n                {!state && (\n                  <span className='text-muted-foreground text-sm tabular-nums'>\n                    {describeChecklistProgress(progress)}\n                  </span>\n                )}\n              </div>\n              {state === 'loading' && <ProgressBar className='h-1.5' percentage={0} />}\n              {!state && (\n                <div\n                  role='progressbar'\n                  aria-label={title}\n                  aria-valuemax={progress.total}\n                  aria-valuemin={0}\n                  aria-valuenow={progress.done}\n                  aria-valuetext={describeChecklistProgress(progress)}\n                >\n                  <ProgressBar\n                    className='h-1.5'\n                    fillClassName='motion-reduce:transition-none'\n                    percentage={progress.percentage}\n                  />\n                </div>\n              )}\n            </div>\n            {state === 'loading' && (\n              <div className='flex flex-col gap-3 border-t pt-3 @xs:flex-row @xs:items-center @xs:justify-between'>\n                <p className='flex min-w-0 flex-1 flex-col gap-0.5'>\n                  <span className='text-muted-foreground text-sm'>Up next</span>\n                  <span className='text-sm'>\n                    <SkeletonText className='w-2/3' />\n                  </span>\n                </p>\n                {continueButton}\n              </div>\n            )}\n            {!state &&\n              (next ? (\n                <div className='flex flex-col gap-3 border-t pt-3 @xs:flex-row @xs:items-center @xs:justify-between'>\n                  <p className='flex min-w-0 flex-col gap-0.5'>\n                    <span className='text-muted-foreground text-sm'>Up next</span>\n                    <span className='text-sm font-medium'>{next.title}</span>\n                    {next.duration && (\n                      <span className='text-muted-foreground text-sm tabular-nums'>\n                        {next.duration}\n                      </span>\n                    )}\n                  </p>\n                  {continueButton}\n                </div>\n              ) : (\n                <p className='border-t pt-3 text-sm font-medium text-emerald-700 dark:text-emerald-400'>\n                  Every step is done.\n                </p>\n              ))}\n          </section>\n        </CardContent>\n      </Card>\n    </BlockStateProvider>\n  )\n}\n\nexport { Checklist3, exampleProps as checklist3ExampleProps, type Checklist3Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/checklist/checklist-03.tsx"
    }
  ],
  "meta": {
    "shows": "A small block with how many setup steps are done and the next one, to bring people back to finish.",
    "size": "compact",
    "usedWith": [
      "checklist-01",
      "kpi-01"
    ],
    "component": "Checklist3",
    "props": "{ continueLabel?: string; onContinue?: () => void; steps?: { duration?: string; id: string; state: \"done\" | \"todo\" | \"current\" | \"skipped\"; title: string }[]; title: string; errorMessage?: string; status?: \"loading\" | \"error\" }"
  },
  "type": "registry:component"
}
