{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A from–to pair for numbers or dates (price range, period). Empty means an open end. With numeric bounds two sliders sit above the inputs. Each control has its own accessible name; every change reports both ends.",
  "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/parts/range-field.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/input\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// RangeFieldProps are the props of RangeField; the values are the JSON shapes of the TypeScript props.\ntype RangeFieldProps struct {\n\tType any `json:\"type\"`\n\tFrom any `json:\"from\"`\n\tTo any `json:\"to\"`\n\tFromLabel any `json:\"fromLabel\"`\n\tToLabel any `json:\"toLabel\"`\n\tMin any `json:\"min\"`\n\tMax any `json:\"max\"`\n\tClass string `json:\"className\"`\n}\n\n// A from–to pair for numbers or dates (price range, period). Empty means an open end. With numeric bounds two sliders sit above the inputs. Each control has its own accessible name; every change reports both ends.\ntempl RangeField(p RangeFieldProps) {\n\t{{ vType := p.Type }}\n\t{{ vFrom := p.From }}\n\t{{ vTo := p.To }}\n\t{{ vFromLabel := p.FromLabel }}\n\t{{ vToLabel := p.ToLabel }}\n\t{{ vMin := p.Min }}\n\t{{ vMax := p.Max }}\n\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"flex flex-col gap-2\", p.Class)), Attrs: uiutils.Attrs(\"data-slot\", \"range-field\")}}) {\n\t\tif uiutils.T(uiutils.And(uiutils.Eq(vType, \"number\"), uiutils.Has(vMin), uiutils.Has(vMax), uiutils.Lt(vMin, vMax))) {\n\t\t\t@compose.Range(compose.RangeProps{InputProps: input.InputProps{Min: uiutils.S(vMin), Max: uiutils.S(vMax), Value: uiutils.SP(uiutils.Cond(uiutils.T(uiutils.Eq(vFrom, \"\")), uiutils.Str(vMin), vFrom)), Attrs: uiutils.Attrs(\"aria-label\", vFromLabel, \"data-slot\", \"range-from\")}})\n\t\t\t@compose.Range(compose.RangeProps{InputProps: input.InputProps{Min: uiutils.S(vMin), Max: uiutils.S(vMax), Value: uiutils.SP(uiutils.Cond(uiutils.T(uiutils.Eq(vTo, \"\")), uiutils.Str(vMax), vTo)), Attrs: uiutils.Attrs(\"aria-label\", vToLabel, \"data-slot\", \"range-to\")}})\n\t\t}\n\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"flex items-center gap-2\"}}) {\n\t\t\t@compose.Input(compose.InputProps{Size: \"sm\", InputProps: input.InputProps{Type: uiutils.S(vType), Value: uiutils.SP(vFrom), Min: uiutils.S(uiutils.Str(vMin)), Max: uiutils.S(uiutils.Str(vMax)), Attrs: uiutils.Attrs(\"aria-label\", vFromLabel)}})\n\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t{ uiutils.Text(\"–\") }\n\t\t\t}\n\t\t\t@compose.Input(compose.InputProps{Size: \"sm\", InputProps: input.InputProps{Type: uiutils.S(vType), Value: uiutils.SP(vTo), Min: uiutils.S(uiutils.Str(vMin)), Max: uiutils.S(uiutils.Str(vMax)), Attrs: uiutils.Attrs(\"aria-label\", vToLabel)}})\n\t\t}\n\t}\n}\n",
      "path": "blocks/range-field.templ",
      "target": "blocks/range-field.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "range-field",
  "registryDependencies": [
    "box",
    "inline",
    "input",
    "kit-box",
    "kit-input",
    "kit-text",
    "range",
    "utils"
  ],
  "runtime": "templ",
  "title": "Range Field",
  "type": "registry:component"
}
