35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import type { HTMLAttributes, ReactNode } from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export interface SelectProps {
|
|
value?: string;
|
|
defaultValue?: string;
|
|
onValueChange?: (value: string) => void;
|
|
disabled?: boolean;
|
|
children?: ReactNode;
|
|
}
|
|
|
|
export function Select({ children }: SelectProps) {
|
|
return <>{children}</>;
|
|
}
|
|
|
|
export function SelectTrigger({ className, ...props }: HTMLAttributes<HTMLButtonElement>) {
|
|
return <button type="button" className={cn(className)} {...props} />;
|
|
}
|
|
|
|
export function SelectValue({ placeholder, ...props }: HTMLAttributes<HTMLSpanElement> & { placeholder?: string }) {
|
|
return <span {...props}>{placeholder}</span>;
|
|
}
|
|
|
|
export function SelectContent({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
|
|
return <div className={cn(className)} {...props} />;
|
|
}
|
|
|
|
export function SelectItem({
|
|
className,
|
|
value,
|
|
...props
|
|
}: HTMLAttributes<HTMLDivElement> & { value: string }) {
|
|
return <div data-value={value} role="option" className={cn(className)} {...props} />;
|
|
}
|