{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The order summary card of the cart page and the checkout: the lines in short (optional), a promo code field with ready codes, the free-delivery progress, the totals, the button and a note. Static markup.",
  "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-summary-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/input\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/progress\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// CartSummaryCardProps are the props of CartSummaryCard; the values are the JSON shapes of the TypeScript props.\ntype CartSummaryCardProps struct {\n\tLines any `json:\"lines\"`\n\tRows any `json:\"rows\"`\n\tPromos any `json:\"promos\"`\n\tLabels any `json:\"labels\"`\n\tItems any `json:\"items\"`\n\tPromo any `json:\"promo\"`\n\tField any `json:\"field\"`\n\tProgress any `json:\"progress\"`\n\tValue any `json:\"value\"`\n}\n\n// The order summary card of the cart page and the checkout: the lines in short (optional), a promo code field with ready codes, the free-delivery progress, the totals, the button and a note. Static markup.\ntempl CartSummaryCard(p CartSummaryCardProps) {\n\t{{ vLines := p.Lines }}\n\t{{ vRows := p.Rows }}\n\t{{ vPromos := p.Promos }}\n\t{{ vLabels := p.Labels }}\n\t{{ vItems := uiutils.Def(p.Items, \"hide\") }}\n\t{{ vPromo := uiutils.Def(p.Promo, \"show\") }}\n\t{{ vField := uiutils.Def(p.Field, \"promo\") }}\n\t{{ vProgress := uiutils.Def(p.Progress, \"show\") }}\n\t{{ vValue := uiutils.Def(p.Value, float64(70)) }}\n\t@compose.Stack(compose.StackProps{Gap: \"6\", Align: \"stretch\", BoxProps: box.BoxProps{Class: \"rounded bg-card inset-ring inset-ring-border p-6\", Attrs: uiutils.Attrs(\"data-slot\", \"summary\")}}) {\n\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"baseline\", Justify: \"between\", BoxProps: box.BoxProps{}}) {\n\t\t\t@compose.Title(compose.TitleProps{As: \"2\", Size: \"lg\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"title\")) }\n\t\t\t}\n\t\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, \"items\"), uiutils.Str(uiutils.Len(vLines)))) }\n\t\t\t}\n\t\t}\n\t\tif uiutils.T(uiutils.And(uiutils.Eq(vItems, \"show\"), uiutils.Gt(uiutils.Len(vLines), float64(0)))) {\n\t\t\t@compose.List(compose.ListProps{BoxProps: box.BoxProps{Tag: \"ul\", Class: \"flex flex-col gap-4\", Attrs: uiutils.Attrs(\"data-slot\", \"summary-lines\")}}) {\n\t\t\t\tfor _, vLine := range uiutils.L(vLines) {\n\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: \"flex items-center gap-4 text-sm\", Attrs: uiutils.Attrs(\"data-slot\", \"cart-line\")}}) {\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-12 shrink-0\")})\n\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"0\", BoxProps: box.BoxProps{Class: \"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.Tpl(\"{0} x {1}\", uiutils.Get(vLine, \"qty\"), 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@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"font-medium\"}}) {\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}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif uiutils.Eq(vPromo, \"show\") {\n\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", Align: \"stretch\", BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"promo\")}}) {\n\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"center\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t@compose.Input(compose.InputProps{InputProps: input.InputProps{Type: \"text\", Name: uiutils.S(vField), Placeholder: uiutils.S(uiutils.Get(vLabels, \"promo\")), Class: \"min-w-0 flex-1\", Attrs: uiutils.Attrs(\"aria-label\", uiutils.Get(vLabels, \"promo\"))}})\n\t\t\t\t\t@compose.Button(compose.ButtonProps{Variant: \"outline\", Size: \"default\", ButtonProps: button.ButtonProps{Type: \"button\"}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"apply\")) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif uiutils.Gt(uiutils.Len(vPromos), float64(0)) {\n\t\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"center\", BoxProps: box.BoxProps{Class: \"flex-wrap\"}}) {\n\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{ uiutils.Text(uiutils.Get(vLabels, \"codes\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor _, vC := range uiutils.L(vPromos) {\n\t\t\t\t\t\t\t@compose.Badge(compose.BadgeProps{Variant: \"outline\", Size: \"sm\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vC, \"code\")) }\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\tif uiutils.Eq(vProgress, \"show\") {\n\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", Align: \"stretch\", BoxProps: box.BoxProps{Class: \"rounded bg-muted p-4\", Attrs: uiutils.Attrs(\"data-slot\", \"progress\")}}) {\n\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"progress\")) }\n\t\t\t\t}\n\t\t\t\t@compose.Progress(compose.ProgressProps{ProgressProps: progress.ProgressProps{Value: uiutils.SP(uiutils.Str(vValue)), Max: \"100\", Attrs: uiutils.Attrs(\"aria-label\", uiutils.Get(vLabels, \"progress\"))}})\n\t\t\t}\n\t\t}\n\t\tif uiutils.Gt(uiutils.Len(vRows), float64(0)) {\n\t\t\t@compose.List(compose.ListProps{BoxProps: box.BoxProps{Tag: \"ul\", Class: \"flex flex-col gap-2\"}}) {\n\t\t\t\tfor _, vRow := range uiutils.L(vRows) {\n\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"flex items-center justify-between gap-4\", uiutils.Cond(uiutils.T(uiutils.Get(vRow, \"strong\")), \"border-t border-border pt-4 text-base font-bold\", \"text-sm text-muted-foreground\"))), Attrs: uiutils.Attrs(\"data-slot\", \"row\")}}) {\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vRow, \"label\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(uiutils.Get(vRow, \"amount\"), uiutils.Get(vRow, \"currency\"))) }\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\t@compose.Button(compose.ButtonProps{Variant: \"default\", Size: \"lg\", ButtonProps: button.ButtonProps{Class: \"w-full\"}}) {\n\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"checkout\")) }\n\t\t}\n\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"note\")) }\n\t\t}\n\t}\n}\n",
      "path": "blocks/cart-summary-card.templ",
      "target": "blocks/cart-summary-card.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "cart-summary-card",
  "registryDependencies": [
    "badge",
    "button",
    "group",
    "inline",
    "input",
    "kit-box",
    "kit-button",
    "kit-input",
    "kit-progress",
    "kit-text",
    "list",
    "list-item",
    "media-frame",
    "progress",
    "stack",
    "text",
    "title",
    "utils"
  ],
  "runtime": "templ",
  "title": "Cart Summary Card",
  "type": "registry:component"
}
