{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The lines of a cart as a table or as cards.",
  "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/cart-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/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// CartListProps are the props of CartList; the values are the JSON shapes of the TypeScript props.\ntype CartListProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tLines any `json:\"lines\"`\n\tEmpty any `json:\"empty\"`\n\tLabels any `json:\"labels\"`\n\tLayout any `json:\"layout\"`\n\tMedia any `json:\"media\"`\n\tTone any `json:\"tone\"`\n\tDensity any `json:\"density\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// The lines of a cart as a table or as cards: product, variant, price, quantity, line total and a remove button. Axes: layout (table, cards), media (image, none), density, tone.\ntempl CartList(p CartListProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vLines := p.Lines }}\n\t{{ vEmpty := uiutils.Def(p.Empty, \"\") }}\n\t{{ vLabels := p.Labels }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"table\") }}\n\t{{ vMedia := uiutils.Def(p.Media, \"image\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vDensity := uiutils.Def(p.Density, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel}) {\n\t\tif uiutils.Eq(uiutils.Len(vLines), float64(0)) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"shopping-cart\", Title: vEmpty})\n\t\t} else if uiutils.Eq(vLayout, \"table\") {\n\t\t\t@CartTable(CartTableProps{Field: uiutils.Tpl(\"{0}-qty\", vId), Lines: vLines, Labels: vLabels, Media: vMedia, Density: vDensity})\n\t\t} else {\n\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", Align: \"stretch\", BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"cart-cards\")}}) {\n\t\t\t\tfor _, vLine := range uiutils.L(vLines) {\n\t\t\t\t\t@compose.Card(compose.CardProps{Variant: \"default\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t@compose.CardContent(compose.CardContentProps{BoxProps: box.BoxProps{Class: \"flex flex-wrap items-center gap-4\"}}) {\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(vLine, \"name\"), Src: uiutils.Get(vLine, \"image\"), Ratio: \"1/1\", Class: uiutils.Cnv(\"size-16 shrink-0\")})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"0\", BoxProps: box.BoxProps{Class: \"min-w-40 flex-1\"}}) {\n\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{ uiutils.Text(uiutils.Get(vLine, \"name\")) }\n\t\t\t\t\t\t\t\t}\n\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{ uiutils.Text(uiutils.Get(vLine, \"variant\")) }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(uiutils.Get(vLine, \"price\"), uiutils.Get(vLine, \"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@NumberField(NumberFieldProps{Value: uiutils.Str(uiutils.Get(vLine, \"qty\")), Name: uiutils.Tpl(\"{0}-qty-{1}\", vId, uiutils.Get(vLine, \"id\")), Min: \"1\", Label: uiutils.Get(vLabels, \"qty\"), Decrease: uiutils.Get(vLabels, \"decrease\"), Increase: uiutils.Get(vLabels, \"increase\")})\n\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"base\", Weight: \"bold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(uiutils.Mul(uiutils.Get(vLine, \"price\"), uiutils.Get(vLine, \"qty\")), uiutils.Get(vLine, \"currency\"))) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@compose.Button(compose.ButtonProps{Variant: \"ghost\", Size: \"sm\", Layout: \"icon\", ButtonProps: button.ButtonProps{AriaLabel: uiutils.S(uiutils.Get(vLabels, \"remove\"))}}) {\n\t\t\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"x\", Size: 16})\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/cart-list.templ",
      "target": "blocks/cart-list.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "checkout",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "cart-list",
  "registryDependencies": [
    "button",
    "card",
    "card-content",
    "cart-table",
    "empty-state",
    "kit-box",
    "kit-button",
    "kit-text",
    "lucide-icon",
    "media-frame",
    "number-field",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Cart List",
  "type": "registry:block"
}
