import { forwardRef, type SelectHTMLAttributes } from 'react'
import { cn } from '@/lib/cn'

type Props = SelectHTMLAttributes<HTMLSelectElement>

export const Select = forwardRef<HTMLSelectElement, Props>(({ className, children, ...props }, ref) => (
  <select
    ref={ref}
    className={cn(
      // Density-first: matches Input — compact rounded-lg, brand focus glow.
      'h-8 w-full rounded-lg border border-slate-300 bg-white px-3 pr-8 text-sm text-slate-900',
      'transition-[border-color,box-shadow] focus-visible:border-brand-400 focus-visible:ring-2 focus-visible:ring-brand-500/15',
      'disabled:cursor-not-allowed disabled:bg-slate-50 disabled:opacity-70',
      className,
    )}
    {...props}
  >
    {children}
  </select>
))
Select.displayName = 'Select'
