{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Range Field component",
  "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-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n\n  export 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</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Inline from \"../compose/Inline.svelte\";\n  import Input from \"../compose/Input.svelte\";\n  import Range from \"../compose/Range.svelte\";\n  import { cn } from \"../utils\";\n\n  let {\n    type,\n    from,\n    to,\n    fromLabel,\n    toLabel,\n    min,\n    max,\n    class: className,\n    onchange,\n  }: RangeFieldProps = $props();\n</script>\n\n<Box class={cn(\"flex flex-col gap-2\", className)} data-slot=\"range-field\">\n  {#if (((type as string) === \"number\") && (min != null) && (max != null) && (min < max))}\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: Event & { 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: Event & { currentTarget: HTMLInputElement }) => onchange?.(from, event.currentTarget.value)}\n    />\n  {/if}\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: Event & { 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: Event & { currentTarget: HTMLInputElement }) => onchange?.(from, event.currentTarget.value)}\n    />\n  </Inline>\n</Box>\n",
      "path": "components/range-field.svelte",
      "target": "components/range-field.svelte"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "svelte",
      "component"
    ]
  },
  "name": "range-field",
  "registryDependencies": [
    "box",
    "inline",
    "input",
    "range",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Range Field",
  "type": "registry:component"
}
