{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Four small post cards beside an intro with a view-all link; the first post in detail beside its picture; or cards with the text on a panel over the picture, in two or three columns.",
  "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/post-showcase.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/icons\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/link\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// PostShowcaseProps are the props of PostShowcase; the values are the JSON shapes of the TypeScript props.\ntype PostShowcaseProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tLead any `json:\"lead\"`\n\tBadge any `json:\"badge\"`\n\tPosts any `json:\"posts\"`\n\tLabels any `json:\"labels\"`\n\tAction any `json:\"action\"`\n\tLayout any `json:\"layout\"`\n\tCols any `json:\"cols\"`\n\tMediaSide any `json:\"mediaSide\"`\n\tTone any `json:\"tone\"`\n\tEmpty any `json:\"empty\"`\n\tImage any `json:\"image\"`\n\tImageAlt any `json:\"imageAlt\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// Posts shown off. Axes: layout (intro: four small post cards beside the intro with a view-all link, featured: the first post in detail beside its picture, overlay: cards with the text over the picture), cols (2, 3: overlay columns), mediaSide, tone.\ntempl PostShowcase(p PostShowcaseProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vLead := uiutils.Def(p.Lead, \"\") }}\n\t{{ vBadge := uiutils.Def(p.Badge, \"\") }}\n\t{{ vPosts := p.Posts }}\n\t{{ vLabels := p.Labels }}\n\t{{ vAction := p.Action }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"intro\") }}\n\t{{ vCols := uiutils.Def(p.Cols, \"3\") }}\n\t{{ vMediaSide := uiutils.Def(p.MediaSide, \"start\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vEmpty := uiutils.Def(p.Empty, \"\") }}\n\t{{ vImage := p.Image }}\n\t{{ vImageAlt := p.ImageAlt }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\tif uiutils.Eq(uiutils.Len(vPosts), float64(0)) {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{\"badge\": vBadge}, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"newspaper\", Title: vEmpty})\n\t\t}\n\t} else if uiutils.Eq(vLayout, \"intro\") {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{\"badge\": vBadge}, Tone: vTone, Layout: \"split\", Media: map[string]any{\"show\": true, \"side\": vMediaSide}, LandmarkLabel: vLandmarkLabel, Aside: postShowcaseFill1(p, vPosts, vLabels)}) {\n\t\t\t@compose.Link(compose.LinkProps{Size: \"sm\", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Get(vAction, \"href\"), false), Attrs: uiutils.Attrs(\"data-slot\", \"section-action\")}}) {\n\t\t\t\t{ uiutils.Text(uiutils.Get(vAction, \"label\")) }\n\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"arrow-right\", Size: 16})\n\t\t\t}\n\t\t}\n\t} else if uiutils.Eq(vLayout, \"featured\") {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{\"badge\": vBadge}, Tone: vTone, Layout: \"split\", Media: map[string]any{\"show\": true, \"side\": vMediaSide}, LandmarkLabel: vLandmarkLabel, Aside: postShowcaseFill2(p, vTitle, vImage, vImageAlt)}) {\n\t\t\tfor vI, vP := range uiutils.L(vPosts) {\n\t\t\t\tif uiutils.Lt(float64(vI), float64(1)) {\n\t\t\t\t\t@PostFeature(PostFeatureProps{P: vP, Labels: vLabels})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{\"badge\": vBadge}, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vCols, \"2\")), \"grid grid-cols-1 gap-6 md:grid-cols-2\", \"grid grid-cols-1 gap-6 md:grid-cols-3\"))}}) {\n\t\t\t\tfor vI, vP := range uiutils.L(vPosts) {\n\t\t\t\t\tif uiutils.T(uiutils.Lt(float64(vI), uiutils.Cond(uiutils.T(uiutils.Eq(vCols, \"2\")), float64(2), float64(3)))) {\n\t\t\t\t\t\t@PostOverlayCard(PostOverlayCardProps{P: vP, Labels: vLabels, Ratio: uiutils.Cond(uiutils.T(uiutils.Eq(vCols, \"2\")), \"16/9\", \"4/3\")})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\ntempl postShowcaseFill1(p PostShowcaseProps, vPosts any, vLabels any) {\n\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"grid grid-cols-1 gap-4 sm:grid-cols-2\"}}) {\n\t\tfor vI, vP := range uiutils.L(vPosts) {\n\t\t\tif uiutils.Lt(float64(vI), float64(4)) {\n\t\t\t\t@PostMiniCard(PostMiniCardProps{P: vP, Labels: vLabels})\n\t\t\t}\n\t\t}\n\t}\n}\n\ntempl postShowcaseFill2(p PostShowcaseProps, vTitle any, vImage any, vImageAlt any) {\n\t@MediaFrame(MediaFrameProps{Alt: uiutils.Cond(uiutils.T(vImageAlt), vImageAlt, vTitle), Src: vImage, Ratio: \"4/3\"})\n}\n",
      "path": "blocks/post-showcase.templ",
      "target": "blocks/post-showcase.templ"
    }
  ],
  "meta": {
    "category": "content",
    "group": "blog",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "post-showcase",
  "registryDependencies": [
    "box",
    "empty-state",
    "kit-box",
    "kit-link",
    "link",
    "lucide-icon",
    "media-frame",
    "post-feature",
    "post-mini-card",
    "post-overlay-card",
    "section-frame",
    "utils"
  ],
  "runtime": "templ",
  "title": "Post Showcase",
  "type": "registry:block"
}
