{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The cart lines beside a summary with a promo code and a free-delivery bar.",
  "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/shopping-cart.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// ShoppingCartProps are the props of ShoppingCart; the values are the JSON shapes of the TypeScript props.\ntype ShoppingCartProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tLines any `json:\"lines\"`\n\tRows any `json:\"rows\"`\n\tPromos any `json:\"promos\"`\n\tLabels any `json:\"labels\"`\n\tTotals any `json:\"totals\"`\n\tActions any `json:\"actions\"`\n\tLayout any `json:\"layout\"`\n\tPromo any `json:\"promo\"`\n\tProgress any `json:\"progress\"`\n\tTone any `json:\"tone\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// The cart as a page: the lines as cards (picture, name, variant, price, quantity, line total, remove) with the way back, beside the order summary with a promo code and the free-delivery bar. Static markup. Axes: layout (split: the summary beside the lines, stacked: below them), promo (show, hide), progress (show, hide), tone.\ntempl ShoppingCart(p ShoppingCartProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vLines := p.Lines }}\n\t{{ vRows := p.Rows }}\n\t{{ vPromos := p.Promos }}\n\t{{ vLabels := p.Labels }}\n\t{{ vTotals := p.Totals }}\n\t{{ vActions := p.Actions }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"split\") }}\n\t{{ vPromo := uiutils.Def(p.Promo, \"show\") }}\n\t{{ vProgress := uiutils.Def(p.Progress, \"show\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"split\")), \"grid grid-cols-1 items-start gap-8 lg:grid-cols-3\", \"grid grid-cols-1 gap-8\"))}}) {\n\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", Align: \"stretch\", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"split\")), \"lg:col-span-2\", \"\")), Attrs: uiutils.Attrs(\"data-slot\", \"lines\")}}) {\n\t\t\t\tif uiutils.Eq(uiutils.Len(vLines), float64(0)) {\n\t\t\t\t\t@EmptyState(EmptyStateProps{Icon: \"shopping-cart\", Title: uiutils.Get(vActions, \"empty\")})\n\t\t\t\t}\n\t\t\t\tfor _, vLine := range uiutils.L(vLines) {\n\t\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", BoxProps: box.BoxProps{Class: \"rounded bg-card inset-ring inset-ring-border flex-wrap p-4\", Attrs: uiutils.Attrs(\"data-slot\", \"item\")}}) {\n\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-20 shrink-0\")})\n\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@compose.Text(compose.TextProps{Size: \"sm\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLine, \"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.Get(vLine, \"variant\")) }\n\t\t\t\t\t\t\t}\n\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{ uiutils.Text(uiutils.Money(uiutils.Get(vLine, \"price\"), uiutils.Get(vLine, \"currency\"))) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\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@compose.Text(compose.TextProps{Size: \"base\", Weight: \"bold\", TextProps: text.TextProps{Class: \"w-24 text-right\"}}) {\n\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}\n\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@icons.LucideIcon(icons.LucideIconProps{Name: \"trash\", Size: 16})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Justify: \"between\", BoxProps: box.BoxProps{Class: \"flex-wrap\"}}) {\n\t\t\t\t\t@compose.Button(compose.ButtonProps{Variant: \"outline\", Size: \"default\", ButtonProps: button.ButtonProps{}}) {\n\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"arrow-left\", Size: 16})\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vActions, \"back\")) }\n\t\t\t\t\t}\n\t\t\t\t\t@compose.Button(compose.ButtonProps{Variant: \"ghost\", Size: \"default\", ButtonProps: button.ButtonProps{}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vActions, \"clear\")) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"split\")), \"lg:sticky lg:top-8\", \"\")), Attrs: uiutils.Attrs(\"data-slot\", \"aside\")}}) {\n\t\t\t\t@CartSummaryCard(CartSummaryCardProps{Field: uiutils.Tpl(\"{0}-promo\", vId), Lines: vLines, Rows: vRows, Promos: vPromos, Labels: vTotals, Promo: vPromo, Progress: vProgress})\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/shopping-cart.templ",
      "target": "blocks/shopping-cart.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "checkout",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "shopping-cart",
  "registryDependencies": [
    "box",
    "button",
    "cart-summary-card",
    "empty-state",
    "group",
    "kit-box",
    "kit-button",
    "kit-text",
    "lucide-icon",
    "media-frame",
    "number-field",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Shopping Cart",
  "type": "registry:block"
}
