{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "An email field and a button, inline, stacked or beside a picture.",
  "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/newsletter-form.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/form\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/input\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/label\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// NewsletterFormProps are the props of NewsletterForm; the values are the JSON shapes of the TypeScript props.\ntype NewsletterFormProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tText any `json:\"text\"`\n\tLabel any `json:\"label\"`\n\tSubmit any `json:\"submit\"`\n\tConsent any `json:\"consent\"`\n\tLayout any `json:\"layout\"`\n\tTerms any `json:\"terms\"`\n\tTone any `json:\"tone\"`\n\tAlign any `json:\"align\"`\n\tImage any `json:\"image\"`\n\tImageAlt any `json:\"imageAlt\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// An email sign-up: heading, one sentence, an email field and a button, with an optional consent line and picture. Axes: layout (inline, stacked, split), terms (show, hide), tone (default, muted), align (start, center).\ntempl NewsletterForm(p NewsletterFormProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vText := p.Text }}\n\t{{ vLabel := p.Label }}\n\t{{ vSubmit := p.Submit }}\n\t{{ vConsent := p.Consent }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"inline\") }}\n\t{{ vTerms := uiutils.Def(p.Terms, \"hide\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vAlign := uiutils.Def(p.Align, \"center\") }}\n\t{{ vImage := p.Image }}\n\t{{ vImageAlt := p.ImageAlt }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vText, Tone: vTone, Align: vAlign, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"split\")), \"split\", \"stack\"), Media: map[string]any{\"show\": uiutils.Eq(vLayout, \"split\")}, LandmarkLabel: vLandmarkLabel, Aside: newsletterFormFill1(p, vTitle, vImage, vImageAlt)}) {\n\t\t@compose.Form(compose.FormProps{FormProps: form.FormProps{Method: \"dialog\", Class: uiutils.S(uiutils.Cnv(\"w-full max-w-md\", uiutils.Cond(uiutils.T(uiutils.Eq(vAlign, \"center\")), \"mx-auto\", \"\"))), Attrs: uiutils.Attrs(\"data-slot\", \"newsletter-form\")}}) {\n\t\t\t@compose.Label(compose.LabelProps{LabelProps: label.LabelProps{For: uiutils.S(uiutils.Tpl(\"{0}-email\", vId)), Class: \"sr-only\"}}) {\n\t\t\t\t{ uiutils.Text(vLabel) }\n\t\t\t}\n\t\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"start\", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"w-full\", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"stacked\")), \"flex-col items-stretch\", \"flex-wrap\")))}}) {\n\t\t\t\t@compose.Input(compose.InputProps{InputProps: input.InputProps{Type: \"email\", Name: \"email\", Class: \"min-w-0 flex-1\", Attrs: uiutils.Attrs(\"id\", uiutils.Tpl(\"{0}-email\", vId), \"data-slot\", \"field\")}})\n\t\t\t\t@compose.Button(compose.ButtonProps{Variant: \"default\", Size: \"default\", ButtonProps: button.ButtonProps{Type: \"submit\"}}) {\n\t\t\t\t\t{ uiutils.Text(vSubmit) }\n\t\t\t\t}\n\t\t\t}\n\t\t\tif uiutils.T(uiutils.And(uiutils.Eq(vTerms, \"show\"), vConsent)) {\n\t\t\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"text-muted-foreground\", Attrs: uiutils.Attrs(\"data-slot\", \"consent\")}}) {\n\t\t\t\t\t{ uiutils.Text(vConsent) }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\ntempl newsletterFormFill1(p NewsletterFormProps, vTitle any, vImage any, vImageAlt any) {\n\t@MediaFrame(MediaFrameProps{Alt: uiutils.Cond(uiutils.T(vImageAlt), vImageAlt, vTitle), Src: vImage, Ratio: \"4/3\"})\n}\n",
      "path": "blocks/newsletter-form.templ",
      "target": "blocks/newsletter-form.templ"
    }
  ],
  "meta": {
    "category": "promo",
    "group": "forms",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "newsletter-form",
  "registryDependencies": [
    "button",
    "form",
    "group",
    "input",
    "kit-box",
    "kit-button",
    "kit-form",
    "kit-input",
    "kit-label",
    "kit-text",
    "label",
    "media-frame",
    "section-frame",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Newsletter Form",
  "type": "registry:block"
}
