{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The cart drawer in its open state, filled or empty.",
  "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-drawer.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// CartDrawerProps are the props of CartDrawer; the values are the JSON shapes of the TypeScript props.\ntype CartDrawerProps struct {\n\tId any `json:\"id\"`\n\tLines any `json:\"lines\"`\n\tRows any `json:\"rows\"`\n\tLabels any `json:\"labels\"`\n\tDrawer any `json:\"drawer\"`\n\tState any `json:\"state\"`\n\tMedia any `json:\"media\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// The cart drawer in its open state, over a faded page: the head with a close button, the lines with a quantity field, the free-delivery bar, the totals and the button. The empty state shows an icon, a line and the way back. Static markup: opening and closing are the page's. Axes: state (filled, empty), media (image, none).\ntempl CartDrawer(p CartDrawerProps) {\n\t{{ vId := p.Id }}\n\t{{ vLines := p.Lines }}\n\t{{ vRows := p.Rows }}\n\t{{ vLabels := p.Labels }}\n\t{{ vDrawer := p.Drawer }}\n\t{{ vState := uiutils.Def(p.State, \"filled\") }}\n\t{{ vMedia := uiutils.Def(p.Media, \"image\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: \"section\", Class: \"py-8\", Attrs: uiutils.Attrs(\"aria-label\", uiutils.Coalesce(vLandmarkLabel, uiutils.Get(vDrawer, \"title\")), \"data-slot\", \"section\")}}) {\n\t\t@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: \"mx-auto w-full max-w-6xl px-4\", Attrs: uiutils.Attrs(\"data-slot\", \"container\")}}) {\n\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"flex min-h-160 overflow-hidden rounded bg-muted inset-ring inset-ring-border\"}}) {\n\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"hidden flex-1 flex-col gap-4 p-8 sm:flex\", Attrs: uiutils.Attrs(\"aria-hidden\", \"true\")}}) {\n\t\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"h-8 w-48 rounded bg-background\"}})\n\t\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"h-40 rounded bg-background\"}})\n\t\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"h-40 rounded bg-background\"}})\n\t\t\t\t}\n\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"flex w-full flex-col bg-background shadow-lg sm:max-w-sm\", Attrs: uiutils.Attrs(\"role\", \"group\", \"aria-label\", uiutils.Get(vDrawer, \"title\"), \"data-slot\", \"drawer\")}}) {\n\t\t\t\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", Justify: \"between\", BoxProps: box.BoxProps{Class: \"border-b border-border p-4\"}}) {\n\t\t\t\t\t\t@compose.Title(compose.TitleProps{As: \"2\", Size: \"lg\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vDrawer, \"title\")) }\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(vDrawer, \"close\"))}}) {\n\t\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"x\", Size: 16})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif uiutils.T(uiutils.Or(uiutils.Eq(vState, \"empty\"), uiutils.Eq(uiutils.Len(vLines), float64(0)))) {\n\t\t\t\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"flex flex-1 flex-col justify-center p-4\", Attrs: uiutils.Attrs(\"data-slot\", \"empty\")}}) {\n\t\t\t\t\t\t\t@EmptyState(EmptyStateProps{Icon: \"shopping-bag\", Title: uiutils.Get(vDrawer, \"empty\"), Text: uiutils.Get(vDrawer, \"emptyText\"), Action: cartDrawerFill1(p, vDrawer)})\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t@DrawerLines(DrawerLinesProps{Field: uiutils.Tpl(\"{0}-qty\", vId), Lines: vLines, Rows: vRows, Labels: vLabels, Drawer: vDrawer, Media: vMedia})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\ntempl cartDrawerFill1(p CartDrawerProps, vDrawer any) {\n\t@compose.Button(compose.ButtonProps{Variant: \"outline\", Size: \"default\", ButtonProps: button.ButtonProps{}}) {\n\t\t{ uiutils.Text(uiutils.Get(vDrawer, \"browse\")) }\n\t}\n}\n",
      "path": "blocks/cart-drawer.templ",
      "target": "blocks/cart-drawer.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "checkout",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "cart-drawer",
  "registryDependencies": [
    "block",
    "box",
    "button",
    "container",
    "drawer-lines",
    "empty-state",
    "group",
    "kit-box",
    "kit-button",
    "kit-text",
    "lucide-icon",
    "title",
    "utils"
  ],
  "runtime": "templ",
  "title": "Cart Drawer",
  "type": "registry:block"
}
