{
  "schemaVersion": 1,
  "target": "react",
  "name": "typography",
  "version": "0.1.0",
  "category": "feedback",
  "title": "Typography",
  "description": "Long-form type: headings, paragraph, lead, lists, blockquote, inline code, and links, plus a Prose wrapper that styles rendered markdown at a 68ch measure.",
  "tags": [
    "prose",
    "markdown",
    "article",
    "headings",
    "text",
    "blog",
    "docs",
    "rich text"
  ],
  "requires": {
    "projectTypes": [
      "next",
      "vite-react"
    ],
    "styling": "tailwind-v4"
  },
  "npmDependencies": {},
  "registryDependencies": [],
  "docsPath": "/components/typography",
  "props": [
    {
      "name": "H1, H2, H3, H4",
      "type": "ComponentProps<\"h1\" | \"h2\" | \"h3\" | \"h4\">",
      "description": "Headings on a tight 28 / 20 / 16 / 15px scale, set apart by weight and color. H2 to H4 have scroll-mt-20 for anchor links."
    },
    {
      "name": "P, Lead, Muted",
      "type": "ComponentProps<\"p\">",
      "description": "Body paragraph (15px, 1.7 line height), the larger opening paragraph in the secondary color, and small print in the tertiary color."
    },
    {
      "name": "List ordered",
      "type": "boolean",
      "default": "false",
      "description": "Bulleted list by default; ordered renders an <ol> with mono, tabular numbers."
    },
    {
      "name": "Blockquote, InlineCode, TextLink",
      "type": "ComponentProps<\"blockquote\" | \"code\" | \"a\">",
      "description": "A quotation with a hanging quote mark (no side stripe), code on a faint well, and a link with a quiet underline that strengthens on hover."
    },
    {
      "name": "Prose fullWidth",
      "type": "boolean",
      "default": "false",
      "description": "Prose styles plain HTML children (rendered markdown or CMS output). fullWidth removes the 68ch cap."
    }
  ],
  "accessibility": [
    "Uses real heading, list, blockquote, code, kbd, and table elements, so the outline and semantics come from the markup.",
    "Body text is zinc-700 on white and zinc-300 on black, comfortably above WCAG AA for long reading.",
    "Links are underlined (not color alone) and get the sky focus ring on keyboard focus.",
    "Every reading block is capped at 68ch to keep lines readable.",
    "The decorative quote mark is aria-hidden in Blockquote and generated content in Prose; only the hover underline color transitions, and that is removed under reduced motion."
  ],
  "states": [
    "standalone parts",
    "prose"
  ],
  "files": [
    {
      "path": "ui/typography.tsx",
      "content": "import type { ComponentProps } from \"react\";\n\nfunction cx(...classes: (string | false | null | undefined)[]) {\n  return classes.filter(Boolean).join(\" \");\n}\n\n/*\n * Long-form type. Hierarchy comes from weight and the three text colors with a tight size\n * scale (15px body, 16 / 20 / 28px headings), not from big jumps. Body text runs a step\n * stronger than the UI secondary color (zinc-700 / zinc-300) because it is read for minutes,\n * not glanced at. Every reading block is capped at 68ch.\n *\n * The standalone parts and `Prose` share the same values; `Prose` applies them to plain\n * HTML (rendered markdown, CMS output) through descendant selectors.\n */\n\nconst measure = \"max-w-[68ch]\";\n\n/** Page title. One per page. */\nexport function H1({ className, ...props }: ComponentProps<\"h1\">) {\n  return (\n    <h1\n      className={cx(\n        \"text-[1.75rem] leading-[1.2] font-semibold tracking-[-0.02em] text-balance text-zinc-950 dark:text-white\",\n        measure,\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** Section heading. `scroll-mt-20` keeps anchored headings clear of a sticky header. */\nexport function H2({ className, ...props }: ComponentProps<\"h2\">) {\n  return (\n    <h2\n      className={cx(\n        \"scroll-mt-20 text-xl leading-7 font-semibold tracking-[-0.01em] text-balance text-zinc-950 dark:text-white\",\n        measure,\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport function H3({ className, ...props }: ComponentProps<\"h3\">) {\n  return (\n    <h3\n      className={cx(\"scroll-mt-20 text-base leading-6 font-semibold text-balance text-zinc-950 dark:text-white\", measure, className)}\n      {...props}\n    />\n  );\n}\n\n/** The smallest heading: body size, set apart by weight alone. */\nexport function H4({ className, ...props }: ComponentProps<\"h4\">) {\n  return (\n    <h4\n      className={cx(\"scroll-mt-20 text-[15px] leading-6 font-semibold text-zinc-950 dark:text-white\", measure, className)}\n      {...props}\n    />\n  );\n}\n\n/** A body paragraph. */\nexport function P({ className, ...props }: ComponentProps<\"p\">) {\n  return (\n    <p className={cx(\"text-[15px] leading-[1.7] text-pretty text-zinc-700 dark:text-zinc-300\", measure, className)} {...props} />\n  );\n}\n\n/** The opening paragraph under a title: one step larger, in the secondary color. */\nexport function Lead({ className, ...props }: ComponentProps<\"p\">) {\n  return (\n    <p className={cx(\"text-[17px] leading-[1.6] text-pretty text-zinc-600 dark:text-zinc-400\", measure, className)} {...props} />\n  );\n}\n\n/** Small print and captions in the tertiary color. */\nexport function Muted({ className, ...props }: ComponentProps<\"p\">) {\n  return <p className={cx(\"text-xs leading-5 text-zinc-500\", measure, className)} {...props} />;\n}\n\nexport type ListProps = (ComponentProps<\"ul\"> & { ordered?: false }) | (ComponentProps<\"ol\"> & { ordered: true });\n\n/** A bulleted list, or a numbered one with `ordered`. Numbers are mono and tabular. */\nexport function List({ ordered, className, ...props }: ListProps) {\n  const classes = cx(\n    \"grid gap-1.5 pl-5 text-[15px] leading-[1.7] text-zinc-700 dark:text-zinc-300\",\n    ordered\n      ? \"list-decimal marker:font-mono marker:text-[13px] marker:text-zinc-500 marker:tabular-nums\"\n      : \"list-disc marker:text-zinc-400 dark:marker:text-zinc-600\",\n    \"[&>li]:pl-1.5\",\n    measure,\n    className,\n  );\n  return ordered ? (\n    <ol className={classes} {...(props as ComponentProps<\"ol\">)} />\n  ) : (\n    <ul className={classes} {...(props as ComponentProps<\"ul\">)} />\n  );\n}\n\n/**\n * A quotation set in from the text with a hanging quote mark. No side stripe: the indent,\n * the mark, and the secondary color set it apart.\n */\nexport function Blockquote({ className, children, ...props }: ComponentProps<\"blockquote\">) {\n  return (\n    <blockquote\n      className={cx(\"relative pl-6 text-[15px] leading-[1.7] text-pretty text-zinc-600 dark:text-zinc-400\", measure, className)}\n      {...props}\n    >\n      <span aria-hidden=\"true\" className=\"absolute top-0 left-0 text-[1.6em] leading-[1.1] font-medium text-zinc-300 select-none dark:text-zinc-600\">\n        &ldquo;\n      </span>\n      {children}\n    </blockquote>\n  );\n}\n\n/** Code inside a sentence: mono, on a faint well. */\nexport function InlineCode({ className, ...props }: ComponentProps<\"code\">) {\n  return (\n    <code\n      className={cx(\n        \"rounded-md border border-zinc-950/[0.08] bg-zinc-950/[0.03] px-[0.35em] py-px font-mono text-[0.86em] text-zinc-950\",\n        \"dark:border-white/[0.1] dark:bg-transparent dark:text-white\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n/** An inline link: primary color with a quiet underline that strengthens on hover. */\nexport function TextLink({ className, ...props }: ComponentProps<\"a\">) {\n  return (\n    <a\n      className={cx(\n        \"rounded-[2px] font-medium text-zinc-950 underline decoration-zinc-950/25 decoration-1 underline-offset-[3px]\",\n        \"transition-[text-decoration-color] duration-150 ease-out hover:decoration-zinc-950 motion-reduce:transition-none\",\n        \"dark:text-white dark:decoration-white/30 dark:hover:decoration-white\",\n        \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-500\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\n// Descendant styles for `Prose`, grouped by element. Same values as the parts above.\nconst prose = cx(\n  // Base and measure\n  \"text-[15px] leading-[1.7] text-pretty text-zinc-700 dark:text-zinc-300\",\n  measure,\n  \"[&>:first-child]:mt-0 [&>:last-child]:mb-0\",\n  // Headings\n  \"[&_h1]:mt-0 [&_h1]:mb-4 [&_h1]:text-[1.75rem] [&_h1]:leading-[1.2] [&_h1]:font-semibold [&_h1]:tracking-[-0.02em] [&_h1]:text-balance [&_h1]:text-zinc-950 dark:[&_h1]:text-white\",\n  \"[&_h2]:mt-12 [&_h2]:mb-3 [&_h2]:scroll-mt-20 [&_h2]:text-xl [&_h2]:leading-7 [&_h2]:font-semibold [&_h2]:tracking-[-0.01em] [&_h2]:text-balance [&_h2]:text-zinc-950 dark:[&_h2]:text-white\",\n  \"[&_h3]:mt-9 [&_h3]:mb-2 [&_h3]:scroll-mt-20 [&_h3]:text-base [&_h3]:leading-6 [&_h3]:font-semibold [&_h3]:text-zinc-950 dark:[&_h3]:text-white\",\n  \"[&_h4]:mt-7 [&_h4]:mb-2 [&_h4]:scroll-mt-20 [&_h4]:text-[15px] [&_h4]:leading-6 [&_h4]:font-semibold [&_h4]:text-zinc-950 dark:[&_h4]:text-white\",\n  // A heading straight after another heading sits closer.\n  \"[&_:is(h1,h2,h3,h4)+:is(h2,h3,h4)]:mt-3\",\n  // Paragraphs, lead, small print\n  \"[&_p]:my-5\",\n  \"[&_.lead]:text-[17px] [&_.lead]:leading-[1.6] [&_.lead]:text-zinc-600 dark:[&_.lead]:text-zinc-400\",\n  \"[&_small]:text-xs [&_small]:text-zinc-500\",\n  \"[&_strong]:font-semibold [&_strong]:text-zinc-950 dark:[&_strong]:text-white\",\n  // Links\n  \"[&_a]:rounded-[2px] [&_a]:font-medium [&_a]:text-zinc-950 [&_a]:underline [&_a]:decoration-zinc-950/25 [&_a]:decoration-1 [&_a]:underline-offset-[3px]\",\n  \"[&_a]:transition-[text-decoration-color] [&_a]:duration-150 [&_a]:ease-out [&_a:hover]:decoration-zinc-950 motion-reduce:[&_a]:transition-none\",\n  \"dark:[&_a]:text-white dark:[&_a]:decoration-white/30 dark:[&_a:hover]:decoration-white\",\n  \"[&_a:focus-visible]:outline-2 [&_a:focus-visible]:outline-offset-2 [&_a:focus-visible]:outline-sky-500\",\n  // Lists\n  \"[&_ul]:my-5 [&_ul]:list-disc [&_ul]:pl-5 [&_ul_li]:marker:text-zinc-400 dark:[&_ul_li]:marker:text-zinc-600\",\n  \"[&_ol]:my-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_ol_li]:marker:font-mono [&_ol_li]:marker:text-[13px] [&_ol_li]:marker:text-zinc-500 [&_ol_li]:marker:tabular-nums\",\n  \"[&_li]:my-1.5 [&_li]:pl-1.5 [&_li>p]:my-0 [&_li>:is(ul,ol)]:my-1.5\",\n  // Blockquote: indent and a hanging quote mark, no side stripe.\n  \"[&_blockquote]:relative [&_blockquote]:my-6 [&_blockquote]:pl-6 [&_blockquote]:text-zinc-600 dark:[&_blockquote]:text-zinc-400 [&_blockquote_p]:my-2\",\n  \"[&_blockquote]:before:absolute [&_blockquote]:before:top-0 [&_blockquote]:before:left-0 [&_blockquote]:before:text-[1.6em] [&_blockquote]:before:leading-[1.1] [&_blockquote]:before:font-medium [&_blockquote]:before:text-zinc-300 [&_blockquote]:before:content-['“'] dark:[&_blockquote]:before:text-zinc-600\",\n  // Code\n  \"[&_:not(pre)>code]:rounded-md [&_:not(pre)>code]:border [&_:not(pre)>code]:border-zinc-950/[0.08] [&_:not(pre)>code]:bg-zinc-950/[0.03] [&_:not(pre)>code]:px-[0.35em] [&_:not(pre)>code]:py-px\",\n  \"[&_code]:font-mono [&_code]:text-[0.86em] [&_code]:text-zinc-950 dark:[&_:not(pre)>code]:border-white/[0.1] dark:[&_:not(pre)>code]:bg-transparent dark:[&_code]:text-white\",\n  \"[&_pre]:my-6 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:border [&_pre]:border-zinc-950/[0.07] [&_pre]:bg-zinc-950/[0.02] [&_pre]:p-4 [&_pre]:text-[13px] [&_pre]:leading-relaxed\",\n  \"dark:[&_pre]:border-white/[0.08] dark:[&_pre]:bg-transparent [&_pre_code]:text-[1em] [&_pre_code]:text-zinc-800 dark:[&_pre_code]:text-zinc-200\",\n  \"[&_kbd]:rounded-md [&_kbd]:border [&_kbd]:border-zinc-950/12 [&_kbd]:px-1.5 [&_kbd]:py-px [&_kbd]:font-mono [&_kbd]:text-[0.8em] [&_kbd]:text-zinc-950 dark:[&_kbd]:border-white/15 dark:[&_kbd]:text-white\",\n  // Rules, media, tables\n  \"[&_hr]:my-10 [&_hr]:border-zinc-950/[0.07] dark:[&_hr]:border-white/[0.08]\",\n  \"[&_img]:my-6 [&_img]:rounded-xl [&_img]:border [&_img]:border-zinc-950/10 dark:[&_img]:border-white/10\",\n  \"[&_figure]:my-6 [&_figure_img]:my-0 [&_figcaption]:mt-2 [&_figcaption]:text-xs [&_figcaption]:text-zinc-500\",\n  \"[&_table]:my-6 [&_table]:w-full [&_table]:border-collapse [&_table]:text-sm [&_table]:leading-5\",\n  \"[&_th]:border-b [&_th]:border-zinc-950/10 [&_th]:py-2 [&_th]:pr-4 [&_th]:text-left [&_th]:text-xs [&_th]:font-medium [&_th]:text-zinc-500 dark:[&_th]:border-white/10\",\n  \"[&_td]:border-b [&_td]:border-zinc-950/[0.07] [&_td]:py-2.5 [&_td]:pr-4 [&_td]:align-top dark:[&_td]:border-white/[0.08]\",\n);\n\nexport interface ProseProps extends ComponentProps<\"div\"> {\n  /** Removes the 68ch cap, for a container that already sets its own width. */\n  fullWidth?: boolean;\n}\n\n/**\n * Styles arbitrary long-form HTML (rendered markdown, CMS fields) with the same type as the\n * parts above: headings, paragraphs, `p.lead`, lists, blockquotes, links, inline and block\n * code, `kbd`, rules, images, figures, and tables.\n */\nexport function Prose({ fullWidth = false, className, ...props }: ProseProps) {\n  return <div className={cx(prose, fullWidth && \"max-w-none\", className)} {...props} />;\n}\n"
    }
  ],
  "example": {
    "content": "import { H1, InlineCode, Lead, Muted, Prose, TextLink } from \"@/components/shaken/ui/typography\";\n\nexport default function TypographyExample() {\n  return (\n    <article className=\"grid w-full max-w-2xl gap-4 text-left\">\n      <Muted>Guides · 6 min read</Muted>\n      <H1>Rate limits for the Deployments API</H1>\n      <Lead>\n        Every token can make 600 requests per minute. When you go over, the API answers with{\" \"}\n        <InlineCode>429</InlineCode> and tells you when to retry. Read the <TextLink href=\"#headers\">response headers</TextLink>{\" \"}\n        instead of guessing.\n      </Lead>\n\n      {/* Prose styles plain HTML, such as rendered markdown. */}\n      <Prose className=\"mt-6\">\n        <h2 id=\"headers\">Reading the headers</h2>\n        <p>\n          Each response carries three headers. <strong>Remaining</strong> counts down within the current window, and the\n          reset time is a Unix timestamp in seconds.\n        </p>\n        <table>\n          <thead>\n            <tr>\n              <th>Header</th>\n              <th>Meaning</th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>\n                <code>x-ratelimit-limit</code>\n              </td>\n              <td>Requests allowed per window</td>\n            </tr>\n            <tr>\n              <td>\n                <code>x-ratelimit-remaining</code>\n              </td>\n              <td>Requests left in this window</td>\n            </tr>\n            <tr>\n              <td>\n                <code>retry-after</code>\n              </td>\n              <td>Seconds to wait after a 429</td>\n            </tr>\n          </tbody>\n        </table>\n\n        <h2>Backing off</h2>\n        <p>When a request is limited, wait and try again with a growing delay:</p>\n        <ol>\n          <li>\n            Wait for the number of seconds in <code>retry-after</code>.\n          </li>\n          <li>If the next request is also limited, double the wait, up to 60 seconds.</li>\n          <li>Add a little random jitter so many workers do not retry at the same moment.</li>\n        </ol>\n        <pre>\n          <code>{`const wait = Number(res.headers.get(\"retry-after\") ?? 1);\nawait sleep(Math.min(60, wait * 2 ** attempt) * 1000);`}</code>\n        </pre>\n\n        <h3>Batch jobs</h3>\n        <ul>\n          <li>Spread work across the window instead of sending it in one burst.</li>\n          <li>\n            Use a separate token per service so one noisy job cannot starve the others. Press <kbd>⌘</kbd> <kbd>K</kbd> in the\n            dashboard to create one.\n          </li>\n        </ul>\n        <blockquote>\n          <p>We cut our 429s to zero by honoring retry-after and adding jitter. It took ten lines.</p>\n        </blockquote>\n        <hr />\n        <p>\n          Need a higher limit for a launch? <a href=\"#support\">Contact support</a> with your expected peak and we will raise\n          it for the day.\n        </p>\n      </Prose>\n    </article>\n  );\n}\n"
  }
}
