{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider",
  "title": "Slider",
  "description": "Pick a number or a range by dragging or with the arrow keys, horizontal or vertical.",
  "dependencies": [
    "@radix-ui/react-slider"
  ],
  "registryDependencies": [
    "@corsair-ui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/slider.tsx",
      "content": "\"use client\";\n\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport type { ComponentProps } from \"react\";\n\nimport { cn } from \"@/registry/default/lib/utils\";\n\ninterface SliderProps extends ComponentProps<typeof SliderPrimitive.Root> {\n  /**\n   * An accessible name for each thumb, e.g. `[\"Minimum price\", \"Maximum price\"]`.\n   * With one thumb, `aria-label` / `aria-labelledby` on the slider are enough.\n   */\n  thumbLabels?: string[];\n}\n\n/**\n * Pick a number, or a range with two values, by dragging or with the arrow\n * keys. The number of thumbs follows `value` / `defaultValue`.\n */\nfunction Slider({\n  className,\n  defaultValue,\n  value,\n  min = 0,\n  max = 100,\n  thumbLabels,\n  \"aria-label\": ariaLabel,\n  \"aria-labelledby\": ariaLabelledBy,\n  ...props\n}: SliderProps) {\n  const count = (value ?? defaultValue ?? [min]).length;\n\n  return (\n    <SliderPrimitive.Root\n      data-slot=\"slider\"\n      defaultValue={defaultValue}\n      value={value}\n      min={min}\n      max={max}\n      className={cn(\n        \"relative flex w-full cursor-pointer touch-none items-center select-none\",\n        \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n        \"data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n        className\n      )}\n      {...props}\n    >\n      <SliderPrimitive.Track\n        data-slot=\"slider-track\"\n        className=\"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\"\n      >\n        <SliderPrimitive.Range\n          data-slot=\"slider-range\"\n          className=\"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\"\n        />\n      </SliderPrimitive.Track>\n      {Array.from({ length: count }, (_, index) => (\n        <SliderPrimitive.Thumb\n          // Thumbs are positional (the first is the lower value), so the index is the identity.\n          key={index}\n          data-slot=\"slider-thumb\"\n          aria-label={thumbLabels?.[index] ?? (count === 1 ? ariaLabel : undefined)}\n          aria-labelledby={thumbLabels?.[index] ? undefined : ariaLabelledBy}\n          className={cn(\n            \"border-primary bg-background ring-ring/50 block size-4 shrink-0 cursor-grab rounded-full border shadow active:cursor-grabbing\",\n            \"transition-[color,box-shadow] outline-none motion-reduce:transition-none\",\n            \"hover:ring-4 focus-visible:ring-4\",\n            \"disabled:pointer-events-none disabled:opacity-50\"\n          )}\n        />\n      ))}\n    </SliderPrimitive.Root>\n  );\n}\n\nexport { Slider, type SliderProps };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}