| 1 | import * as React from "react"; |
| 2 | import { cn } from "@/lib/utils"; |
| 3 | |
| 4 | export const Input = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>( |
| 5 | function Input({ className, ...props }, ref) { |
| 6 | return ( |
| 7 | <input |
| 8 | ref={ref} |
| 9 | className={cn( |
| 10 | "h-10 w-full rounded-[var(--radius)] border border-[var(--color-border-default)] bg-[var(--color-bg-inset)]", |
| 11 | "px-3 text-sm text-[var(--color-fg-primary)] placeholder:text-[var(--color-fg-tertiary)]", |
| 12 | "transition-colors duration-[var(--duration-fast)]", |
| 13 | "focus-visible:border-[var(--color-accent-teal)] focus-visible:outline-none", |
| 14 | "aria-[invalid=true]:border-[var(--color-accent-red)]", |
| 15 | "disabled:cursor-not-allowed disabled:opacity-50", |
| 16 | className, |
| 17 | )} |
| 18 | {...props} |
| 19 | /> |
| 20 | ); |
| 21 | }, |
| 22 | ); |
| 23 | |
| 24 | export const Label = React.forwardRef<HTMLLabelElement, React.LabelHTMLAttributes<HTMLLabelElement>>( |
| 25 | function Label({ className, ...props }, ref) { |
| 26 | return ( |
| 27 | <label |
| 28 | ref={ref} |
| 29 | className={cn("text-xs font-medium text-[var(--color-fg-secondary)]", className)} |
| 30 | {...props} |
| 31 | /> |
| 32 | ); |
| 33 | }, |
| 34 | ); |