{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "UI8Kit 3 Select primitive (unstyled), from @ui8kit/registry",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n\n/*\nSelect is a native dropdown. Flat options come from the Options list;\nSelectOption / SelectOptGroup children cover grouped or custom markup.\n*/\n\npackage selectfield\n\nimport (\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/utils\"\n)\n\n// SelectOptionItem is one SelectOptionItem entry.\ntype SelectOptionItem struct {\n\tValue string\n\tLabel string\n\tDisabled bool\n}\n\n// SelectProps configures Select.\ntype SelectProps struct {\n\t// Class — token class names supplied by the consumer\n\tClass string\n\tID string\n\tName string\n\t// Value — selected option value\n\tValue string\n\tMultiple bool\n\tRequired bool\n\tDisabled bool\n\tOptions []SelectOptionItem\n\tAriaInvalid string\n\tAriaDescribedBy string\n\tAttrs templ.Attributes\n}\n\n// SelectClasses composes Select classes without rendering —\n// the server-composition escape hatch for custom root elements (no asChild in templ).\nfunc SelectClasses(p SelectProps) string {\n\treturn uiutils.Cn(\"pr-2\", p.Class)\n}\n\n// Select renders the Select contract.\ntempl Select(p SelectProps) {\n\t<select\n\t\tif SelectClasses(p) != \"\" {\n\t\t\tclass={ SelectClasses(p) }\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"id\") {\n\t\t\tif uiutils.IsSetStr(p.ID) {\n\t\t\t\tid={ p.ID }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"name\") {\n\t\t\tif uiutils.IsSetStr(p.Name) {\n\t\t\t\tname={ p.Name }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"multiple\") {\n\t\t\tmultiple?={ p.Multiple }\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"required\") {\n\t\t\trequired?={ p.Required }\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"disabled\") {\n\t\t\tdisabled?={ p.Disabled }\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"aria-invalid\") {\n\t\t\tif uiutils.IsSetStr(p.AriaInvalid) {\n\t\t\t\taria-invalid={ p.AriaInvalid }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"aria-describedby\") {\n\t\t\tif uiutils.IsSetStr(p.AriaDescribedBy) {\n\t\t\t\taria-describedby={ p.AriaDescribedBy }\n\t\t\t}\n\t\t}\n\t\t{ uiutils.RestAttrs(p.Attrs, false, \"id\", \"name\", \"aria-invalid\", \"aria-describedby\")... }\n\t>\n\t\tfor _, item := range p.Options {\n\t\t\t<option\n\t\t\t\tvalue={ item.Value }\n\t\t\t\tselected?={ (item.Value == p.Value) }\n\t\t\t\tdisabled?={ item.Disabled }\n\t\t\t>\n\t\t\t\t{ item.Label }\n\t\t\t</option>\n\t\t}\n\t\t{ children... }\n\t</select>\n}\n\n// SelectOptionProps configures SelectOption.\ntype SelectOptionProps struct {\n\tValue *string\n\tSelected bool\n\tDisabled bool\n\tAttrs templ.Attributes\n}\n\n// SelectOption renders the SelectOption contract.\ntempl SelectOption(p SelectOptionProps) {\n\t<option\n\t\tif !uiutils.HasAttr(p.Attrs, \"value\") {\n\t\t\tif p.Value != nil {\n\t\t\t\tvalue={ *p.Value }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"selected\") {\n\t\t\tselected?={ p.Selected }\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"disabled\") {\n\t\t\tdisabled?={ p.Disabled }\n\t\t}\n\t\t{ uiutils.RestAttrs(p.Attrs, false)... }\n\t>\n\t\t{ children... }\n\t</option>\n}\n\n// SelectOptGroupProps configures SelectOptGroup.\ntype SelectOptGroupProps struct {\n\tLabel string\n\tDisabled bool\n\tAttrs templ.Attributes\n}\n\n// SelectOptGroup renders the SelectOptGroup contract.\ntempl SelectOptGroup(p SelectOptGroupProps) {\n\t<optgroup\n\t\tif !uiutils.HasAttr(p.Attrs, \"label\") {\n\t\t\tif uiutils.IsSetStr(p.Label) {\n\t\t\t\tlabel={ p.Label }\n\t\t\t}\n\t\t}\n\t\tif !uiutils.HasAttr(p.Attrs, \"disabled\") {\n\t\t\tdisabled?={ p.Disabled }\n\t\t}\n\t\t{ uiutils.RestAttrs(p.Attrs, false, \"label\")... }\n\t>\n\t\t{ children... }\n\t</optgroup>\n}\n",
      "path": "ui/select/select.templ",
      "target": "ui/select/select.templ"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "templ",
      "primitive"
    ]
  },
  "name": "kit-select",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "templ",
  "title": "Kit Select",
  "type": "registry:ui"
}
