{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Cards with a quantity field and an add button, under a live cart count.",
  "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-cart-grid.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/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// DishCartGridProps are the props of DishCartGrid; the values are the JSON shapes of the TypeScript props.\ntype DishCartGridProps 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\tCount any `json:\"count\"`\n\tMedia any `json:\"media\"`\n\tTone any `json:\"tone\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// Dishes added to the cart from the card: the live cart count over a grid of cards, each with a picture, name, weight, price and a quantity field named after the dish beside the add button. Axes: media (image, none), tone.\ntempl DishCartGrid(p DishCartGridProps) {\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{{ vCount := uiutils.Def(p.Count, float64(0)) }}\n\t{{ vMedia := uiutils.Def(p.Media, \"image\") }}\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: \"shopping-bag\", Title: vEmpty})\n\t\t} else {\n\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", Align: \"stretch\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t@compose.Group(compose.GroupProps{Justify: \"end\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t@CartCount(CartCountProps{Count: vCount, Label: uiutils.Get(vLabels, \"inCart\")})\n\t\t\t\t}\n\t\t\t\t@compose.Grid(compose.GridProps{Cols: \"1-3\", BoxProps: box.BoxProps{Class: \"gap-4\", Attrs: uiutils.Attrs(\"data-slot\", \"items\")}}) {\n\t\t\t\t\tfor _, vD := range uiutils.L(vDishes) {\n\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", BoxProps: box.BoxProps{Class: \"rounded bg-card inset-ring inset-ring-border overflow-hidden pb-4\", Attrs: uiutils.Attrs(\"data-slot\", \"item\")}}) {\n\t\t\t\t\t\t\tif uiutils.Eq(vMedia, \"image\") {\n\t\t\t\t\t\t\t\t@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vD, \"name\"), Src: uiutils.Get(vD, \"image\")})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vMedia, \"image\")), \"px-4\", \"px-4 pt-4\"))}}) {\n\t\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\t@compose.Text(compose.TextProps{Size: \"base\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vD, \"name\")) }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\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\t\t\t{ uiutils.Text(uiutils.Get(vD, \"weight\")) }\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.Text(compose.TextProps{Size: \"lg\", Weight: \"bold\", TextProps: text.TextProps{}}) {\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}\n\t\t\t\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"px-4\"}}) {\n\t\t\t\t\t\t\t\t@AddQty(AddQtyProps{Name: uiutils.Tpl(\"{0}-qty-{1}\", vId, uiutils.Get(vD, \"id\")), Dish: uiutils.Get(vD, \"name\"), Labels: vLabels})\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-cart-grid.templ",
      "target": "blocks/dish-cart-grid.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "dish-cart-grid",
  "registryDependencies": [
    "add-qty",
    "box",
    "cart-count",
    "empty-state",
    "grid",
    "group",
    "kit-box",
    "kit-text",
    "media-frame",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Dish Cart Grid",
  "type": "registry:block"
}
