{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The head of a section: an optional badge, the heading (h1 or h2) with an optional link opposite it, and an optional lead. No wrapper: its parts are children of the section stack.",
  "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/patterns/section-header.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// SectionHeaderProps are the props of SectionHeader; the values are the JSON shapes of the TypeScript props.\ntype SectionHeaderProps struct {\n\tTitleId any `json:\"titleId\"`\n\tTitle any `json:\"title\"`\n\tHeading any `json:\"heading\"`\n\tAction any `json:\"action\"`\n\tLead any `json:\"lead\"`\n\tCenter any `json:\"center\"`\n}\n\n// The head of a section: an optional badge, the heading (h1 or h2) with an optional link opposite it, and an optional lead. No wrapper: its parts are children of the section stack.\ntempl SectionHeader(p SectionHeaderProps) {\n\t{{ vTitleId := p.TitleId }}\n\t{{ vTitle := uiutils.Def(p.Title, \"\") }}\n\t{{ vHeading := p.Heading }}\n\t{{ vAction := p.Action }}\n\t{{ vLead := p.Lead }}\n\t{{ vCenter := uiutils.Def(p.Center, false) }}\n\t{{ vLevel := any(uiutils.Coalesce(uiutils.Get(vHeading, \"level\"), float64(2))) }}\n\t{{ vScale := any(uiutils.Coalesce(uiutils.Get(vHeading, \"scale\"), \"default\")) }}\n\t{{ vHasAction := any(uiutils.And(uiutils.Get(vAction, \"label\"), uiutils.Get(vAction, \"href\"))) }}\n\tif uiutils.T(uiutils.Get(vHeading, \"badge\")) {\n\t\t@compose.Badge(compose.BadgeProps{Variant: \"outline\", Size: \"lg\", TextProps: text.TextProps{Class: uiutils.S(uiutils.Cond(uiutils.T(vCenter), \"mx-auto w-fit\", \"w-fit\"))}}) {\n\t\t\t{ uiutils.Text(uiutils.Get(vHeading, \"badge\")) }\n\t\t}\n\t}\n\tif uiutils.T(uiutils.And(!uiutils.Eq(vTitle, \"\"), vHasAction)) {\n\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", Justify: \"between\", BoxProps: box.BoxProps{Class: \"w-full flex-wrap\", Attrs: uiutils.Attrs(\"data-slot\", \"section-header\")}}) {\n\t\t\t@compose.Title(compose.TitleProps{As: uiutils.S(vLevel), Size: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLevel, float64(1))), \"5xl\", \"xl\")), Weight: \"semibold\", TextProps: text.TextProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vScale, \"display\")), \"text-6xl tracking-tight md:text-8xl\", uiutils.Cond(uiutils.T(uiutils.Eq(vLevel, float64(1))), \"leading-tight\", \"leading-7\"))), Attrs: uiutils.Attrs(\"id\", vTitleId)}}) {\n\t\t\t\t{ uiutils.Text(vTitle) }\n\t\t\t}\n\t\t\t@compose.Link(compose.LinkProps{Variant: \"default\", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Get(vAction, \"href\"), false), Class: uiutils.S(uiutils.Cnv(uiutils.Get(presetDefaults, \"text\", \"tiny\"), \"shrink-0 font-medium leading-5\")), Attrs: uiutils.Attrs(\"data-slot\", \"section-action\")}}) {\n\t\t\t\t{ uiutils.Text(uiutils.Get(vAction, \"label\")) }\n\t\t\t}\n\t\t}\n\t}\n\tif uiutils.T(uiutils.And(!uiutils.Eq(vTitle, \"\"), !uiutils.T(vHasAction))) {\n\t\t@compose.Title(compose.TitleProps{As: uiutils.S(vLevel), Size: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLevel, float64(1))), \"5xl\", \"xl\")), Weight: \"semibold\", TextProps: text.TextProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vScale, \"display\")), \"text-6xl tracking-tight md:text-8xl\", uiutils.Cond(uiutils.T(uiutils.Eq(vLevel, float64(1))), \"leading-tight\", \"leading-7\"))), Attrs: uiutils.Attrs(\"id\", vTitleId, \"data-slot\", \"section-header\")}}) {\n\t\t\t{ uiutils.Text(vTitle) }\n\t\t}\n\t}\n\tif uiutils.T(uiutils.And(uiutils.Eq(vTitle, \"\"), vHasAction)) {\n\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", Justify: \"end\", BoxProps: box.BoxProps{Class: \"w-full\", Attrs: uiutils.Attrs(\"data-slot\", \"section-header\")}}) {\n\t\t\t@compose.Link(compose.LinkProps{Variant: \"default\", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Get(vAction, \"href\"), false), Class: uiutils.S(uiutils.Cnv(uiutils.Get(presetDefaults, \"text\", \"tiny\"), \"shrink-0 font-medium leading-5\")), Attrs: uiutils.Attrs(\"data-slot\", \"section-action\")}}) {\n\t\t\t\t{ uiutils.Text(uiutils.Get(vAction, \"label\")) }\n\t\t\t}\n\t\t}\n\t}\n\tif uiutils.T(vLead) {\n\t\t@compose.Text(compose.TextProps{Size: \"base\", TextProps: text.TextProps{Class: uiutils.S(uiutils.Cnv(\"max-w-2xl text-muted-foreground\", uiutils.Cond(uiutils.T(vCenter), \"mx-auto\", \"\"))), Attrs: uiutils.Attrs(\"data-slot\", \"section-header\")}}) {\n\t\t\t{ uiutils.Text(vLead) }\n\t\t}\n\t}\n}\n",
      "path": "blocks/section-header.templ",
      "target": "blocks/section-header.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "section-header",
  "registryDependencies": [
    "badge",
    "group",
    "kit-box",
    "kit-link",
    "kit-text",
    "link",
    "presets",
    "text",
    "title",
    "utils"
  ],
  "runtime": "templ",
  "title": "Section Header",
  "type": "registry:component"
}
