{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-inline",
  "title": "Stats Inline",
  "description": "Heading and intro above rule-topped rows where each figure reads as one sentence.",
  "registryDependencies": [
    "badge"
  ],
  "files": [
    {
      "path": "payload-components/source/blocks/shared/statsFields.ts",
      "content": "import type { Field } from 'payload'\n\n/**\n * Shared field core for the Stats component family.\n *\n * Every stats variant (stats-proof, stats-grid, stats-card, stats-inline, …)\n * spreads `statsFields` first for the shared eyebrow/title heading, then appends\n * its own variant-specific shape — the narrative-plus-quote proof panel, the bare\n * number band, the divided card row, or the bordered sentence rows. Editing the\n * shared heading here updates every installed stats block at once, so the family\n * never drifts field-by-field across a repo.\n *\n * `statsMetricFields` is the one-figure shape (display value plus its label)\n * reused by every variant, so a metric reads the same wherever it appears. The\n * value stays a free-text string rather than a number: real stat bands mix\n * `99.9%`, `+1,200`, `22M`, and `24/7`, and formatting them belongs to the editor\n * rather than to a locale-sensitive number formatter at render time.\n *\n * Installed once per repo at `src/blocks/shared/statsFields.ts`; re-running\n * `payload-components add stats-*` never overwrites a copy you have already edited.\n */\nexport const statsFields: Field[] = [\n  {\n    name: 'eyebrow',\n    type: 'text',\n  },\n  {\n    name: 'title',\n    type: 'text',\n    required: true,\n  },\n]\n\nexport const statsMetricFields: Field[] = [\n  {\n    name: 'value',\n    type: 'text',\n    required: true,\n  },\n  {\n    name: 'label',\n    type: 'text',\n    required: true,\n  },\n]\n",
      "type": "registry:file",
      "target": "~/src/blocks/shared/statsFields.ts"
    },
    {
      "path": "payload-components/source/blocks/StatsInline/config.ts",
      "content": "import type { Block } from 'payload'\n\nimport { statsFields, statsMetricFields } from '@/blocks/shared/statsFields'\n\nexport const StatsInline: Block = {\n  slug: 'statsInline',\n  // Existing apps must migrate stored data before adopting this identifier:\n  // https://www.payload-components.xyz/docs/registry#installed-source-and-migrations\n  dbName: 'pc_sta_inl',\n  interfaceName: 'StatsInlineBlock',\n  fields: [\n    // Shared stats core (eyebrow, title). Variant-specific fields follow; edit the\n    // shared shape in @/blocks/shared/statsFields.\n    ...statsFields,\n    {\n      name: 'description',\n      type: 'textarea',\n    },\n    {\n      name: 'metrics',\n      type: 'array',\n      required: true,\n      minRows: 2,\n      maxRows: 6,\n      admin: {\n        description:\n          'Each row reads as one sentence — the value leads, the label completes it (\"99.9% uptime guarantee\").',\n        initCollapsed: true,\n      },\n      // Shared metric shape — see @/blocks/shared/statsFields.\n      fields: statsMetricFields,\n    },\n  ],\n  labels: {\n    plural: 'Stats Inline Blocks',\n    singular: 'Stats Inline',\n  },\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/StatsInline/config.ts"
    },
    {
      "path": "payload-components/source/blocks/StatsInline/Component.tsx",
      "content": "import React from 'react'\n\nimport type { StatsInlineBlock as StatsInlineBlockData } from '@/payload-types'\n\nimport { Badge } from '@/components/ui/badge'\nimport { cn } from '@/utilities/ui'\n\n// Layout adapted from tailark/blocks (MIT) — re-implemented as a Payload block.\n\ntype Props = StatsInlineBlockData & {\n  id?: string\n  className?: string\n  disableInnerContainer?: boolean\n}\n\nexport const StatsInlineBlock: React.FC<Props> = ({\n  className,\n  description,\n  disableInnerContainer,\n  eyebrow,\n  id,\n  metrics,\n  title,\n}) => {\n  return (\n    <section className={cn('container', className)} id={id ? `block-${id}` : undefined}>\n      <div className=\"overflow-hidden rounded-frame border border-border/70 bg-card/35 px-6 py-10 sm:px-8 lg:px-12 lg:py-14\">\n        <div\n          className={cn('flex flex-col gap-10', {\n            'mx-auto max-w-4xl': !disableInnerContainer,\n          })}\n        >\n          <div className=\"flex flex-col gap-4\">\n            {eyebrow ? (\n              <Badge variant=\"outline\" className=\"w-fit rounded-full px-3 py-1 uppercase tracking-eyebrow\">\n                {eyebrow}\n              </Badge>\n            ) : null}\n\n            <h2 className=\"text-3xl font-medium tracking-title text-balance sm:text-4xl\">{title}</h2>\n\n            {description ? (\n              <p className=\"max-w-2xl text-base leading-7 text-muted-foreground\">{description}</p>\n            ) : null}\n          </div>\n\n          {metrics && metrics.length > 0 ? (\n            <ul className=\"grid gap-x-8 sm:grid-cols-2 lg:grid-cols-3\" role=\"list\">\n              {metrics.map((metric, index) => (\n                <li\n                  key={metric.id ?? `${metric.value}-${index}`}\n                  className=\"border-t border-border/70 py-6 text-xl leading-8 text-muted-foreground\"\n                >\n                  <span className=\"font-medium text-foreground\">{metric.value}</span> {metric.label}\n                </li>\n              ))}\n            </ul>\n          ) : null}\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/StatsInline/Component.tsx"
    }
  ],
  "meta": {
    "payloadComponent": {
      "installCommand": "payload-components add stats-inline",
      "postInstall": [
        "generate:types",
        "generate:importmap"
      ],
      "requiresPayloadComponentWrapper": true,
      "supportedTargets": [
        "payload-website-starter",
        "payload-blocks-app"
      ]
    }
  },
  "docs": "Payload Components installs this as a Payload CMS block for the Payload website starter shape.\n\nRecommended install:\n\n```bash\npnpm payload-components add stats-inline\n```\n\nDirect shadcn install URL:\n\n```bash\npnpm dlx shadcn@latest add https://www.payload-components.xyz/r/stats-inline.json\n```\n\nDirect shadcn installs only copy the block source files and shadcn UI dependencies. Use `payload-components add stats-inline` when you also want Payload layout registration, `RenderBlocks` wiring, `generate:types`, and `generate:importmap` handled for you.",
  "type": "registry:block"
}