refactor(ui): unify low-level controls and expand design system
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 2m57s

This commit is contained in:
2026-03-03 15:50:15 +01:00
parent 9a43980412
commit db7a0cef96
47 changed files with 1404 additions and 711 deletions

View File

@@ -0,0 +1,59 @@
import { ReactNode } from 'react';
import { InlineFormActions } from './InlineFormActions';
interface InlineAddItemProps {
value: string;
onChange: (value: string) => void;
onSubmit: () => void;
onCancel: () => void;
isPending: boolean;
placeholder?: string;
rows?: number;
extra?: ReactNode;
submitColorClass?: string;
className?: string;
}
export function InlineAddItem({
value,
onChange,
onSubmit,
onCancel,
isPending,
placeholder,
rows = 2,
extra,
submitColorClass,
className = '',
}: InlineAddItemProps) {
return (
<div className={`rounded-lg border border-border bg-card p-2 shadow-sm ${className}`}>
<textarea
autoFocus
value={value}
onChange={(e) => onChange(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
onSubmit();
} else if (e.key === 'Escape') {
onCancel();
}
}}
placeholder={placeholder}
className="w-full resize-none rounded border-0 bg-transparent p-1 text-sm text-foreground placeholder:text-muted focus:outline-none focus:ring-0"
rows={rows}
disabled={isPending}
/>
{extra}
<InlineFormActions
onCancel={onCancel}
onSubmit={onSubmit}
isPending={isPending}
disabled={!value.trim()}
submitColorClass={submitColorClass}
className="mt-1"
/>
</div>
);
}