{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Dish cards that each open the dish page; no cart.",
  "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/dish-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\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// DishShowcaseProps are the props of DishShowcase; the values are the JSON shapes of the TypeScript props.\ntype DishShowcaseProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tLead any `json:\"lead\"`\n\tDishes any `json:\"dishes\"`\n\tEmpty any `json:\"empty\"`\n\tLabels any `json:\"labels\"`\n\tCols any `json:\"cols\"`\n\tRatio any `json:\"ratio\"`\n\tTone any `json:\"tone\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// A showcase of dishes: each card is one link to the dish page (picture, badge, name, weight, summary, price and an arrow). No cart here. Axes: cols (3, 4), ratio (4/3, 1/1), tone.\ntempl DishShowcase(p DishShowcaseProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vLead := uiutils.Def(p.Lead, \"\") }}\n\t{{ vDishes := p.Dishes }}\n\t{{ vEmpty := uiutils.Def(p.Empty, \"\") }}\n\t{{ vLabels := p.Labels }}\n\t{{ vCols := uiutils.Def(p.Cols, \"3\") }}\n\t{{ vRatio := uiutils.Def(p.Ratio, \"4/3\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\tif uiutils.Eq(uiutils.Len(vDishes), float64(0)) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"star\", Title: vEmpty})\n\t\t} else {\n\t\t\t@compose.Grid(compose.GridProps{Cols: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vCols, \"4\")), \"2-4\", \"1-3\")), BoxProps: box.BoxProps{Class: \"gap-8\", Attrs: uiutils.Attrs(\"data-slot\", \"items\")}}) {\n\t\t\t\tfor _, vD := range uiutils.L(vDishes) {\n\t\t\t\t\t@compose.Link(compose.LinkProps{Variant: \"block\", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Coalesce(uiutils.Get(vD, \"href\"), uiutils.Tpl(\"#/dish/{0}\", uiutils.Get(vD, \"id\"))), false), Class: \"group flex-col items-stretch gap-4\", Attrs: uiutils.Attrs(\"data-slot\", \"item\")}}) {\n\t\t\t\t\t\t@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vD, \"name\"), Src: uiutils.Get(vD, \"image\"), Ratio: vRatio})\n\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t\tif uiutils.T(uiutils.Get(vD, \"badge\")) {\n\t\t\t\t\t\t\t\t@compose.Badge(compose.BadgeProps{Variant: \"secondary\", Size: \"sm\", TextProps: text.TextProps{Class: \"w-fit\"}}) {\n\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vD, \"badge\")) }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"baseline\", Justify: \"between\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-lg font-semibold\"}}) {\n\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vD, \"name\")) }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-sm text-muted-foreground\"}}) {\n\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vD, \"weight\")) }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-sm font-normal text-muted-foreground\"}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vD, \"summary\")) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"center\", Justify: \"between\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-base font-bold\"}}) {\n\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(uiutils.Get(vD, \"price\"), uiutils.Get(vD, \"currency\"))) }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"flex items-center gap-2 text-sm text-primary\"}}) {\n\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"open\")) }\n\t\t\t\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"arrow-right\", Size: 16})\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/dish-showcase.templ",
      "target": "blocks/dish-showcase.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "dish-showcase",
  "registryDependencies": [
    "badge",
    "empty-state",
    "grid",
    "group",
    "inline",
    "kit-box",
    "kit-link",
    "kit-text",
    "link",
    "lucide-icon",
    "media-frame",
    "section-frame",
    "stack",
    "utils"
  ],
  "runtime": "templ",
  "title": "Dish Showcase",
  "type": "registry:block"
}
