This commit is contained in:
Hunter Thornsberry
2024-08-10 19:07:02 -04:00
parent 1eedb6d97b
commit e7892fd6a0
6 changed files with 52 additions and 41 deletions
+8 -6
View File
@@ -1,18 +1,16 @@
import * as React from "react";
import { cn } from "@core/utils/cn.js";
import { type VariantProps, cva } from "class-variance-authority";
import type { LucideIcon } from "lucide-react";
import { cva, VariantProps } from "class-variance-authority";
const inputVariants = cva(
"flex h-10 w-full rounded-md border bg-transparent py-2 px-3 text-sm placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:text-slate-50 dark:focus:ring-slate-400 dark:focus:ring-offset-slate-900",
{
variants: {
variant: {
default:
"border-slate-300 dark:border-slate-700",
invalid:
"border-red-500 dark:border-red-500",
default: "border-slate-300 dark:border-slate-700",
invalid: "border-red-500 dark:border-red-500",
},
},
defaultVariants: {
@@ -42,7 +40,11 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
</span>
)}
<input
className={cn(action && "pr-8", className, inputVariants({ variant }))}
className={cn(
action && "pr-8",
className,
inputVariants({ variant }),
)}
ref={ref}
{...props}
/>