{
  "$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/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/organisms/article-body.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/link\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// ArticleBodyProps are the props of ArticleBody; the values are the JSON shapes of the TypeScript props.\ntype ArticleBodyProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tSections any `json:\"sections\"`\n\tEmpty any `json:\"empty\"`\n\tTocTitle any `json:\"tocTitle\"`\n\tLayout any `json:\"layout\"`\n\tQuotes any `json:\"quotes\"`\n\tTone any `json:\"tone\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// A long read: sections with headings, text and an optional pull quote, in one reading column or beside a table of contents that links to each section. Axes: layout (column, toc), quotes (show, hide), tone. Highlighting the section being read is a port contract.\ntempl ArticleBody(p ArticleBodyProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vSections := p.Sections }}\n\t{{ vEmpty := uiutils.Def(p.Empty, \"\") }}\n\t{{ vTocTitle := p.TocTitle }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"column\") }}\n\t{{ vQuotes := uiutils.Def(p.Quotes, \"show\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\tif uiutils.Eq(uiutils.Len(vSections), float64(0)) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"file-text\", Title: vEmpty})\n\t\t} else {\n\t\t\t@compose.Grid(compose.GridProps{Cols: \"1\", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"items-start gap-8\", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"toc\")), \"md:grid-cols-[14rem_minmax(0,1fr)]\", \"\")))}}) {\n\t\t\t\tif uiutils.Eq(vLayout, \"toc\") {\n\t\t\t\t\t@NavBlock(NavBlockProps{Label: uiutils.Cond(uiutils.T(vLandmarkLabel), uiutils.Uniq(uiutils.Tpl(\"{0}, {1}\", vTocTitle, vLandmarkLabel)), vTocTitle), Class: uiutils.Cnv(\"md:sticky md:top-4\"), Testid: \"toc\"}) {\n\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(vTocTitle) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.List(compose.ListProps{BoxProps: box.BoxProps{Class: \"m-0 flex list-none flex-col gap-2 p-0\"}}) {\n\t\t\t\t\t\t\t\tfor _, vS := range uiutils.L(vSections) {\n\t\t\t\t\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"sections-row\")}}) {\n\t\t\t\t\t\t\t\t\t\t@compose.Link(compose.LinkProps{Variant: \"default\", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Tpl(\"#{0}-{1}\", vId, uiutils.Get(vS, \"id\")), false), Class: \"text-sm text-muted-foreground\", Attrs: uiutils.Attrs(\"data-slot\", \"toc-link\")}}) {\n\t\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vS, \"title\")) }\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"8\", Align: \"stretch\", BoxProps: box.BoxProps{Class: \"mx-auto w-full max-w-2xl min-w-0\", Attrs: uiutils.Attrs(\"data-slot\", \"article\")}}) {\n\t\t\t\t\tfor _, vS := range uiutils.L(vSections) {\n\t\t\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"flex flex-col gap-4\", Attrs: uiutils.Attrs(\"id\", uiutils.Tpl(\"{0}-{1}\", vId, uiutils.Get(vS, \"id\")), \"data-slot\", \"item\")}}) {\n\t\t\t\t\t\t\t@compose.Title(compose.TitleProps{As: \"3\", Size: \"2xl\", Weight: \"bold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vS, \"title\")) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"base\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vS, \"text\")) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif uiutils.Eq(vQuotes, \"show\") {\n\t\t\t\t\t\t\t\tif uiutils.T(uiutils.Get(vS, \"quote\")) {\n\t\t\t\t\t\t\t\t\t@compose.Text(compose.TextProps{TextProps: text.TextProps{Tag: \"blockquote\", Class: \"m-0 border-l border-border pl-4 text-lg\", Attrs: uiutils.Attrs(\"data-slot\", \"quote\")}}) {\n\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vS, \"quote\")) }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/article-body.templ",
      "target": "blocks/article-body.templ"
    }
  ],
  "meta": {
    "category": "content",
    "group": "blog",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "article-body",
  "registryDependencies": [
    "box",
    "empty-state",
    "grid",
    "kit-box",
    "kit-link",
    "kit-text",
    "link",
    "list",
    "list-item",
    "nav-block",
    "section-frame",
    "stack",
    "text",
    "title",
    "utils"
  ],
  "runtime": "templ",
  "title": "Article Body",
  "type": "registry:block"
}
