{
  "$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/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n/**\n * A from–to pair for numbers or dates (price range, period). Empty means an open end. With numeric bounds two\n * sliders sit above the inputs. Each control has its own accessible name; every change reports both ends.\n */\nimport { type JSX } from \"solid-js\";\nimport { Box, Inline, Input, Range } from \"../compose\";\nimport { cn } from \"../utils\";\n\nexport type RangeFieldProps = {\n  type: \"number\" | \"date\";\n  from: string;\n  to: string;\n  fromLabel: string;\n  toLabel: string;\n  min?: number;\n  max?: number;\n  class?: string;\n  onChange?: (from: string, to: string) => void;\n};\n\nexport function RangeField({\n  type,\n  from,\n  to,\n  fromLabel,\n  toLabel,\n  min,\n  max,\n  class: className,\n  onChange,\n}: RangeFieldProps) {\n  return (\n    <Box class={cn(\"flex flex-col gap-2\", className)} data-slot=\"range-field\">\n      {(((type as string) === \"number\") && (min != null) && (max != null) && (min < max)) ? (\n        <>\n          <Range\n            min={min}\n            max={max}\n            aria-label={fromLabel}\n            value={(((from as string) === \"\") ? (min == null ? undefined : String(min)) : from)}\n            data-slot=\"range-from\"\n            onInput={(event: InputEvent & { currentTarget: HTMLInputElement }) => onChange?.(event.currentTarget.value, to)}\n          />\n          <Range\n            min={min}\n            max={max}\n            aria-label={toLabel}\n            value={(((to as string) === \"\") ? (max == null ? undefined : String(max)) : to)}\n            data-slot=\"range-to\"\n            onInput={(event: InputEvent & { currentTarget: HTMLInputElement }) => onChange?.(from, event.currentTarget.value)}\n          />\n        </>\n      ) : null}\n      <Inline class=\"flex items-center gap-2\">\n        <Input\n          type={type}\n          size=\"sm\"\n          aria-label={fromLabel}\n          value={from}\n          min={(min == null ? undefined : String(min))}\n          max={(max == null ? undefined : String(max))}\n          onInput={(event: InputEvent & { currentTarget: HTMLInputElement }) => onChange?.(event.currentTarget.value, to)}\n        />\n        <Inline class=\"text-muted-foreground\">\n          {\"–\"}\n        </Inline>\n        <Input\n          type={type}\n          size=\"sm\"\n          aria-label={toLabel}\n          value={to}\n          min={(min == null ? undefined : String(min))}\n          max={(max == null ? undefined : String(max))}\n          onInput={(event: InputEvent & { currentTarget: HTMLInputElement }) => onChange?.(from, event.currentTarget.value)}\n        />\n      </Inline>\n    </Box>\n  );\n}\n",
      "path": "components/range-field.tsx",
      "target": "components/range-field.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "range-field",
  "registryDependencies": [
    "compose",
    "utils"
  ],
  "runtime": "solid",
  "title": "Range Field",
  "type": "registry:component"
}
