Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | import type { SelectHTMLAttributes, ReactNode } from 'react';
interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
label?: string;
children: ReactNode;
}
function Select({ label, className = '', children, ...props }: SelectProps) {
return (
<div className="flex flex-col gap-1.5">
{label && <label className="text-sm font-medium text-text-secondary">{label}</label>}
<select
className={`
w-full px-4 py-2.5 text-sm
bg-surface-secondary
text-text-primary
border border-border
rounded-input
transition-button
focus:outline-none focus:bg-white focus:border-accent focus:ring-0
appearance-none
${className}
`}
{...props}
>
{children}
</select>
</div>
);
}
export { Select };
|