{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "UI8Kit 3 Image primitive (unstyled), from @ui8kit/registry",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n\n/*\nImage renders img, picture, and source. Alt is required; pass an empty\nstring for decorative images.\n*/\n\npackage image\n\nimport (\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/utils\"\n)\n\n// ImageProps configures Image.\ntype ImageProps struct {\n\t// Class — token class names supplied by the consumer\n\tClass string\n\tSrc string\n\t// Alt — alternative text; empty string for decorative images\n\tAlt string\n\tSrcSet string\n\tSizes string\n\tWidth string\n\tHeight string\n\tLoading string\n\tDecoding string\n\tAttrs templ.Attributes\n}\n\n// ImageClasses composes Image classes without rendering —\n// the server-composition escape hatch for custom root elements (no asChild in templ).\nfunc ImageClasses(p ImageProps) string {\n\treturn uiutils.Cn(p.Class)\n}\n\n// Image renders the Image contract.\ntempl Image(p ImageProps) {\n\t<img\n\t\tif !uiutils.HasAttr(p.Attrs, \"src\") {\n\t\t\tif uiutils.IsSetStr(uiutils.SafeImgURL(p.Src)) {\n\t\t\t\tsrc={ templ.SafeURL(uiutils.SafeImgURL(p.Src)) }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"alt\") {\n\t\t\talt={ p.Alt }\n\t\t}\n\t\tif ImageClasses(p) != \"\" {\n\t\t\tclass={ ImageClasses(p) }\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"srcset\") {\n\t\t\tif uiutils.IsSetStr(p.SrcSet) {\n\t\t\t\tsrcset={ p.SrcSet }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"sizes\") {\n\t\t\tif uiutils.IsSetStr(p.Sizes) {\n\t\t\t\tsizes={ p.Sizes }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"width\") {\n\t\t\tif uiutils.IsSetStr(p.Width) {\n\t\t\t\twidth={ p.Width }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"height\") {\n\t\t\tif uiutils.IsSetStr(p.Height) {\n\t\t\t\theight={ p.Height }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"loading\") {\n\t\t\tif uiutils.IsSetStr(p.Loading) {\n\t\t\t\tloading={ p.Loading }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"decoding\") {\n\t\t\tif uiutils.IsSetStr(p.Decoding) {\n\t\t\t\tdecoding={ p.Decoding }\n\t\t\t}\n\t\t}\n\t\t{ uiutils.RestAttrs(p.Attrs, true, \"src\", \"srcset\", \"sizes\", \"width\", \"height\", \"loading\", \"decoding\")... }\n\t/>\n}\n\n// PictureProps configures Picture.\ntype PictureProps struct {\n\t// Class — token class names supplied by the consumer\n\tClass string\n\tAttrs templ.Attributes\n}\n\n// PictureClasses composes Picture classes without rendering —\n// the server-composition escape hatch for custom root elements (no asChild in templ).\nfunc PictureClasses(p PictureProps) string {\n\treturn uiutils.Cn(p.Class)\n}\n\n// Picture renders the Picture contract.\ntempl Picture(p PictureProps) {\n\t<picture\n\t\tif PictureClasses(p) != \"\" {\n\t\t\tclass={ PictureClasses(p) }\n\t\t}\n\t\t{ uiutils.RestAttrs(p.Attrs, false)... }\n\t>\n\t\t{ children... }\n\t</picture>\n}\n\n// SourceProps configures Source.\ntype SourceProps struct {\n\tSrcSet string\n\tMedia string\n\tType string\n\tSizes string\n\tAttrs templ.Attributes\n}\n\n// Source renders the Source contract.\ntempl Source(p SourceProps) {\n\t<source\n\t\tif !uiutils.HasAttr(p.Attrs, \"srcset\") {\n\t\t\tif uiutils.IsSetStr(p.SrcSet) {\n\t\t\t\tsrcset={ p.SrcSet }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"media\") {\n\t\t\tif uiutils.IsSetStr(p.Media) {\n\t\t\t\tmedia={ p.Media }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"type\") {\n\t\t\tif uiutils.IsSetStr(p.Type) {\n\t\t\t\ttype={ p.Type }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"sizes\") {\n\t\t\tif uiutils.IsSetStr(p.Sizes) {\n\t\t\t\tsizes={ p.Sizes }\n\t\t\t}\n\t\t}\n\t\t{ uiutils.RestAttrs(p.Attrs, false, \"srcset\", \"media\", \"type\", \"sizes\")... }\n\t/>\n}\n",
      "path": "ui/image/image.templ",
      "target": "ui/image/image.templ"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "templ",
      "primitive"
    ]
  },
  "name": "kit-image",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "templ",
  "title": "Kit Image",
  "type": "registry:ui"
}
