- Introduced `Field` and `Label` components for better form handling. - Refactored `Input` and `Textarea` components to use forward refs and improved styling. - Updated `PendingSubmitButton` to use the new `Button` component. - Enhanced `Skeleton` component for better layout handling. - Revamped `Toast` component to support live regions and improved accessibility. - Updated sidebar configuration to use typed icons. - Added phase 3 UI boundary checks to prevent usage of deprecated imports. - Implemented new authentication action handler for better cookie management. - Improved setup logic for freelancer accounts with repair functionality.
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import { forwardRef } from "react";
|
|
import type { InputHTMLAttributes, TextareaHTMLAttributes } from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
const controlClasses =
|
|
"w-full rounded-md border border-input bg-input-bg px-3 text-sm text-foreground shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground disabled:opacity-80 aria-invalid:border-destructive aria-invalid:ring-destructive";
|
|
|
|
export type InputProps = InputHTMLAttributes<HTMLInputElement>;
|
|
|
|
export const Input = forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => (
|
|
<input ref={ref} className={cn(controlClasses, "h-10", className)} {...props} />
|
|
));
|
|
|
|
Input.displayName = "Input";
|
|
|
|
export type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
|
|
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
({ className, ...props }, ref) => (
|
|
<textarea
|
|
ref={ref}
|
|
className={cn(controlClasses, "min-h-24 py-2", className)}
|
|
{...props}
|
|
/>
|
|
),
|
|
);
|
|
|
|
Textarea.displayName = "Textarea";
|