chore: update devbook.md to mark completion of layout, UI components, and homepage; update dev.db

This commit is contained in:
Julien Froidefond
2025-11-27 13:11:11 +01:00
parent 6a9bf88a65
commit 27e409fb76
12 changed files with 701 additions and 10 deletions

View File

@@ -0,0 +1,45 @@
import { forwardRef, TextareaHTMLAttributes } from 'react';
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
label?: string;
error?: string;
}
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
({ className = '', label, error, id, ...props }, ref) => {
const textareaId = id || props.name;
return (
<div className="w-full">
{label && (
<label
htmlFor={textareaId}
className="mb-2 block text-sm font-medium text-foreground"
>
{label}
</label>
)}
<textarea
ref={ref}
id={textareaId}
className={`
w-full rounded-lg border bg-input px-4 py-2.5 text-foreground
placeholder:text-muted-foreground
focus:outline-none focus:ring-2 focus:ring-primary/20
disabled:cursor-not-allowed disabled:opacity-50
resize-none
${error ? 'border-destructive focus:border-destructive' : 'border-input-border focus:border-primary'}
${className}
`}
{...props}
/>
{error && (
<p className="mt-1.5 text-sm text-destructive">{error}</p>
)}
</div>
);
}
);
Textarea.displayName = 'Textarea';