Spaces:
Build error
Build error
Mehdi commited on
Upload components/ui/select.tsx with huggingface_hub
Browse files- components/ui/select.tsx +40 -0
components/ui/select.tsx
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from "react";
|
| 2 |
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
| 3 |
+
import { Check, ChevronDown } from "lucide-react";
|
| 4 |
+
import { cn } from "@/lib/utils";
|
| 5 |
+
|
| 6 |
+
const Select = SelectPrimitive.Root;
|
| 7 |
+
|
| 8 |
+
const SelectGroup = SelectPrimitive.Group;
|
| 9 |
+
|
| 10 |
+
const SelectValue = SelectPrimitive.Value;
|
| 11 |
+
|
| 12 |
+
const SelectTrigger = React.forwardRef<
|
| 13 |
+
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
| 14 |
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
| 15 |
+
>(({ className, children, ...props }, ref) => (
|
| 16 |
+
<SelectPrimitive.Trigger
|
| 17 |
+
ref={ref}
|
| 18 |
+
className={cn(
|
| 19 |
+
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
| 20 |
+
className
|
| 21 |
+
)}
|
| 22 |
+
{...props}
|
| 23 |
+
>
|
| 24 |
+
{children}
|
| 25 |
+
<SelectPrimitive.Icon asChild>
|
| 26 |
+
<ChevronDown className="h-4 w-4 opacity-50" />
|
| 27 |
+
</SelectPrimitive.Icon>
|
| 28 |
+
</SelectPrimitive.Trigger>
|
| 29 |
+
));
|
| 30 |
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
| 31 |
+
|
| 32 |
+
const SelectContent = React.forwardRef<
|
| 33 |
+
React.ElementRef<typeof SelectPrimitive.Content>,
|
| 34 |
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
| 35 |
+
>(({ className, children, position = "popper", ...props }, ref) => (
|
| 36 |
+
<SelectPrimitive.Portal>
|
| 37 |
+
<SelectPrimitive.Content
|
| 38 |
+
ref={ref}
|
| 39 |
+
className={cn(
|
| 40 |
+
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:
|