{
  "$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\">\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};\n</script>\n\n<script setup lang=\"ts\">\nimport Box from \"../compose/Box.vue\";\nimport Inline from \"../compose/Inline.vue\";\nimport Input from \"../compose/Input.vue\";\nimport Range from \"../compose/Range.vue\";\nimport { cn } from \"../utils\";\n\nconst { type, from, to, fromLabel, toLabel, min, max, class: className } = defineProps<RangeFieldProps>();\nconst emit = defineEmits<{ change: [from: string, to: string] }>();\n</script>\n\n<template>\n  <Box :class=\"cn('flex flex-col gap-2', className)\" data-slot=\"range-field\">\n    <template v-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        @input=\"(event: Event & { currentTarget: HTMLInputElement }) => emit('change', 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        @input=\"(event: Event & { currentTarget: HTMLInputElement }) => emit('change', from, event.currentTarget.value)\"\n      />\n    </template>\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        @input=\"(event: Event & { currentTarget: HTMLInputElement }) => emit('change', 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        @input=\"(event: Event & { currentTarget: HTMLInputElement }) => emit('change', from, event.currentTarget.value)\"\n      />\n    </Inline>\n  </Box>\n</template>\n",
      "path": "components/range-field.vue",
      "target": "components/range-field.vue"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "vue",
      "component"
    ]
  },
  "name": "range-field",
  "registryDependencies": [
    "box",
    "inline",
    "input",
    "range",
    "utils"
  ],
  "runtime": "vue",
  "title": "Range Field",
  "type": "registry:component"
}
