{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The gallery and the buy box of one product.",
  "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/product-detail.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// ProductDetailProps are the props of ProductDetail; the values are the JSON shapes of the TypeScript props.\ntype ProductDetailProps struct {\n\tId any `json:\"id\"`\n\tProduct any `json:\"product\"`\n\tLabels any `json:\"labels\"`\n\tBadges any `json:\"badges\"`\n\tLevel any `json:\"level\"`\n\tLayout any `json:\"layout\"`\n\tMediaSide any `json:\"mediaSide\"`\n\tThumbs any `json:\"thumbs\"`\n\tBuy any `json:\"buy\"`\n\tTone any `json:\"tone\"`\n\tDensity any `json:\"density\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// A product page: a gallery (the main picture and optional thumbnails) beside the buy box (badge, rating, price, stock, quantity, add button, shipping and returns notes). Axes: layout (split, stacked), media side, thumbs (none, below), buy (full, compact), tone, density.\ntempl ProductDetail(p ProductDetailProps) {\n\t{{ vId := p.Id }}\n\t{{ vProduct := p.Product }}\n\t{{ vLabels := p.Labels }}\n\t{{ vBadges := p.Badges }}\n\t{{ vLevel := uiutils.Def(p.Level, float64(1)) }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"split\") }}\n\t{{ vMediaSide := uiutils.Def(p.MediaSide, \"start\") }}\n\t{{ vThumbs := uiutils.Def(p.Thumbs, \"below\") }}\n\t{{ vBuy := uiutils.Def(p.Buy, \"full\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vDensity := uiutils.Def(p.Density, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\tif !uiutils.T(vProduct) {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel}) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"package\", Title: uiutils.Get(vLabels, \"empty\")})\n\t\t}\n\t} else {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: uiutils.Get(vProduct, \"name\"), Lead: uiutils.Get(vProduct, \"summary\"), Heading: map[string]any{\"level\": vLevel}, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"split\")), \"split\", \"stack\"), Media: map[string]any{\"show\": true, \"side\": vMediaSide, \"align\": \"start\"}, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel, Aside: productDetailFill1(p, vProduct, vThumbs)}) {\n\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", Align: \"stretch\", BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"buy-box\")}}) {\n\t\t\t\tif uiutils.T(uiutils.Get(vProduct, \"category\")) {\n\t\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\t{ uiutils.Text(uiutils.Get(vProduct, \"category\")) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@ProductPrice(ProductPriceProps{Price: uiutils.Get(vProduct, \"price\"), CompareAt: uiutils.Get(vProduct, \"compareAt\"), Currency: uiutils.Get(vProduct, \"currency\"), Badge: uiutils.Cond(uiutils.T(uiutils.Get(vProduct, \"badge\")), uiutils.At(vBadges, uiutils.Get(vProduct, \"badge\")), \"\"), Was: uiutils.Get(vLabels, \"was\")})\n\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t@Rating(RatingProps{Value: uiutils.Get(vProduct, \"rating\"), Label: uiutils.Tpl(uiutils.Get(vLabels, \"ratingLabel\"), uiutils.Get(vProduct, \"rating\"))})\n\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, \"reviews\"), uiutils.Get(vProduct, \"reviews\"))) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", Weight: \"medium\", TextProps: text.TextProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Get(vProduct, \"inStock\")), \"text-foreground\", \"text-destructive\")), Attrs: uiutils.Attrs(\"data-slot\", \"stock\")}}) {\n\t\t\t\t\t{ uiutils.Text(uiutils.Cond(uiutils.T(uiutils.Get(vProduct, \"inStock\")), uiutils.Get(vLabels, \"inStock\"), uiutils.Get(vLabels, \"soldOut\"))) }\n\t\t\t\t}\n\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"4\", BoxProps: box.BoxProps{Class: \"flex-wrap\"}}) {\n\t\t\t\t\tif uiutils.Eq(vBuy, \"full\") {\n\t\t\t\t\t\t@NumberField(NumberFieldProps{Value: \"1\", Name: uiutils.Tpl(\"{0}-qty\", vId), Min: \"1\", Label: uiutils.Get(vLabels, \"qty\"), Decrease: uiutils.Get(vLabels, \"decrease\"), Increase: uiutils.Get(vLabels, \"increase\")})\n\t\t\t\t\t}\n\t\t\t\t\t@compose.Button(compose.ButtonProps{ButtonProps: button.ButtonProps{Disabled: uiutils.T(!uiutils.T(uiutils.Get(vProduct, \"inStock\")))}}) {\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\tif uiutils.Eq(vBuy, \"full\") {\n\t\t\t\t\t@compose.List(compose.ListProps{BoxProps: box.BoxProps{Tag: \"ul\", Class: \"flex flex-col gap-2 text-sm text-muted-foreground\"}}) {\n\t\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: \"flex items-center gap-2\"}}) {\n\t\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"truck\", Size: 16})\n\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"shipping\")) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: \"flex items-center gap-2\"}}) {\n\t\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"shield-check\", Size: 16})\n\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"returns\")) }\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\ntempl productDetailFill1(p ProductDetailProps, vProduct any, vThumbs any) {\n\t@ProductGallery(ProductGalleryProps{Name: uiutils.Get(vProduct, \"name\"), Image: uiutils.Get(vProduct, \"image\"), Thumbs: vThumbs})\n}\n",
      "path": "blocks/product-detail.templ",
      "target": "blocks/product-detail.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "product",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "product-detail",
  "registryDependencies": [
    "button",
    "empty-state",
    "group",
    "inline",
    "kit-box",
    "kit-button",
    "kit-text",
    "list",
    "list-item",
    "lucide-icon",
    "number-field",
    "product-gallery",
    "product-price",
    "rating",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Product Detail",
  "type": "registry:block"
}
