● Zion Boggan
repos/Drophawk/frontend/components/ui/select.tsx
zionboggan.com ↗
31 lines · tsx
History for this file →
1
import * as React from "react";
2
import { ChevronDown } from "lucide-react";
3
import { cn } from "@/lib/utils";
4
 
5
 
6
export const Select = React.forwardRef<
7
  HTMLSelectElement,
8
  React.SelectHTMLAttributes<HTMLSelectElement>
9
>(function Select({ className, children, ...props }, ref) {
10
  return (
11
    <div className="relative">
12
      <select
13
        ref={ref}
14
        className={cn(
15
          "h-10 w-full appearance-none rounded-[var(--radius)] border border-[var(--color-border-default)] bg-[var(--color-bg-inset)]",
16
          "px-3 pr-9 text-sm text-[var(--color-fg-primary)]",
17
          "transition-colors duration-[var(--duration-fast)] focus-visible:border-[var(--color-accent-teal)] focus-visible:outline-none",
18
          "disabled:cursor-not-allowed disabled:opacity-50",
19
          className,
20
        )}
21
        {...props}
22
      >
23
        {children}
24
      </select>
25
      <ChevronDown
26
        className="pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--color-fg-tertiary)]"
27
        aria-hidden
28
      />
29
    </div>
30
  );
31
});