31 lines
1.3 KiB
TypeScript
31 lines
1.3 KiB
TypeScript
/**
|
|
* Select Component
|
|
* Styled native select matching shadcn/ui conventions
|
|
*/
|
|
import * as React from 'react';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
export type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement>;
|
|
|
|
const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
({ className, children, ...props }, ref) => {
|
|
return (
|
|
<select
|
|
className={cn(
|
|
'motion-press flex h-10 w-full rounded-xl border border-border/80 bg-surface-input px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:border-brand/45 focus-visible:ring-2 focus-visible:ring-ring/20 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 appearance-none bg-[length:16px_16px] bg-[right_12px_center] bg-no-repeat',
|
|
'bg-[url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22/%3E%3C/svg%3E")]',
|
|
'pr-10',
|
|
className
|
|
)}
|
|
ref={ref}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</select>
|
|
);
|
|
}
|
|
);
|
|
Select.displayName = 'Select';
|
|
|
|
export { Select };
|