feat(registratura): add best practices popover + contextual tooltips on form fields

- "Bune practici" button in registry header opens a popover with internal rules
  (numerotare, completare, termene, atașamente, închidere)
- Info tooltips on form labels: Direcție, Tip document, Subiect, Expeditor,
  Destinatar, Atașamente (consistent with existing pattern on Data document)
- Install shadcn/ui Popover component

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-10 08:21:54 +02:00
parent 6786ac07d1
commit eb96af3e4b
3 changed files with 254 additions and 9 deletions
@@ -526,7 +526,22 @@ export function RegistryEntryForm({
{/* Row 1: Direction + Document type + Date */}
<div className="grid gap-4 sm:grid-cols-3">
<div>
<Label>Direcție</Label>
<Label className="flex items-center gap-1.5">
Direcție
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Info className="h-3.5 w-3.5 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent side="right" className="max-w-xs">
<p className="text-xs">
Intrat = document primit de la terți. Ieșit = document
emis de noi către terți.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</Label>
<div className="mt-1 flex rounded-lg border bg-muted/30 p-1">
<button
type="button"
@@ -557,7 +572,22 @@ export function RegistryEntryForm({
</div>
</div>
<div>
<Label>Tip document</Label>
<Label className="flex items-center gap-1.5">
Tip document
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Info className="h-3.5 w-3.5 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent side="right" className="max-w-xs">
<p className="text-xs">
Alege tipul care descrie cel mai bine documentul. Poți
adăuga tipuri noi cu câmpul de mai jos.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</Label>
<div className="mt-1">
<Select
value={allDocTypes.has(documentType) ? documentType : "altele"}
@@ -635,7 +665,23 @@ export function RegistryEntryForm({
{/* Subject */}
<div>
<Label>Subiect *</Label>
<Label className="flex items-center gap-1.5">
Subiect *
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Info className="h-3.5 w-3.5 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent side="right" className="max-w-xs">
<p className="text-xs">
Scurt și descriptiv: «Cerere CU nr. 123/2026 Str.
Exemplu» sau «Aviz ISU Proiect X». Nu folosi prefixe de
numerotare.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</Label>
<Input
value={subject}
onChange={(e) => setSubject(e.target.value)}
@@ -648,7 +694,22 @@ export function RegistryEntryForm({
<div className="grid gap-4 sm:grid-cols-2">
{/* Sender */}
<div className="relative">
<Label>Expeditor</Label>
<Label className="flex items-center gap-1.5">
Expeditor
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Info className="h-3.5 w-3.5 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent side="right" className="max-w-xs">
<p className="text-xs">
Cine a trimis documentul. Caută în Agenda de contacte sau
creează rapid un contact nou.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</Label>
<Input
value={sender}
onChange={(e) => {
@@ -674,7 +735,22 @@ export function RegistryEntryForm({
</div>
{/* Recipient */}
<div className="relative">
<Label>Destinatar</Label>
<Label className="flex items-center gap-1.5">
Destinatar
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Info className="h-3.5 w-3.5 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent side="right" className="max-w-xs">
<p className="text-xs">
Cui trimitem documentul. Caută în Agenda de contacte sau
creează rapid un contact nou.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</Label>
<Input
value={recipient}
onChange={(e) => {
@@ -1179,6 +1255,19 @@ export function RegistryEntryForm({
<div className="flex items-center justify-between">
<Label className="flex items-center gap-1.5">
Atașamente
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Info className="h-3.5 w-3.5 text-muted-foreground cursor-help" />
</TooltipTrigger>
<TooltipContent side="right" className="max-w-xs">
<p className="text-xs">
Atașează fișiere sau introdu căi de rețea NAS
(\\newamun\...). Preferă NAS pentru fișiere mari (&gt;5MB).
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
{isUploading && (
<span className="flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400 font-normal">
<Loader2 className="h-3 w-3 animate-spin" />