UI: alle 8 Dialoge auf barrierearme Modal-Basis umgestellt
Bisher waren alle Overlay-Dialoge plain divs ohne role/Fokus-Trap/Escape. Jetzt setzen sie auf <Modal> auf (role=dialog, aria-modal, Fokus-Trap + -Rueckgabe, Escape, Body-Scroll-Lock, konsistenter X-Button, Scroll bei langem Inhalt). - Modal: X-Schliessen-Button + max-h-[90vh]/overflow-y-auto ergaenzt - BlockerDialog, ManualDialog (Timeline) - leads: CSV-Import + Neuer Lead - bereich: Neues Projekt - projekt: Gate-Review + Projekt abschliessen - lead: Zu Deal machen Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
30006e3b32
commit
f600c9f187
7 files changed
+41
-118
No files matched your search
@@ -3,6 +3,7 @@ import { toast } from 'sonner';
|
|||||||
import { trpc } from '../../lib/trpc';
|
import { trpc } from '../../lib/trpc';
|
||||||
import { voice } from '../../lib/voice';
|
import { voice } from '../../lib/voice';
|
||||||
import { Button } from '../ui/Button';
|
import { Button } from '../ui/Button';
|
||||||
|
import { Modal } from '../ui/Modal';
|
||||||
|
|
||||||
export function BlockerDialog({ onClose }: { onClose: () => void }) {
|
export function BlockerDialog({ onClose }: { onClose: () => void }) {
|
||||||
const [title, setTitle] = useState('');
|
const [title, setTitle] = useState('');
|
||||||
@@ -23,15 +24,7 @@ export function BlockerDialog({ onClose }: { onClose: () => void }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title="Neuer Blocker">
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="w-full max-w-md rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<h2 className="text-xl font-semibold">Neuer Blocker</h2>
|
|
||||||
<form onSubmit={submit} className="mt-4 space-y-3">
|
<form onSubmit={submit} className="mt-4 space-y-3">
|
||||||
<label className="block">
|
<label className="block">
|
||||||
<span className="text-sm font-medium">Was klemmt?</span>
|
<span className="text-sm font-medium">Was klemmt?</span>
|
||||||
@@ -65,7 +58,6 @@ export function BlockerDialog({ onClose }: { onClose: () => void }) {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Pencil, Trash2, Plus, X } from 'lucide-react';
|
import { Pencil, Trash2, Plus } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { clsx } from 'clsx';
|
import { clsx } from 'clsx';
|
||||||
import { trpc } from '../../lib/trpc';
|
import { trpc } from '../../lib/trpc';
|
||||||
import { Card } from '../ui/Card';
|
import { Card } from '../ui/Card';
|
||||||
import { Button } from '../ui/Button';
|
import { Button } from '../ui/Button';
|
||||||
|
import { Modal } from '../ui/Modal';
|
||||||
import { formatDuration, formatDurationCompact } from '../../lib/format-duration';
|
import { formatDuration, formatDurationCompact } from '../../lib/format-duration';
|
||||||
import { TIME_CATEGORIES, type TimeCategory } from '../../lib/time-categories';
|
import { TIME_CATEGORIES, type TimeCategory } from '../../lib/time-categories';
|
||||||
|
|
||||||
@@ -333,25 +334,7 @@ export function ManualDialog({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title="Block nachtragen">
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="w-full max-w-md rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<h2 className="text-xl font-semibold">Block nachtragen</h2>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={onClose}
|
|
||||||
aria-label="Schließen"
|
|
||||||
className="rounded-[var(--radius-sm)] p-1 text-[var(--color-ink-muted)] hover:bg-black/5"
|
|
||||||
>
|
|
||||||
<X size={16} />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<form onSubmit={submit} className="mt-4 space-y-3">
|
<form onSubmit={submit} className="mt-4 space-y-3">
|
||||||
<div className="grid grid-cols-2 gap-2">
|
<div className="grid grid-cols-2 gap-2">
|
||||||
<label className="block">
|
<label className="block">
|
||||||
@@ -423,7 +406,6 @@ export function ManualDialog({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useEffect, useId, useRef, type ReactNode } from 'react';
|
import { useEffect, useId, useRef, type ReactNode } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
|
import { X } from 'lucide-react';
|
||||||
|
|
||||||
type Size = 'sm' | 'md' | 'lg';
|
type Size = 'sm' | 'md' | 'lg';
|
||||||
|
|
||||||
@@ -94,10 +95,18 @@ export function Modal({
|
|||||||
aria-modal="true"
|
aria-modal="true"
|
||||||
aria-labelledby={title != null ? titleId : undefined}
|
aria-labelledby={title != null ? titleId : undefined}
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
className={`w-full ${maxWidth[size]} rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)] focus:outline-none`}
|
className={`relative max-h-[90vh] w-full ${maxWidth[size]} overflow-y-auto rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)] focus:outline-none`}
|
||||||
>
|
>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={onClose}
|
||||||
|
aria-label="Schließen"
|
||||||
|
className="absolute right-4 top-4 rounded-[var(--radius-sm)] p-1 text-[var(--color-ink-muted)] hover:bg-black/5 hover:text-[var(--color-ink)]"
|
||||||
|
>
|
||||||
|
<X size={18} />
|
||||||
|
</button>
|
||||||
{title != null && (
|
{title != null && (
|
||||||
<h2 id={titleId} className="text-xl font-semibold">
|
<h2 id={titleId} className="pr-8 text-xl font-semibold">
|
||||||
{title}
|
{title}
|
||||||
</h2>
|
</h2>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { trpc } from '../lib/trpc';
|
|||||||
import { voice } from '../lib/voice';
|
import { voice } from '../lib/voice';
|
||||||
import { Card } from '../components/ui/Card';
|
import { Card } from '../components/ui/Card';
|
||||||
import { Button } from '../components/ui/Button';
|
import { Button } from '../components/ui/Button';
|
||||||
|
import { Modal } from '../components/ui/Modal';
|
||||||
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { clsx } from 'clsx';
|
import { clsx } from 'clsx';
|
||||||
@@ -220,15 +221,7 @@ function ProjectCreateDialog({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title="Neues Projekt">
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="w-full max-w-md rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<h2 className="text-xl font-semibold">Neues Projekt</h2>
|
|
||||||
<form onSubmit={submit} className="mt-4 space-y-3">
|
<form onSubmit={submit} className="mt-4 space-y-3">
|
||||||
<Field label="Name">
|
<Field label="Name">
|
||||||
<input
|
<input
|
||||||
@@ -307,8 +300,7 @@ function ProjectCreateDialog({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { Card } from '../components/ui/Card';
|
|||||||
import { Button } from '../components/ui/Button';
|
import { Button } from '../components/ui/Button';
|
||||||
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
||||||
import { ErrorState } from '../components/ui/ErrorState';
|
import { ErrorState } from '../components/ui/ErrorState';
|
||||||
|
import { Modal } from '../components/ui/Modal';
|
||||||
import { useConfirm } from '../components/ui/ConfirmProvider';
|
import { useConfirm } from '../components/ui/ConfirmProvider';
|
||||||
import {
|
import {
|
||||||
LEAD_STATUS_META,
|
LEAD_STATUS_META,
|
||||||
@@ -357,15 +358,7 @@ function PromoteDialog({ leadId, onClose }: { leadId: string; onClose: () => voi
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title="Zu Deal machen" size="sm">
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="w-full max-w-sm rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<h2 className="text-xl font-semibold">Zu Deal machen</h2>
|
|
||||||
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
||||||
Legt einen Pipeline-Deal in Stufe „Lead“ an und verknüpft ihn.
|
Legt einen Pipeline-Deal in Stufe „Lead“ an und verknüpft ihn.
|
||||||
</p>
|
</p>
|
||||||
@@ -406,8 +399,7 @@ function PromoteDialog({ leadId, onClose }: { leadId: string; onClose: () => voi
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { trpc } from '../lib/trpc';
|
|||||||
import { voice } from '../lib/voice';
|
import { voice } from '../lib/voice';
|
||||||
import { Card } from '../components/ui/Card';
|
import { Card } from '../components/ui/Card';
|
||||||
import { Button } from '../components/ui/Button';
|
import { Button } from '../components/ui/Button';
|
||||||
|
import { Modal } from '../components/ui/Modal';
|
||||||
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
||||||
import { LEAD_STATUS_META, LEAD_STATUS_ORDER, type LeadStatus } from '../lib/lead-meta';
|
import { LEAD_STATUS_META, LEAD_STATUS_ORDER, type LeadStatus } from '../lib/lead-meta';
|
||||||
|
|
||||||
@@ -107,20 +108,12 @@ function LeadImportDialog({ onClose }: { onClose: () => void }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title="Leads aus CSV importieren">
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="w-full max-w-md rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<h2 className="text-xl font-semibold">Leads aus CSV importieren</h2>
|
|
||||||
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
||||||
Spalten: Quelle, Vorname, Nachname, Position, Firma, Straße, PLZ, Ort, Telefon, Mobil,
|
Spalten: Quelle, Vorname, Nachname, Position, Firma, Straße, PLZ, Ort, Telefon, Mobil, Fax,
|
||||||
Fax, E-Mail, Website, Branche, Notizen. Je Zeile entsteht ein Lead mit primärem Kontakt;
|
E-Mail, Website, Branche, Notizen. Je Zeile entsteht ein Lead mit primärem Kontakt; Notizen
|
||||||
Notizen werden als erster Austausch-Log-Eintrag gespeichert. Duplikate (gleicher
|
werden als erster Austausch-Log-Eintrag gespeichert. Duplikate (gleicher Firmenname) werden
|
||||||
Firmenname) werden übersprungen.
|
übersprungen.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="mt-4 space-y-3">
|
<div className="mt-4 space-y-3">
|
||||||
@@ -167,9 +160,7 @@ function LeadImportDialog({ onClose }: { onClose: () => void }) {
|
|||||||
{result.skippedDuplicate > 0 && (
|
{result.skippedDuplicate > 0 && (
|
||||||
<li>{result.skippedDuplicate} Duplikate übersprungen</li>
|
<li>{result.skippedDuplicate} Duplikate übersprungen</li>
|
||||||
)}
|
)}
|
||||||
{result.skippedEmpty > 0 && (
|
{result.skippedEmpty > 0 && <li>{result.skippedEmpty} leere Zeilen übersprungen</li>}
|
||||||
<li>{result.skippedEmpty} leere Zeilen übersprungen</li>
|
|
||||||
)}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -189,8 +180,7 @@ function LeadImportDialog({ onClose }: { onClose: () => void }) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,15 +272,7 @@ function LeadCreateDialog({ onClose }: { onClose: () => void }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title="Neuer Lead">
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="max-h-[90vh] w-full max-w-md overflow-y-auto rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<h2 className="text-xl font-semibold">Neuer Lead</h2>
|
|
||||||
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
||||||
Nur die Firma ist Pflicht — alles Weitere füllst du im Dossier.
|
Nur die Firma ist Pflicht — alles Weitere füllst du im Dossier.
|
||||||
</p>
|
</p>
|
||||||
@@ -327,11 +309,7 @@ function LeadCreateDialog({ onClose }: { onClose: () => void }) {
|
|||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
<Field label="Quelle (wie gefunden)">
|
<Field label="Quelle (wie gefunden)">
|
||||||
<input
|
<input value={quelle} onChange={(e) => setQuelle(e.target.value)} className={inputCls} />
|
||||||
value={quelle}
|
|
||||||
onChange={(e) => setQuelle(e.target.value)}
|
|
||||||
className={inputCls}
|
|
||||||
/>
|
|
||||||
</Field>
|
</Field>
|
||||||
<Field label="Projekt (optional)">
|
<Field label="Projekt (optional)">
|
||||||
<select
|
<select
|
||||||
@@ -395,8 +373,7 @@ function LeadCreateDialog({ onClose }: { onClose: () => void }) {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { Card } from '../components/ui/Card';
|
|||||||
import { Button } from '../components/ui/Button';
|
import { Button } from '../components/ui/Button';
|
||||||
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
import { SkeletonCard } from '../components/ui/SkeletonCard';
|
||||||
import { ErrorState } from '../components/ui/ErrorState';
|
import { ErrorState } from '../components/ui/ErrorState';
|
||||||
|
import { Modal } from '../components/ui/Modal';
|
||||||
import { useConfirm } from '../components/ui/ConfirmProvider';
|
import { useConfirm } from '../components/ui/ConfirmProvider';
|
||||||
import { useCurrentUser } from '../hooks/useCurrentUser';
|
import { useCurrentUser } from '../hooks/useCurrentUser';
|
||||||
import { voice } from '../lib/voice';
|
import { voice } from '../lib/voice';
|
||||||
@@ -704,15 +705,7 @@ function GateDialog({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title={`Gate-Review: ${PHASE_META[phase].label}`}>
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="w-full max-w-md rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<h2 className="text-xl font-semibold">Gate-Review: {PHASE_META[phase].label}</h2>
|
|
||||||
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
||||||
Ziel: {PHASE_META[phase].gateZiel}
|
Ziel: {PHASE_META[phase].gateZiel}
|
||||||
</p>
|
</p>
|
||||||
@@ -745,11 +738,7 @@ function GateDialog({
|
|||||||
className={inputCls}
|
className={inputCls}
|
||||||
/>
|
/>
|
||||||
<label className="flex items-center gap-2 text-sm">
|
<label className="flex items-center gap-2 text-sm">
|
||||||
<input
|
<input type="checkbox" checked={advance} onChange={(e) => setAdvance(e.target.checked)} />
|
||||||
type="checkbox"
|
|
||||||
checked={advance}
|
|
||||||
onChange={(e) => setAdvance(e.target.checked)}
|
|
||||||
/>
|
|
||||||
Folgephase jetzt freigeben
|
Folgephase jetzt freigeben
|
||||||
</label>
|
</label>
|
||||||
<div className="flex justify-end gap-2">
|
<div className="flex justify-end gap-2">
|
||||||
@@ -761,8 +750,7 @@ function GateDialog({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2320,15 +2308,7 @@ function AbschlussDialog({
|
|||||||
{ key: 'retro', label: 'Retrospektive / Lessons Learned durchgeführt' },
|
{ key: 'retro', label: 'Retrospektive / Lessons Learned durchgeführt' },
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal open onClose={onClose} title="Projekt abschließen">
|
||||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
|
|
||||||
onClick={onClose}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="max-h-[90vh] w-full max-w-md overflow-y-auto rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
<h2 className="text-xl font-semibold">Projekt abschließen</h2>
|
|
||||||
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
<p className="mt-1 text-sm text-[var(--color-ink-muted)]">
|
||||||
Ein Projekt endet bewusst (Leitfaden Phase 4).
|
Ein Projekt endet bewusst (Leitfaden Phase 4).
|
||||||
</p>
|
</p>
|
||||||
@@ -2377,8 +2357,7 @@ function AbschlussDialog({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user