{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A compact list of groceries with a small picture and an add button.",
  "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/grocery-list.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// GroceryListProps are the props of GroceryList; the values are the JSON shapes of the TypeScript props.\ntype GroceryListProps 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\tThumbs any `json:\"thumbs\"`\n\tCols any `json:\"cols\"`\n\tTone any `json:\"tone\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// Groceries as a compact list: a small square picture (or none), the name, the pack size, the price and an add button, in one or two columns. Axes: thumbs (show, hide), cols (1, 2), tone.\ntempl GroceryList(p GroceryListProps) {\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{{ vThumbs := uiutils.Def(p.Thumbs, \"show\") }}\n\t{{ vCols := uiutils.Def(p.Cols, \"2\") }}\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.List(compose.ListProps{BoxProps: box.BoxProps{Tag: \"ul\", Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vCols, \"2\")), \"grid grid-cols-1 gap-x-8 md:grid-cols-2\", \"grid grid-cols-1\")), Attrs: uiutils.Attrs(\"data-slot\", \"items\")}}) {\n\t\t\t\tfor _, vD := range uiutils.L(vDishes) {\n\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: \"flex items-center gap-4 border-b border-border py-2\", Attrs: uiutils.Attrs(\"data-slot\", \"item\")}}) {\n\t\t\t\t\t\tif uiutils.Eq(vThumbs, \"show\") {\n\t\t\t\t\t\t\t@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vD, \"name\"), Src: uiutils.Get(vD, \"image\"), Ratio: \"1/1\", Class: uiutils.Cnv(\"size-12 shrink-0\")})\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"0\", BoxProps: box.BoxProps{Class: \"min-w-0 flex-1\"}}) {\n\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{ uiutils.Text(uiutils.Get(vD, \"name\")) }\n\t\t\t\t\t\t\t}\n\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{ uiutils.Text(uiutils.Tpl(\"{0} · {1}\", uiutils.Get(vD, \"weight\"), uiutils.Get(vD, \"tag\"))) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-sm font-bold\"}}) {\n\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}\n\t\t\t\t\t\t@AddIcon(AddIconProps{Label: uiutils.Tpl(uiutils.Get(vLabels, \"addOf\"), uiutils.Get(vD, \"name\"))})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/grocery-list.templ",
      "target": "blocks/grocery-list.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "grocery-list",
  "registryDependencies": [
    "add-icon",
    "empty-state",
    "inline",
    "kit-box",
    "kit-text",
    "list",
    "list-item",
    "media-frame",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Grocery List",
  "type": "registry:block"
}
