"use client"; import { type ButtonHTMLAttributes, type InputHTMLAttributes, type ReactNode, type SelectHTMLAttributes, type TextareaHTMLAttributes, useEffect, } from "react"; import { cn, toFa } from "@/lib/utils"; import { CloseIcon, SpinnerIcon } from "./icons"; /* ------------------------------- Button -------------------------------- */ type ButtonVariant = "primary" | "secondary" | "danger" | "ghost"; interface ButtonProps extends ButtonHTMLAttributes { variant?: ButtonVariant; loading?: boolean; icon?: ReactNode; } const buttonVariants: Record = { primary: "bg-primary text-white hover:bg-primary-hover", secondary: "bg-surface-muted text-foreground hover:bg-surface-hover border border-border", danger: "bg-danger text-white hover:opacity-90", ghost: "text-muted hover:bg-surface-muted", }; export function Button({ variant = "primary", loading, icon, className, children, disabled, ...props }: ButtonProps) { return ( ); } /* ------------------------------- Fields -------------------------------- */ export function Field({ label, hint, required, children, }: { label: string; hint?: string; required?: boolean; children: ReactNode; }) { return ( ); } const fieldClass = "w-full rounded-xl border border-border bg-surface px-3 py-2 text-sm outline-none transition focus:border-primary focus:ring-4 focus:ring-[var(--ring)] disabled:opacity-60"; export function Input(props: InputHTMLAttributes) { return ; } export function Textarea(props: TextareaHTMLAttributes) { return (