{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "margin-note-stats",
  "type": "registry:block",
  "title": "Margin Note Stats",
  "description": "Stats Section built with Margin Note (annotated line chart): a chart that annotates itself. A take on the chart (graph). A stats section where the chart explains itself. Margin Note reads three months of fares, stops where the price moved and writes why in the margin (a new flight, a festival, the last two weeks), then the takeaway; three plain numbers sit underneath.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "stats-sections",
    "stats",
    "chart"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/stats-sections/margin-note-stats",
  "registryDependencies": [
    "https://keyframeui.com/r/margin-note.json"
  ],
  "files": [
    {
      "path": "components/margin-note-stats.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { MarginNote, type MarginNoteNote } from \"@/components/ui/margin-note\";\n\n/* ── Content ─────────────────────────────────────────────────\n * Everything you'd change to make the section yours: the copy,\n * the series the chart reads with its notes, and the three\n * numbers under it.\n * ─────────────────────────────────────────────────────────── */\n\n/** The one accent: the reading line, the notes and their markers. */\nconst ACCENT = { light: \"#5b54d6\", dark: \"#a49dff\" };\n\nconst EYEBROW = \"Fare watch\";\nconst HEADLINE = \"We read the fares so you don't have to.\";\nconst SUBLINE =\n  \"Meander checks every route on your trip twice a day and tells you why a price moved, not just that it did. Here's the last three months to Porto Lume.\";\n\nconst CHART = {\n  title: \"Return fares to Porto Lume\",\n  caption: \"Lowest economy fare, every five days\",\n  status: \"Watching\",\n  /** What screen readers hear before the values. */\n  label: \"Return fares to Porto Lume over the last 90 days\",\n};\n\nconst DAYS = [\n  \"Aug 1\", \"Aug 6\", \"Aug 11\", \"Aug 16\", \"Aug 21\", \"Aug 26\", \"Aug 31\", \"Sep 5\", \"Sep 10\",\n  \"Sep 15\", \"Sep 20\", \"Sep 25\", \"Sep 30\", \"Oct 5\", \"Oct 10\", \"Oct 15\", \"Oct 20\", \"Oct 25\",\n];\nconst FARES = [184, 179, 188, 176, 137, 131, 134, 140, 158, 247, 262, 236, 152, 146, 149, 168, 189, 214];\n\nconst NOTES: MarginNoteNote[] = [\n  { at: 4, title: \"A second daily flight\", body: \"Lumeair added a morning departure; fares fell within a week.\", delta: \"−22%\" },\n  { at: 9, to: 11, title: \"Harvest festival\", body: \"Fares rose for the wine harvest weekend and the week around it.\", delta: \"+41%\" },\n  { at: 15, to: 17, title: \"Inside 14 days\", body: \"From two weeks out, this route gets dearer by about 3% a day.\", delta: \"+3%/day\" },\n];\nconst SUMMARY = \"Book by Thursday: from 14 days out this route only gets dearer.\";\n\nconst formatFare = (value: number) => `€${Math.round(value)}`;\n\nconst STATS = [\n  { value: \"€74\", label: \"saved on the average return fare, against booking on the day you plan\" },\n  { value: \"2×\", label: \"a day, every route on your trip is checked again\" },\n  { value: \"9 days\", label: \"ahead: the alert that tells you when to book\" },\n];\n\n/* ── Section ─────────────────────────────────────────────── */\n\nexport function MarginNoteStats() {\n  return (\n    <section\n      aria-labelledby=\"margin-note-stats-title\"\n      style={{ \"--accent-light\": ACCENT.light, \"--accent-dark\": ACCENT.dark } as React.CSSProperties}\n      className=\"bg-[#f3f1ec] text-zinc-950 dark:bg-zinc-950 dark:text-white\"\n    >\n      <div className=\"mx-auto max-w-6xl px-6 py-24 sm:py-32\">\n        <div className=\"grid items-end gap-6 lg:grid-cols-[1.2fr_1fr] lg:gap-16\">\n          <div>\n            <p className=\"text-sm font-medium text-zinc-500 dark:text-zinc-400\">{EYEBROW}</p>\n            <h2\n              id=\"margin-note-stats-title\"\n              className=\"mt-3 max-w-[16ch] text-4xl/[1.05] font-medium tracking-[-0.035em] text-balance sm:text-5xl/[1.02]\"\n            >\n              {HEADLINE}\n            </h2>\n          </div>\n          <p className=\"max-w-md text-base/7 text-pretty text-zinc-600 lg:pb-1.5 dark:text-zinc-400\">{SUBLINE}</p>\n        </div>\n\n        <div className=\"mt-12 rounded-[2rem] bg-white p-5 shadow-sm ring-1 ring-zinc-950/[0.06] sm:p-8 dark:bg-zinc-900 dark:ring-white/10\">\n          <div className=\"mb-6 flex flex-wrap items-start justify-between gap-3\">\n            <div>\n              <h3 className=\"text-[15px] font-medium tracking-tight\">{CHART.title}</h3>\n              <p className=\"mt-0.5 text-xs text-zinc-500 dark:text-zinc-400\">{CHART.caption}</p>\n            </div>\n            <p className=\"inline-flex items-center gap-1.5 rounded-full bg-emerald-500/10 px-2.5 py-1 text-xs font-medium text-emerald-700 dark:text-emerald-400\">\n              <span aria-hidden className=\"size-1.5 rounded-full bg-emerald-500\" />\n              {CHART.status}\n            </p>\n          </div>\n          <MarginNote\n            label={CHART.label}\n            data={FARES}\n            labels={DAYS}\n            notes={NOTES}\n            summary={SUMMARY}\n            format={formatFare}\n            className=\"[--margin-note-accent:var(--accent-light)] dark:[--margin-note-accent:var(--accent-dark)]\"\n          />\n        </div>\n\n        <dl className=\"mt-10 grid gap-8 border-t border-zinc-950/10 pt-8 sm:grid-cols-3 dark:border-white/10\">\n          {STATS.map((stat) => (\n            <div key={stat.value} className=\"flex flex-col\">\n              <dt className=\"order-2 mt-2 max-w-60 text-sm/6 text-pretty text-zinc-600 dark:text-zinc-400\">{stat.label}</dt>\n              <dd className=\"order-1 text-4xl font-medium tracking-[-0.035em] tabular-nums\">{stat.value}</dd>\n            </div>\n          ))}\n        </dl>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}