260703_01_FST: First Commit
This commit is contained in:
34
.tooling/components/ui/select.tsx
Normal file
34
.tooling/components/ui/select.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
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} />;
|
||||
}
|
||||
Reference in New Issue
Block a user