{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A top bar whose first item opens a wide panel of link groups, with an optional promo card.",
  "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/mega-menu.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/button\"\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/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// MegaMenuProps are the props of MegaMenu; the values are the JSON shapes of the TypeScript props.\ntype MegaMenuProps struct {\n\tLabel any `json:\"label\"`\n\tBrand any `json:\"brand\"`\n\tBrandHref any `json:\"brandHref\"`\n\tTrigger any `json:\"trigger\"`\n\tLinks any `json:\"links\"`\n\tGroups any `json:\"groups\"`\n\tPromoTitle any `json:\"promoTitle\"`\n\tPromoText any `json:\"promoText\"`\n\tPanel any `json:\"panel\"`\n\tCols any `json:\"cols\"`\n\tPromo any `json:\"promo\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// A top bar whose first item opens a wide panel of link groups, each with an icon and a list, and an optional promo card. The page keeps `open`; opening on hover or click is a port contract. Axes: panel (open, closed), cols (2, 3), promo (none, card).\ntempl MegaMenu(p MegaMenuProps) {\n\t{{ vLabel := p.Label }}\n\t{{ vBrand := p.Brand }}\n\t{{ vBrandHref := p.BrandHref }}\n\t{{ vTrigger := p.Trigger }}\n\t{{ vLinks := p.Links }}\n\t{{ vGroups := p.Groups }}\n\t{{ vPromoTitle := p.PromoTitle }}\n\t{{ vPromoText := p.PromoText }}\n\t{{ vPanel := uiutils.Def(p.Panel, \"open\") }}\n\t{{ vCols := uiutils.Def(p.Cols, \"3\") }}\n\t{{ vPromo := uiutils.Def(p.Promo, \"none\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: \"header\", Class: \"relative border-b border-border bg-background\", Attrs: uiutils.Attrs(\"aria-label\", vLandmarkLabel, \"data-slot\", \"mega-menu\")}}) {\n\t\t@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"mx-auto w-full max-w-6xl px-4\", \"flex flex-wrap items-center gap-6 py-4\")), Attrs: uiutils.Attrs(\"data-slot\", \"container\")}}) {\n\t\t\t@MenuEntry(MenuEntryProps{Href: vBrandHref, Class: uiutils.Cnv(\"text-lg font-medium\"), Testid: \"brand\"}) {\n\t\t\t\t{ uiutils.Text(vBrand) }\n\t\t\t}\n\t\t\t@NavBlock(NavBlockProps{Label: uiutils.Cond(uiutils.T(vLandmarkLabel), uiutils.Uniq(uiutils.Tpl(\"{0}, {1}\", vLabel, vLandmarkLabel)), vLabel), Class: uiutils.Cnv(\"flex-1\")}) {\n\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", BoxProps: box.BoxProps{Class: \"flex-wrap\"}}) {\n\t\t\t\t\t@compose.ButtonPlain(compose.ButtonPlainProps{ButtonProps: button.ButtonProps{Type: \"button\", Class: \"inline-flex items-center gap-2 text-sm font-semibold\", Attrs: uiutils.Attrs(\"aria-expanded\", uiutils.Cond(uiutils.T(uiutils.Eq(vPanel, \"open\")), \"true\", \"false\"), \"data-slot\", \"mega-trigger\")}}) {\n\t\t\t\t\t\t{ uiutils.Text(vTrigger) }\n\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"chevron-down\", Size: 16})\n\t\t\t\t\t}\n\t\t\t\t\tfor _, vL := range uiutils.L(vLinks) {\n\t\t\t\t\t\t@MenuEntry(MenuEntryProps{Href: uiutils.Get(vL, \"href\"), Class: uiutils.Cnv(\"text-sm\"), Current: uiutils.Eq(uiutils.Get(vL, \"id\"), \"\"), Testid: \"nav-link\"}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vL, \"name\")) }\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\tif uiutils.Eq(vPanel, \"open\") {\n\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"border-t border-border bg-card\", Attrs: uiutils.Attrs(\"data-slot\", \"mega-panel\")}}) {\n\t\t\t@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"mx-auto w-full max-w-6xl px-4\", \"grid gap-8 py-6\", uiutils.Cond(uiutils.T(uiutils.Eq(vPromo, \"card\")), \"md:grid-cols-[1fr_16rem]\", \"\"))), Attrs: uiutils.Attrs(\"data-slot\", \"container\")}}) {\n\t\t\t\tif uiutils.Gt(uiutils.Len(vGroups), float64(0)) {\n\t\t\t\t\t@compose.Grid(compose.GridProps{Cols: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vCols, \"2\")), \"1-2\", \"1-3\")), BoxProps: box.BoxProps{Class: \"gap-6\", Attrs: uiutils.Attrs(\"data-slot\", \"items\")}}) {\n\t\t\t\t\t\tfor _, vG := range uiutils.L(vGroups) {\n\t\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"item\")}}) {\n\t\t\t\t\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"center\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Get(vG, \"icon\")), Size: 16})\n\t\t\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\t\t{ uiutils.Text(uiutils.Get(vG, \"title\")) }\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\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\t\tfor _, vItem := range uiutils.L(uiutils.Get(vG, \"links\")) {\n\t\t\t\t\t\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"links-row\")}}) {\n\t\t\t\t\t\t\t\t\t\t\t@MenuEntry(MenuEntryProps{Href: uiutils.Get(vItem, \"href\"), Class: uiutils.Cnv(\"text-sm text-muted-foreground\")}) {\n\t\t\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vItem, \"name\")) }\n\t\t\t\t\t\t\t\t\t\t\t}\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\tif uiutils.Eq(vPromo, \"card\") {\n\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", BoxProps: box.BoxProps{Class: \"rounded bg-card inset-ring inset-ring-border p-4\", Attrs: uiutils.Attrs(\"data-slot\", \"promo\")}}) {\n\t\t\t\t\t\t@MediaFrame(MediaFrameProps{Alt: uiutils.Coalesce(vPromoTitle, \"\"), Ratio: \"4/3\"})\n\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"base\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(vPromoTitle) }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(vPromoText) }\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/mega-menu.templ",
      "target": "blocks/mega-menu.templ"
    }
  ],
  "meta": {
    "category": "marketing",
    "group": "navigation",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "mega-menu",
  "registryDependencies": [
    "block",
    "box",
    "button-plain",
    "container",
    "grid",
    "group",
    "kit-box",
    "kit-button",
    "kit-text",
    "list",
    "list-item",
    "lucide-icon",
    "media-frame",
    "menu-entry",
    "nav-block",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Mega Menu",
  "type": "registry:block"
}
