{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-section",
  "title": "Stats Section",
  "description": "Numbers that make a claim believable, in three decisions: several of equal weight, one to remember above the rest, or each beside what it counts.",
  "registryDependencies": [
    "utils",
    "https://miseui.junsu4621.workers.dev/r/count-up.json"
  ],
  "files": [
    {
      "path": "registry/miseui/blocks/stats-section.tsx",
      "content": "import { cn } from \"@/registry/miseui/lib/utils\"\nimport { DEFAULT_COPY, ROOT_CLASS, SAMPLE_STATS, StatNumber, StatsHeading, StatsNote, resolveNote, type StatsSectionCopyProps, type StatsSectionStat } from \"./stats-section-parts\"\nimport { StatsSectionPlate } from \"./stats-section-plate\"\nimport { StatsSectionSplit, type StatsSectionSplitProps } from \"./stats-section-split\"\n\ntype StatsSectionVariant = \"row\" | \"plate\" | \"split\"\n\ninterface StatsSectionProps extends StatsSectionSplitProps {\n  /** `row` several numbers of equal weight, `plate` one number to remember above the rest, `split` each number beside what it counts. Anything else is `row`. */\n  variant?: StatsSectionVariant\n}\n\nfunction StatsSectionRow({\n  headline = DEFAULT_COPY.headline,\n  headlineQuiet = DEFAULT_COPY.headlineQuiet,\n  stats = SAMPLE_STATS,\n  note,\n  locale,\n  className,\n  ...props\n}: StatsSectionCopyProps) {\n  if (stats.length === 0) return null\n  return (\n    <section data-slot=\"stats-section\" data-variant=\"row\" className={cn(ROOT_CLASS, \"bg-background\", className)} {...props}>\n      <div className=\"mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-12 @2xl:gap-12 @2xl:px-8 @2xl:py-16\">\n        <StatsHeading headline={headline} quiet={headlineQuiet} className=\"max-w-2xl\" />\n        {/* Auto-fit so three, four or five numbers all fill the line, and two columns remain at 343 px. */}\n        <dl className=\"m-0 grid grid-cols-[repeat(auto-fit,minmax(8.5rem,1fr))] gap-x-6 gap-y-8\">\n          {stats.map((stat) => (\n            <div key={stat.id} className=\"flex min-w-0 flex-col-reverse justify-end gap-2 border-l pl-4\">\n              <dt className=\"text-[13px] leading-5 text-pretty text-muted-foreground\">{stat.label}</dt>\n              <dd className=\"m-0\">\n                <StatNumber stat={stat} locale={locale} className=\"text-title text-3xl @3xl:text-4xl\" />\n              </dd>\n            </div>\n          ))}\n        </dl>\n        <StatsNote note={resolveNote(note, stats)} />\n      </div>\n    </section>\n  )\n}\n\nfunction StatsSection({ variant, description, ...props }: StatsSectionProps) {\n  switch (variant) {\n    case \"plate\":\n      return <StatsSectionPlate {...props} />\n    case \"split\":\n      return <StatsSectionSplit description={description} {...props} />\n    default:\n      return <StatsSectionRow {...props} />\n  }\n}\n\nexport { StatsSection, type StatsSectionProps, type StatsSectionStat, type StatsSectionVariant }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/stats-section-parts.tsx",
      "content": "import type * as React from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { CountUp } from \"@/registry/miseui/ui/count-up\"\n\ninterface StatsSectionStat {\n  id: string\n  value: number\n  label: string\n  prefix?: string\n  suffix?: string\n  formatOptions?: Intl.NumberFormatOptions\n  /** Where the number comes from, or what it counts. Shown on `split`. */\n  detail?: string\n}\n\ninterface StatsSectionCopyProps extends React.ComponentProps<\"section\"> {\n  headline?: string\n  /** Continues the headline in the same size, one tone quieter. */\n  headlineQuiet?: string\n  /** Only numbers you can back up. An empty list renders nothing. */\n  stats?: readonly StatsSectionStat[]\n  /** A line under the numbers. Defaults to saying the sample figures are examples, and to nothing once you pass your own. */\n  note?: string | null\n  /** Leave unset to follow the viewer. A server-rendered page should pass one. */\n  locale?: Intl.LocalesArgument\n}\n\nconst SAMPLE_STATS: readonly StatsSectionStat[] = [\n  { id: \"calls\", value: 1240, label: \"Calls summarized this week\", detail: \"Counted when the summary is sent, not when the call starts.\" },\n  { id: \"owners\", value: 94, suffix: \"%\", label: \"Action items with an owner\", detail: \"The rest are flagged, so someone can claim them.\" },\n  { id: \"saved\", value: 6.5, suffix: \" h\", label: \"Saved per person each month\", detail: \"From the time people told us they spent writing notes.\" },\n  { id: \"speed\", value: 2, suffix: \" min\", label: \"From hang-up to summary\", detail: \"The median for a call of one hour.\" },\n]\n\nconst SAMPLE_NOTE = \"Example figures for a sample product. Replace them with your own.\"\n\nconst DEFAULT_COPY = {\n  headline: \"Less time writing it down.\",\n  headlineQuiet: \"More time doing it.\",\n} as const\n\nconst ROOT_CLASS = \"@container flex w-full flex-col justify-center\"\n\n/** The example note must not outlive the example numbers, or it would call a real figure made up. */\nfunction resolveNote(note: string | null | undefined, stats: readonly StatsSectionStat[]) {\n  if (note !== undefined) return note\n  return stats === SAMPLE_STATS ? SAMPLE_NOTE : null\n}\n\nfunction StatNumber({ stat, locale, className }: { stat: StatsSectionStat; locale?: Intl.LocalesArgument; className?: string }) {\n  return <CountUp value={stat.value} prefix={stat.prefix} suffix={stat.suffix} formatOptions={stat.formatOptions} locale={locale} className={className} />\n}\n\nfunction StatsHeading({ headline, quiet, className }: { headline: string; quiet: string; className?: string }) {\n  return (\n    <h2 className={cn(\"text-title text-3xl text-balance @2xl:text-4xl\", className)}>\n      {headline} <span className=\"text-muted-foreground\">{quiet}</span>\n    </h2>\n  )\n}\n\nfunction StatsNote({ note, className }: { note: string | null; className?: string }) {\n  if (!note) return null\n  return <p className={cn(\"text-[13px] leading-5 text-pretty text-muted-foreground\", className)}>{note}</p>\n}\n\nexport { DEFAULT_COPY, ROOT_CLASS, SAMPLE_STATS, StatNumber, StatsHeading, StatsNote, resolveNote, type StatsSectionCopyProps, type StatsSectionStat }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/stats-section-plate.tsx",
      "content": "import { cn } from \"@/registry/miseui/lib/utils\"\nimport { DEFAULT_COPY, ROOT_CLASS, SAMPLE_STATS, StatNumber, StatsHeading, StatsNote, resolveNote, type StatsSectionCopyProps } from \"./stats-section-parts\"\n\n/** The first number is the one people should remember, so it gets the size and the soft accent, and the others stay in one quiet list. */\nfunction StatsSectionPlate({\n  headline = DEFAULT_COPY.headline,\n  headlineQuiet = DEFAULT_COPY.headlineQuiet,\n  stats = SAMPLE_STATS,\n  note,\n  locale,\n  className,\n  ...props\n}: StatsSectionCopyProps) {\n  const [lead, ...rest] = stats\n  if (!lead) return null\n  return (\n    <section data-slot=\"stats-section\" data-variant=\"plate\" className={cn(ROOT_CLASS, \"bg-muted dark:bg-background\", className)} {...props}>\n      <div className=\"mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-12 @2xl:px-8 @2xl:py-16\">\n        <StatsHeading headline={headline} quiet={headlineQuiet} className=\"max-w-2xl\" />\n        <div className=\"grid grid-cols-[minmax(0,1fr)] gap-2 @3xl:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]\">\n          <dl data-slot=\"stats-section-lead\" className=\"m-0 flex min-w-0 flex-col-reverse justify-between gap-12 rounded-3xl bg-mise-soft p-6 @3xl:p-8 dark:border dark:bg-card\">\n            <dt className=\"text-[15px] leading-relaxed text-pretty\">{lead.label}</dt>\n            <dd className=\"m-0\">\n              {/* Scales with the frame: a fixed size is either timid on a desktop or too wide on a phone. */}\n              <StatNumber stat={lead} locale={locale} className=\"text-display text-[clamp(3rem,14cqi,4.5rem)]\" />\n            </dd>\n          </dl>\n          {rest.length > 0 ? (\n            <dl className=\"m-0 flex min-w-0 flex-col justify-center divide-y rounded-3xl border bg-background px-6 dark:bg-card\">\n              {rest.map((stat) => (\n                <div key={stat.id} className=\"grid grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-6 py-6\">\n                  <dt className=\"min-w-0 text-[15px] leading-relaxed text-pretty text-muted-foreground\">{stat.label}</dt>\n                  <dd className=\"m-0\">\n                    <StatNumber stat={stat} locale={locale} className=\"text-title text-3xl\" />\n                  </dd>\n                </div>\n              ))}\n            </dl>\n          ) : null}\n        </div>\n        <StatsNote note={resolveNote(note, stats)} />\n      </div>\n    </section>\n  )\n}\n\nexport { StatsSectionPlate }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/stats-section-split.tsx",
      "content": "import { cn } from \"@/registry/miseui/lib/utils\"\nimport { DEFAULT_COPY, ROOT_CLASS, SAMPLE_STATS, StatNumber, StatsHeading, StatsNote, resolveNote, type StatsSectionCopyProps } from \"./stats-section-parts\"\n\ninterface StatsSectionSplitProps extends StatsSectionCopyProps {\n  /** One or two sentences beside the numbers, on `split`. */\n  description?: string\n}\n\n/** A number without context is only a claim, so each one sits beside what it counts and where it comes from. */\nfunction StatsSectionSplit({\n  headline = DEFAULT_COPY.headline,\n  headlineQuiet = DEFAULT_COPY.headlineQuiet,\n  description = \"Every call ends with a written plan, so nobody has to take notes or ask who owns what.\",\n  stats = SAMPLE_STATS,\n  note,\n  locale,\n  className,\n  ...props\n}: StatsSectionSplitProps) {\n  if (stats.length === 0) return null\n  return (\n    <section data-slot=\"stats-section\" data-variant=\"split\" className={cn(ROOT_CLASS, \"bg-background\", className)} {...props}>\n      <div className=\"mx-auto grid w-full max-w-6xl grid-cols-[minmax(0,1fr)] items-start gap-8 px-4 py-12 @2xl:px-8 @2xl:py-16 @4xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] @4xl:gap-16\">\n        <div className=\"flex min-w-0 flex-col gap-6\">\n          <StatsHeading headline={headline} quiet={headlineQuiet} className=\"@2xl:text-3xl\" />\n          <p className=\"max-w-md text-[15px] leading-relaxed text-pretty text-muted-foreground\">{description}</p>\n          <StatsNote note={resolveNote(note, stats)} />\n        </div>\n        <dl className=\"m-0 flex min-w-0 flex-col divide-y border-y\">\n          {stats.map((stat) => (\n            <div key={stat.id} className=\"grid grid-cols-[minmax(0,1fr)] gap-x-6 gap-y-1 py-6 @lg:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]\">\n              <dt className=\"text-[15px] leading-relaxed text-pretty @lg:col-start-2\">{stat.label}</dt>\n              {/* First on screen and second in the markup: a screen reader hears what is counted before the number. */}\n              <dd className=\"m-0 -order-1 @lg:col-start-1 @lg:row-span-2 @lg:row-start-1\">\n                <StatNumber stat={stat} locale={locale} className=\"text-title text-4xl\" />\n              </dd>\n              {stat.detail ? <dd className=\"m-0 text-[13px] leading-5 text-pretty text-muted-foreground @lg:col-start-2\">{stat.detail}</dd> : null}\n            </div>\n          ))}\n        </dl>\n      </div>\n    </section>\n  )\n}\n\nexport { StatsSectionSplit, type StatsSectionSplitProps }\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "blocks"
  ],
  "type": "registry:block"
}