{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider-24",
  "title": "Vertical range slider",
  "description": "An upright range with a value bubble beside each thumb.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/label.json",
    "https://ui.ndekocode.dev/r/slider.json",
    "https://ui.ndekocode.dev/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/components/slider/slider-24.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { Label } from '@/registry/ndeko/ui/label';\nimport { Slider } from '@/registry/ndeko/ui/slider';\n\ntype SliderValue = number | readonly number[];\n\nconst THUMB_LABELS = ['Lowest difficulty', 'Highest difficulty'];\n\nconst VALUE_BUBBLE = [\n  'pointer-events-none absolute start-full top-1/2 ms-2.5 -translate-y-1/2 origin-left whitespace-nowrap',\n  'rounded-lg px-2 py-1 text-xs font-medium tabular-nums text-popover-foreground',\n  '[--bubble-top:var(--popover)] [--bubble-bottom:color-mix(in_oklab,var(--popover),var(--primary)_9%)]',\n  'bg-linear-to-b from-(--bubble-top) to-(--bubble-bottom) hairline-ring ring-border shadow-md shadow-black/6',\n  'scale-95 opacity-0 transition-[opacity,scale] duration-150 ease-(--ease-out-strong)',\n  'group-data-dragging/thumb:scale-100 group-data-dragging/thumb:opacity-100',\n  'group-has-focus-visible/thumb:scale-100 group-has-focus-visible/thumb:opacity-100',\n].join(' ');\n\nfunction valuesOf(value: SliderValue) {\n  if (typeof value === 'number') {\n    return [value];\n  }\n  return [...value];\n}\n\nexport default function Slider24() {\n  const [difficulties, setDifficulties] = useState([2, 7]);\n\n  function changeDifficulties(value: SliderValue) {\n    const nextDifficulties = valuesOf(value);\n    setDifficulties(nextDifficulties);\n  }\n\n  function renderDifficulty(index: number) {\n    return (\n      <span className={VALUE_BUBBLE} aria-hidden='true'>\n        {difficulties[index]}\n      </span>\n    );\n  }\n\n  return (\n    <div className='flex w-full max-w-xs flex-col gap-3'>\n      <Label>Difficulty range</Label>\n      <div className='flex h-40 justify-center'>\n        <Slider\n          value={difficulties}\n          onValueChange={changeDifficulties}\n          max={10}\n          orientation='vertical'\n          thumbLabels={THUMB_LABELS}\n          thumbContent={renderDifficulty}\n        />\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "components",
    "slider"
  ],
  "type": "registry:component"
}