{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A dish as a card: picture, category, portion/weight, price and an order button. No rating.",
  "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-card.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/ui/link\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// DishCardProps are the props of DishCard; the values are the JSON shapes of the TypeScript props.\ntype DishCardProps struct {\n\tDish any `json:\"dish\"`\n\tLabels any `json:\"labels\"`\n\tLayout any `json:\"layout\"`\n\tMedia any `json:\"media\"`\n\tPrices any `json:\"prices\"`\n\tAction any `json:\"action\"`\n\tDensity any `json:\"density\"`\n}\n\n// A dish as a card: picture, optional badge, category, name, portion/weight, summary, price and an order button. No rating. Axes: layout (vertical, horizontal), media (image, none), density, action (button, none). Records map from Codex kind `dish`.\ntempl DishCard(p DishCardProps) {\n\t{{ vDish := p.Dish }}\n\t{{ vLabels := p.Labels }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"vertical\") }}\n\t{{ vMedia := uiutils.Def(p.Media, \"image\") }}\n\t{{ vPrices := uiutils.Def(p.Prices, \"show\") }}\n\t{{ vAction := uiutils.Def(p.Action, \"button\") }}\n\t{{ vDensity := uiutils.Def(p.Density, \"default\") }}\n\t@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: \"article\", Class: uiutils.S(uiutils.Cnv(\"flex flex-col gap-8 bg-card p-6 text-card-foreground inset-ring inset-ring-border rounded\", \"h-full gap-4 overflow-hidden\", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"horizontal\")), \"flex flex-col sm:flex-row\", \"flex flex-col\"))), Attrs: uiutils.Attrs(\"data-slot\", \"card\", \"data-layout\", vLayout)}}) {\n\t\tif uiutils.Eq(vMedia, \"image\") {\n\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"relative shrink-0\", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"horizontal\")), \"sm:w-48\", \"\")))}}) {\n\t\t\t\t@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vDish, \"name\"), Src: uiutils.Get(vDish, \"image\"), Ratio: \"4/3\", Class: uiutils.Cnv(\"h-full\")})\n\t\t\t\tif uiutils.T(uiutils.Get(vDish, \"badge\")) {\n\t\t\t\t\t@compose.Badge(compose.BadgeProps{Variant: \"default\", Size: \"default\", TextProps: text.TextProps{Class: \"absolute left-4 top-4\"}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDish, \"badge\")) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@compose.CardContent(compose.CardContentProps{BoxProps: box.BoxProps{Class: \"flex flex-1 flex-col gap-2\"}}) {\n\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"center\", BoxProps: box.BoxProps{Class: \"flex-wrap\"}}) {\n\t\t\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"uppercase tracking-wide text-muted-foreground\", Attrs: uiutils.Attrs(\"data-slot\", \"category\")}}) {\n\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDish, \"tag\")) }\n\t\t\t\t}\n\t\t\t\tif uiutils.Eq(vMedia, \"none\") {\n\t\t\t\t\tif uiutils.T(uiutils.Get(vDish, \"badge\")) {\n\t\t\t\t\t\t@compose.Badge(compose.BadgeProps{Variant: \"secondary\", Size: \"sm\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDish, \"badge\")) }\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\t@compose.Title(compose.TitleProps{As: \"3\", Size: \"base\", Weight: \"bold\", TextProps: text.TextProps{}}) {\n\t\t\t\tif uiutils.T(uiutils.Get(vDish, \"href\")) {\n\t\t\t\t\t@compose.Link(compose.LinkProps{Variant: \"default\", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Get(vDish, \"href\"), false), Attrs: uiutils.Attrs(\"data-slot\", \"open\")}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDish, \"name\")) }\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDish, \"name\")) }\n\t\t\t\t}\n\t\t\t}\n\t\t\tif uiutils.T(uiutils.Get(vDish, \"weight\")) {\n\t\t\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"text-muted-foreground\", Attrs: uiutils.Attrs(\"data-slot\", \"portion\")}}) {\n\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDish, \"weight\")) }\n\t\t\t\t}\n\t\t\t}\n\t\t\tif uiutils.Eq(vDensity, \"default\") {\n\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDish, \"summary\")) }\n\t\t\t\t}\n\t\t\t}\n\t\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Justify: \"between\", BoxProps: box.BoxProps{Class: \"mt-auto pt-2\"}}) {\n\t\t\t\tif uiutils.Eq(vPrices, \"show\") {\n\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"xl\", Weight: \"bold\", TextProps: text.TextProps{Attrs: uiutils.Attrs(\"data-slot\", \"price\")}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(uiutils.Get(vDish, \"price\"), uiutils.Get(vDish, \"currency\"))) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif uiutils.Eq(vAction, \"button\") {\n\t\t\t\t\t@compose.Button(compose.ButtonProps{Variant: \"default\", Size: \"sm\", ButtonProps: button.ButtonProps{Type: \"button\"}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"add\")) }\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-card.templ",
      "target": "blocks/dish-card.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "restaurant",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "dish-card",
  "registryDependencies": [
    "badge",
    "block",
    "box",
    "button",
    "card-content",
    "group",
    "kit-box",
    "kit-button",
    "kit-link",
    "kit-text",
    "link",
    "media-frame",
    "text",
    "title",
    "utils"
  ],
  "runtime": "templ",
  "title": "Dish Card",
  "type": "registry:block"
}
