{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Fill a box by weight: produce tiles beside the box with a meter.",
  "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/veggie-box.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/label\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/meter\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// VeggieBoxProps are the props of VeggieBox; the values are the JSON shapes of the TypeScript props.\ntype VeggieBoxProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tLead any `json:\"lead\"`\n\tDishes any `json:\"dishes\"`\n\tEmpty any `json:\"empty\"`\n\tLabels any `json:\"labels\"`\n\tFill any `json:\"fill\"`\n\tTotal any `json:\"total\"`\n\tCurrency any `json:\"currency\"`\n\tLayout any `json:\"layout\"`\n\tTone any `json:\"tone\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// A vegetable box by weight: produce tiles (picture, name, price per kg, a weight field in kg named after the item) beside the box card with a meter of how full the box is, the total and the order button. Axes: layout (split, stacked), tone.\ntempl VeggieBox(p VeggieBoxProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vLead := uiutils.Def(p.Lead, \"\") }}\n\t{{ vDishes := p.Dishes }}\n\t{{ vEmpty := uiutils.Def(p.Empty, \"\") }}\n\t{{ vLabels := p.Labels }}\n\t{{ vFill := uiutils.Def(p.Fill, float64(60)) }}\n\t{{ vTotal := p.Total }}\n\t{{ vCurrency := p.Currency }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"split\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\tif uiutils.Eq(uiutils.Len(vDishes), float64(0)) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"package\", Title: vEmpty})\n\t\t} else {\n\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"grid grid-cols-1 items-start gap-8 lg:grid-cols-3\"}}) {\n\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"split\")), \"grid grid-cols-2 gap-4 md:grid-cols-3 lg:col-span-2\", \"grid grid-cols-2 gap-4 md:grid-cols-3 lg:col-span-3 lg:grid-cols-6\")), Attrs: uiutils.Attrs(\"data-slot\", \"items\")}}) {\n\t\t\t\t\tfor _, vD := range uiutils.L(vDishes) {\n\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"2\", BoxProps: box.BoxProps{Class: \"rounded bg-card inset-ring inset-ring-border p-4\", Attrs: uiutils.Attrs(\"data-slot\", \"item\")}}) {\n\t\t\t\t\t\t\t@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vD, \"name\"), Src: uiutils.Get(vD, \"image\"), Ratio: \"1/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(vD, \"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(uiutils.Get(vLabels, \"perKg\"), uiutils.Money(uiutils.Get(vD, \"price\"), uiutils.Get(vD, \"currency\")))) }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@NumberField(NumberFieldProps{Value: \"1\", Name: uiutils.Tpl(\"{0}-kg-{1}\", vId, uiutils.Get(vD, \"id\")), Min: \"0\", Label: uiutils.Tpl(uiutils.Get(vLabels, \"weightOf\"), uiutils.Get(vD, \"name\")), Decrease: uiutils.Tpl(uiutils.Get(vLabels, \"decreaseOf\"), uiutils.Get(vD, \"name\")), Increase: uiutils.Tpl(uiutils.Get(vLabels, \"increaseOf\"), uiutils.Get(vD, \"name\"))})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"split\")), \"rounded bg-card inset-ring inset-ring-border p-6 lg:sticky lg:top-8\", \"rounded bg-card inset-ring inset-ring-border p-6 lg:col-span-3\")), Attrs: uiutils.Attrs(\"data-slot\", \"summary\")}}) {\n\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"lg\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"summary\")) }\n\t\t\t\t\t}\n\t\t\t\t\t@compose.Label(compose.LabelProps{LabelProps: label.LabelProps{For: uiutils.S(uiutils.Tpl(\"{0}-fill\", vId)), Class: \"text-sm text-muted-foreground\"}}) {\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"boxFill\")) }\n\t\t\t\t\t}\n\t\t\t\t\t@compose.Meter(compose.MeterProps{MeterProps: meter.MeterProps{Value: uiutils.SP(vFill), Min: \"0\", Max: \"100\", Attrs: uiutils.Attrs(\"id\", uiutils.Tpl(\"{0}-fill\", vId))}})\n\t\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"baseline\", Justify: \"between\", BoxProps: box.BoxProps{}}) {\n\t\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\t{ uiutils.Text(uiutils.Get(vLabels, \"total\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-2xl font-bold\", Attrs: uiutils.Attrs(\"role\", \"status\", \"aria-live\", \"polite\", \"data-slot\", \"total\")}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(vTotal, vCurrency)) }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@compose.Button(compose.ButtonProps{Variant: \"default\", Size: \"lg\", ButtonProps: button.ButtonProps{Type: \"button\", Class: \"w-full\"}}) {\n\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"shopping-bag\", Size: 16})\n\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vLabels, \"order\")) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/veggie-box.templ",
      "target": "blocks/veggie-box.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "food",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "veggie-box",
  "registryDependencies": [
    "box",
    "button",
    "empty-state",
    "group",
    "inline",
    "kit-box",
    "kit-button",
    "kit-label",
    "kit-meter",
    "kit-text",
    "label",
    "lucide-icon",
    "media-frame",
    "meter",
    "number-field",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Veggie Box",
  "type": "registry:block"
}
