{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "One choice as a radio group drawn as chips: a fieldset with role radiogroup named by its legend, one radio per option (the first checked), the name and an optional price or note. Static markup.",
  "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/option-chips.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/label\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/radio\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// OptionChipsProps are the props of OptionChips; the values are the JSON shapes of the TypeScript props.\ntype OptionChipsProps struct {\n\tName any `json:\"name\"`\n\tLegend any `json:\"legend\"`\n\tOptions any `json:\"options\"`\n\tExtra any `json:\"extra\"`\n\tLayout any `json:\"layout\"`\n}\n\n// One choice as a radio group drawn as chips: a fieldset with role radiogroup named by its legend, one radio per option (the first checked), the name and an optional price or note. Static markup.\ntempl OptionChips(p OptionChipsProps) {\n\t{{ vName := p.Name }}\n\t{{ vLegend := p.Legend }}\n\t{{ vOptions := p.Options }}\n\t{{ vExtra := uiutils.Def(p.Extra, \"none\") }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"wrap\") }}\n\t@compose.Fieldset(compose.FieldsetProps{BoxProps: box.BoxProps{Class: \"flex flex-col gap-2\", Attrs: uiutils.Attrs(\"role\", \"radiogroup\", \"aria-labelledby\", uiutils.Tpl(\"{0}-legend\", vName), \"data-slot\", \"option-group\")}}) {\n\t\t@compose.Legend(compose.LegendProps{Size: \"sm\", TextProps: text.TextProps{Class: \"mb-2\", Attrs: uiutils.Attrs(\"id\", uiutils.Tpl(\"{0}-legend\", vName))}}) {\n\t\t\t{ uiutils.Text(vLegend) }\n\t\t}\n\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"column\")), \"flex flex-col gap-2\", \"flex flex-wrap gap-2\"))}}) {\n\t\t\tfor vI, vO := range uiutils.L(vOptions) {\n\t\t\t\t@compose.Label(compose.LabelProps{LabelProps: label.LabelProps{Class: uiutils.S(uiutils.Cnv(\"flex items-center gap-2 rounded px-4 py-2 text-sm inset-ring inset-ring-border has-checked:bg-muted has-checked:inset-ring-foreground\", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, \"column\")), \"justify-between\", \"\"))), Attrs: uiutils.Attrs(\"data-slot\", \"option\")}}) {\n\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"flex items-center gap-2\"}}) {\n\t\t\t\t\t\t@compose.Radio(compose.RadioProps{RadioProps: radio.RadioProps{Name: uiutils.S(vName), Value: uiutils.SP(uiutils.Get(vO, \"id\")), Checked: uiutils.T(uiutils.Eq(float64(vI), float64(0)))}})\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vO, \"name\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif uiutils.Eq(vExtra, \"price\") {\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(uiutils.Get(vO, \"price\"), uiutils.Get(vO, \"currency\"))) }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif uiutils.Eq(vExtra, \"note\") {\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vO, \"note\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/option-chips.templ",
      "target": "blocks/option-chips.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "option-chips",
  "registryDependencies": [
    "box",
    "fieldset",
    "inline",
    "kit-box",
    "kit-label",
    "kit-radio",
    "kit-text",
    "label",
    "legend",
    "radio",
    "utils"
  ],
  "runtime": "templ",
  "title": "Option Chips",
  "type": "registry:component"
}
