{
  "$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\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"
    },
    {
      "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-->\n<script lang=\"ts\">\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</script>\n\n<script setup lang=\"ts\">\nimport Box from \"../compose/Box.vue\";\nimport Grid from \"../compose/Grid.vue\";\nimport Link from \"../compose/Link.vue\";\nimport List from \"../compose/List.vue\";\nimport ListItem from \"../compose/ListItem.vue\";\nimport Stack from \"../compose/Stack.vue\";\nimport Text from \"../compose/Text.vue\";\nimport Title from \"../compose/Title.vue\";\nimport EmptyState from \"../components/empty-state.vue\";\nimport NavBlock from \"../components/nav-block.vue\";\nimport SectionFrame from \"../components/section-frame.vue\";\nimport { cn, tpl, uniqLabel, urlOf } from \"../utils\";\n\nconst {\n  id,\n  title,\n  sections,\n  empty = \"\",\n  tocTitle,\n  layout = \"column\",\n  quotes = \"show\",\n  tone = \"default\",\n  landmarkLabel,\n} = defineProps<ArticleBodyProps>();\n</script>\n\n<template>\n  <SectionFrame :id=\"id\" :title=\"title\" :tone=\"tone\" :landmarkLabel=\"landmarkLabel\">\n    <EmptyState v-if=\"((sections?.length ?? 0) === 0)\" icon=\"file-text\" :title=\"empty\" />\n    <Grid v-else\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      <NavBlock v-if=\"((layout as string) === 'toc')\"\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            <ListItem v-for=\"s in sections\" :key=\"s.id\" 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          </List>\n        </Stack>\n      </NavBlock>\n      <Stack gap=\"8\" align=\"stretch\" class=\"mx-auto w-full max-w-2xl min-w-0\" data-slot=\"article\">\n        <Box\n          v-for=\"s in sections\"\n          :key=\"s.id\"\n          class=\"flex flex-col gap-4\"\n          :id=\"tpl('{0}-{1}', id, s.id)\"\n          data-slot=\"item\"\n        >\n          <Title :as=\"3\" size=\"2xl\" weight=\"bold\">\n            {{ s.title }}\n          </Title>\n          <Text size=\"base\">\n            {{ s.text }}\n          </Text>\n          <template v-if=\"((quotes as string) === 'show')\">\n            <Text v-if=\"s.quote\" tag=\"blockquote\" class=\"m-0 border-l border-border pl-4 text-lg\" data-slot=\"quote\">\n              {{ s.quote }}\n            </Text>\n          </template>\n        </Box>\n      </Stack>\n    </Grid>\n  </SectionFrame>\n</template>\n",
      "path": "blocks/article-body.vue",
      "target": "blocks/article-body.vue"
    }
  ],
  "meta": {
    "category": "content",
    "group": "blog",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "article-body",
  "registryDependencies": [
    "box",
    "empty-state",
    "grid",
    "link",
    "list",
    "list-item",
    "nav-block",
    "section-frame",
    "stack",
    "text",
    "title",
    "utils"
  ],
  "runtime": "vue",
  "title": "Article Body",
  "type": "registry:block"
}
