{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider",
  "title": "Slider",
  "description": "A hairline track, a lit range, and a square handle. Single value or range.",
  "dependencies": [
    "@base-ui/react"
  ],
  "registryDependencies": [
    "@afterglow/theme"
  ],
  "files": [
    {
      "path": "registry/terminal/ui/slider.tsx",
      "content": "\"use client\";\n\nimport { Slider as SliderPrimitive } from \"@base-ui/react/slider\";\n\nimport { cn } from \"@/lib/utils\";\n\n// Base UI accepts either a number or an array for a single-thumb value.\nfunction thumbCount(\n  value: SliderPrimitive.Root.Props[\"value\"],\n  defaultValue: SliderPrimitive.Root.Props[\"defaultValue\"]\n): number {\n  if (Array.isArray(value)) {\n    return value.length;\n  }\n  if (Array.isArray(defaultValue)) {\n    return defaultValue.length;\n  }\n  if (typeof value === \"number\" || typeof defaultValue === \"number\") {\n    return 1;\n  }\n  return 2;\n}\n\nfunction Slider({\n  className,\n  defaultValue,\n  value,\n  min = 0,\n  max = 100,\n  ...props\n}: SliderPrimitive.Root.Props) {\n  const thumbs = thumbCount(value, defaultValue);\n\n  return (\n    <SliderPrimitive.Root\n      className={cn(\n        \"group/slider data-disabled:opacity-40 data-[orientation=horizontal]:h-8 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-8\",\n        className\n      )}\n      data-slot=\"slider\"\n      defaultValue={defaultValue}\n      max={max}\n      min={min}\n      thumbAlignment=\"edge\"\n      value={value}\n      {...props}\n    >\n      <SliderPrimitive.Control className=\"relative flex touch-none select-none items-center data-[orientation=horizontal]:h-full data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-full data-[orientation=vertical]:flex-col\">\n        <SliderPrimitive.Track\n          className=\"relative grow overflow-hidden rounded-none bg-phosphor/10 transition group-hover/slider:bg-phosphor/20 group-focus-within/slider:bg-phosphor/20 group-focus-within/slider:shadow-glow-slider-track data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1\"\n          data-slot=\"slider-track\"\n        >\n          <SliderPrimitive.Indicator\n            className=\"absolute bg-phosphor shadow-glow-slider-track data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\"\n            data-slot=\"slider-range\"\n          />\n        </SliderPrimitive.Track>\n        {Array.from({ length: thumbs }, (_, index) => (\n          <SliderPrimitive.Thumb\n            className=\"block shrink-0 rounded-none border border-phosphor bg-void shadow-glow-slider outline-none transition before:absolute before:content-[''] group-hover/slider:border-phosphor-bright group-hover/slider:bg-panel-raised group-hover/slider:shadow-glow-slider-hover has-[:focus-visible]:border-phosphor-bright has-[:focus-visible]:bg-panel-raised has-[:focus-visible]:shadow-glow-slider-hover has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-solid has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-phosphor-bright data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-2 data-[orientation=horizontal]:before:-inset-x-3 data-[orientation=horizontal]:before:-inset-y-2 data-[orientation=vertical]:h-2 data-[orientation=vertical]:w-4 data-[orientation=vertical]:before:-inset-x-2 data-[orientation=vertical]:before:-inset-y-3\"\n            data-slot=\"slider-thumb\"\n            // biome-ignore lint/suspicious/noArrayIndexKey: the thumb index is its position.\n            key={index}\n          />\n        ))}\n      </SliderPrimitive.Control>\n    </SliderPrimitive.Root>\n  );\n}\n\nexport { Slider };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}