import React, { forwardRef } from 'react' /** * Nova Select – styled native : * - Pass children () directly, OR * - Pass `options` array of { value, label } and optional `placeholder` * * @prop {Array} options - [{ value, label }] – optional shorthand * @prop {string} placeholder - adds a blank first option when using `options` * @prop {string} label - field label * @prop {string} error - validation error * @prop {string} hint - helper text * @prop {boolean} required - asterisk on label * @prop {string} size - 'sm' | 'md' | 'lg' */ const Select = forwardRef(function Select( { label, error, hint, required, options, placeholder, size = 'md', id, className = '', children, ...rest }, ref, ) { const inputId = id ?? (label ? label.toLowerCase().replace(/\s+/g, '-') : undefined) const sizeClass = { sm: 'py-1.5 text-xs', md: 'py-2.5 text-sm', lg: 'py-3 text-base', }[size] ?? 'py-2.5 text-sm' const inputClass = [ 'block w-full rounded-xl border bg-white/[0.06] text-white', 'pl-3.5 pr-9', 'appearance-none cursor-pointer', 'bg-no-repeat bg-right', 'transition-all duration-150', 'focus:outline-none focus:ring-2 focus:ring-offset-0', error ? 'border-red-500/60 focus:border-red-500/70 focus:ring-red-500/40' : 'border-white/12 hover:border-white/20 focus:border-accent/50 focus:ring-accent/40', 'disabled:opacity-50 disabled:cursor-not-allowed', sizeClass, className, ].join(' ') return (
{label && ( )}
{/* Custom chevron */}
{error &&

{error}

} {!error && hint &&

{hint}

}
) }) export default Select