{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A long read in one reading column, or beside a table of contents that links to the sections.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n/**\n * A long read: sections with headings, text and an optional pull quote, in one reading column or beside a table\n * of contents that links to each section. Axes: layout (column, toc), quotes (show, hide), tone. Highlighting\n * the section being read is a port contract.\n */\nimport { For, type JSX } from \"solid-js\";\nimport { Box, Grid, Link, List, ListItem, Stack, Text, Title } from \"../compose\";\nimport { EmptyState } from \"../components/empty-state\";\nimport { NavBlock } from \"../components/nav-block\";\nimport { SectionFrame } from \"../components/section-frame\";\nimport { cn, tpl, uniqLabel, urlOf } from \"../utils\";\nimport type { Section } from \"./article-body.types\";\n\nexport type ArticleBodyProps = {\n  id: string;\n  title: string;\n  sections: Section[];\n  empty?: string;\n  tocTitle: string;\n  layout?: \"column\" | \"toc\";\n  quotes?: \"show\" | \"hide\";\n  tone?: \"default\" | \"muted\";\n  landmarkLabel?: string;\n};\n\nexport function ArticleBody({\n  id,\n  title,\n  sections,\n  empty = \"\",\n  tocTitle,\n  layout = \"column\",\n  quotes = \"show\",\n  tone = \"default\",\n  landmarkLabel,\n}: ArticleBodyProps) {\n  return (\n    <SectionFrame id={id} title={title} tone={tone} landmarkLabel={landmarkLabel}>\n      {((sections?.length ?? 0) === 0) ? (\n        <EmptyState icon=\"file-text\" title={empty} />\n      ) : (\n        <Grid\n          cols=\"1\"\n          class={cn(\n            \"items-start gap-8\",\n            (((layout as string) === \"toc\") ? \"md:grid-cols-[14rem_minmax(0,1fr)]\" : \"\")\n          )}\n        >\n          {((layout as string) === \"toc\") ? (\n            <NavBlock\n              label={(landmarkLabel ? uniqLabel(tpl(\"{0}, {1}\", tocTitle, landmarkLabel)) : tocTitle)}\n              class=\"md:sticky md:top-4\"\n              testid=\"toc\"\n            >\n              <Stack gap=\"2\">\n                <Text size=\"sm\" weight=\"semibold\">\n                  {tocTitle}\n                </Text>\n                <List class=\"m-0 flex list-none flex-col gap-2 p-0\">\n                  <For each={sections ?? []}>{(s) => (\n                    <ListItem data-slot=\"sections-row\">\n                      <Link\n                        href={urlOf(tpl(\"#{0}-{1}\", id, s.id))}\n                        variant=\"default\"\n                        class=\"text-sm text-muted-foreground\"\n                        data-slot=\"toc-link\"\n                      >\n                        {s.title}\n                      </Link>\n                    </ListItem>\n                  )}</For>\n                </List>\n              </Stack>\n            </NavBlock>\n          ) : null}\n          <Stack gap=\"8\" align=\"stretch\" class=\"mx-auto w-full max-w-2xl min-w-0\" data-slot=\"article\">\n            <For each={sections ?? []}>{(s) => (\n              <Box class=\"flex flex-col gap-4\" id={tpl(\"{0}-{1}\", id, s.id)} data-slot=\"item\">\n                <Title as={3} size=\"2xl\" weight=\"bold\">\n                  {s.title}\n                </Title>\n                <Text size=\"base\">\n                  {s.text}\n                </Text>\n                {((quotes as string) === \"show\") ? (\n                  <>\n                    {s.quote ? (\n                      <Text tag=\"blockquote\" class=\"m-0 border-l border-border pl-4 text-lg\" data-slot=\"quote\">\n                        {s.quote}\n                      </Text>\n                    ) : null}\n                  </>\n                ) : null}\n              </Box>\n            )}</For>\n          </Stack>\n        </Grid>\n      )}\n    </SectionFrame>\n  );\n}\n",
      "path": "blocks/article-body.tsx",
      "target": "blocks/article-body.tsx"
    },
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n\nexport type Section = {\n  id: string;\n  title: string;\n  text: string;\n  quote: string;\n};\n",
      "path": "blocks/article-body.types.ts",
      "target": "blocks/article-body.types.ts"
    }
  ],
  "meta": {
    "category": "content",
    "group": "blog",
    "kind": "block",
    "tags": [
      "solid",
      "block"
    ]
  },
  "name": "article-body",
  "registryDependencies": [
    "compose",
    "empty-state",
    "nav-block",
    "section-frame",
    "utils"
  ],
  "runtime": "solid",
  "title": "Article Body",
  "type": "registry:block"
}
