{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "slider-27",
  "title": "Equalizer",
  "description": "Five upright bands that show their gain while dragging.",
  "dependencies": [
    "@base-ui/react"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/components/slider/slider-27.tsx",
      "content": "'use client';\n\nimport { Slider as SliderPrimitive } from '@base-ui/react/slider';\nimport { useState } from 'react';\n\ntype Band = {\n  frequency: string;\n  name: string;\n  initialGain: number;\n};\n\nconst BANDS: Band[] = [\n  { frequency: '60', name: '60 Hz', initialGain: 2 },\n  { frequency: '250', name: '250 Hz', initialGain: 1 },\n  { frequency: '1k', name: '1 kHz', initialGain: -1 },\n  { frequency: '4k', name: '4 kHz', initialGain: -3 },\n  { frequency: '16k', name: '16 kHz', initialGain: 2 },\n];\n\nconst MIN_GAIN = -5;\nconst MAX_GAIN = 5;\n\nconst CONTROL =\n  'relative flex h-full touch-none flex-col items-center px-2 select-none data-disabled:opacity-50';\n\nconst TRACK = 'bg-foreground/10 relative h-full w-1 grow rounded-full';\n\nconst THUMB = [\n  'group/thumb block h-6 w-4 shrink-0 rounded-[5px] bg-white shadow-[0_1px_3px_rgb(0_0_0/0.18)] hairline-ring ring-foreground/15 outline-none',\n  'transition-[scale,box-shadow] duration-150 ease-(--ease-out-strong) has-focus-visible:ring-[3px] has-focus-visible:ring-ring/30 data-dragging:scale-110',\n].join(' ');\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 gainLabelOf(gain: number) {\n  if (gain > 0) {\n    return `+${gain} dB`;\n  }\n  return `${gain} dB`;\n}\n\nfunction gainTextOf(_formattedValue: string, gain: number) {\n  return gainLabelOf(gain);\n}\n\nfunction EqualizerBand({ band }: { band: Band }) {\n  const [gain, setGain] = useState(band.initialGain);\n\n  return (\n    <div className='relative flex flex-col items-center gap-2 has-focus-visible:z-10 has-data-dragging:z-10'>\n      <SliderPrimitive.Root\n        value={gain}\n        onValueChange={setGain}\n        min={MIN_GAIN}\n        max={MAX_GAIN}\n        orientation='vertical'\n        className='min-h-0 flex-1'\n      >\n        <SliderPrimitive.Control className={CONTROL}>\n          <SliderPrimitive.Track className={TRACK}>\n            <SliderPrimitive.Indicator className='bg-primary rounded-full' />\n            <SliderPrimitive.Thumb\n              aria-label={band.name}\n              getAriaValueText={gainTextOf}\n              className={THUMB}\n            >\n              <span className={VALUE_BUBBLE} aria-hidden='true'>\n                {gainLabelOf(gain)}\n              </span>\n            </SliderPrimitive.Thumb>\n          </SliderPrimitive.Track>\n        </SliderPrimitive.Control>\n      </SliderPrimitive.Root>\n      <span\n        className='text-muted-foreground text-xs tabular-nums'\n        aria-hidden='true'\n      >\n        {band.frequency}\n      </span>\n    </div>\n  );\n}\n\nexport default function Slider27() {\n  return (\n    <fieldset className='flex w-full max-w-xs flex-col px-2'>\n      <legend className='mb-4 text-[13px] font-medium'>Equalizer</legend>\n      <div className='flex h-48 justify-center gap-8'>\n        {BANDS.map((band) => (\n          <EqualizerBand key={band.frequency} band={band} />\n        ))}\n      </div>\n    </fieldset>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "components",
    "slider"
  ],
  "type": "registry:component"
}