From 5174b48f48f310935d33c7233e8f3d6104d80b85 Mon Sep 17 00:00:00 2001 From: ikbenlit Date: Fri, 26 Dec 2025 13:10:04 +0100 Subject: [PATCH] refactor(swift): Update UI styles and animations for improved consistency - Changed background colors and text colors across various components to enhance readability and visual appeal. - Updated animation properties for smoother transitions in CanvasArea and BlockContainer. - Adjusted styles in FallbackPicker, OverdrachtBlock, and other components to align with the new design system. - Improved accessibility by ensuring color contrasts meet standards. This update aims to create a more cohesive user experience throughout the application. --- app/epd/swift/layout.tsx | 2 +- components/swift/blocks/block-container.tsx | 18 +- components/swift/blocks/dagnotitie-block.tsx | 20 +- components/swift/blocks/fallback-picker.tsx | 28 +- components/swift/blocks/overdracht-block.tsx | 62 ++-- .../swift/blocks/patient-context-card.tsx | 54 ++-- components/swift/blocks/zoeken-block.tsx | 20 +- .../swift/command-center/canvas-area.tsx | 55 +++- .../swift/command-center/command-input.tsx | 14 +- .../swift/command-center/context-bar.tsx | 24 +- .../swift/command-center/recent-strip.tsx | 20 +- docs/swift/bouwplan-swift-v2.md | 77 ++++- docs/swift/test-plan-epic3.md | 272 ++++++++++++++++++ 13 files changed, 513 insertions(+), 153 deletions(-) create mode 100644 docs/swift/test-plan-epic3.md diff --git a/app/epd/swift/layout.tsx b/app/epd/swift/layout.tsx index fe4268f..80c7d3a 100644 --- a/app/epd/swift/layout.tsx +++ b/app/epd/swift/layout.tsx @@ -21,7 +21,7 @@ export default async function SwiftLayout({ children }: SwiftLayoutProps) { } return ( -
+
{children}
); diff --git a/components/swift/blocks/block-container.tsx b/components/swift/blocks/block-container.tsx index 458c448..b0fce50 100644 --- a/components/swift/blocks/block-container.tsx +++ b/components/swift/blocks/block-container.tsx @@ -25,12 +25,18 @@ const SIZE_CLASSES: Record = { full: 'max-w-4xl', }; -// Container animations +// Container animations - consistent met CanvasArea slide up/down +// Slide up + fade in bij openen, scale 0.95 → 1.0 (200ms) const containerVariants: Variants = { - initial: { scale: 0.98, opacity: 0 }, + initial: { + scale: 0.95, + opacity: 0, + y: 0, // BlockContainer animatie wordt door CanvasArea gedaan + }, animate: { scale: 1, opacity: 1, + y: 0, transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] as [number, number, number, number], @@ -67,15 +73,15 @@ export function BlockContainer({ title, size = 'md', children }: BlockContainerP variants={containerVariants} initial="initial" animate="animate" - className={`w-full ${SIZE_CLASSES[size]} bg-slate-800 rounded-xl border border-slate-700 shadow-2xl`} + className={`w-full ${SIZE_CLASSES[size]} bg-white rounded-xl border border-slate-200 shadow-lg`} > {/* Header */} -
+
{title} @@ -85,7 +91,7 @@ export function BlockContainer({ title, size = 'md', children }: BlockContainerP initial="rest" whileHover="hover" whileTap="tap" - className="p-1 rounded hover:bg-slate-700 text-slate-400 hover:text-white transition-colors" + className="p-1 rounded hover:bg-slate-100 text-slate-400 hover:text-slate-700 transition-colors" title="Sluiten (Esc)" aria-label="Block sluiten" > diff --git a/components/swift/blocks/dagnotitie-block.tsx b/components/swift/blocks/dagnotitie-block.tsx index 48f53bf..64391e5 100644 --- a/components/swift/blocks/dagnotitie-block.tsx +++ b/components/swift/blocks/dagnotitie-block.tsx @@ -240,15 +240,15 @@ export function DagnotatieBlock({ prefill }: DagnotitieBlockProps) {
{selectedPatient ? ( -
- - {formatPatientName(selectedPatient)} +
+ + {formatPatientName(selectedPatient)} @@ -278,13 +278,13 @@ export function DagnotatieBlock({ prefill }: DagnotitieBlockProps) { )}
{showPatientDropdown && patients.length > 0 && ( -
+
{patients.map((patient) => (
diff --git a/components/swift/blocks/fallback-picker.tsx b/components/swift/blocks/fallback-picker.tsx index 32097b4..b555781 100644 --- a/components/swift/blocks/fallback-picker.tsx +++ b/components/swift/blocks/fallback-picker.tsx @@ -33,7 +33,7 @@ const BLOCK_OPTIONS: BlockOption[] = [ description: 'Schrijf een dagnotitie', icon: FileText, shortcut: '1', - color: 'bg-blue-500/20 text-blue-400 border-blue-500/30', + color: 'bg-blue-50 text-blue-600 border-blue-200', }, { type: 'zoeken', @@ -41,7 +41,7 @@ const BLOCK_OPTIONS: BlockOption[] = [ description: 'Zoek een patiënt', icon: Search, shortcut: '2', - color: 'bg-emerald-500/20 text-emerald-400 border-emerald-500/30', + color: 'bg-emerald-50 text-emerald-600 border-emerald-200', }, { type: 'overdracht', @@ -49,7 +49,7 @@ const BLOCK_OPTIONS: BlockOption[] = [ description: 'Bekijk overdracht', icon: ArrowRightLeft, shortcut: '3', - color: 'bg-amber-500/20 text-amber-400 border-amber-500/30', + color: 'bg-amber-50 text-amber-600 border-amber-200', }, ]; @@ -108,14 +108,14 @@ export function FallbackPicker({ originalInput }: FallbackPickerProps) { animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.95 }} transition={{ duration: 0.2, ease: [0.4, 0, 0.2, 1] as [number, number, number, number] }} - className="w-full max-w-md bg-slate-800 rounded-xl border border-slate-700 shadow-2xl overflow-hidden" + className="w-full max-w-md bg-white rounded-xl border border-slate-200 shadow-lg overflow-hidden" > {/* Header */} -
-

Wat wil je doen?

+
+

Wat wil je doen?

@@ -312,7 +312,7 @@ export function ZoekenBlock({ prefill }: ZoekenBlockProps) { })}
) : ( -
+

Geen patiënten gevonden

Probeer een andere zoekterm

@@ -323,7 +323,7 @@ export function ZoekenBlock({ prefill }: ZoekenBlockProps) { {/* Empty State */} {searchQuery.length < 2 && ( -
+

Typ minimaal 2 karakters om te zoeken

diff --git a/components/swift/command-center/canvas-area.tsx b/components/swift/command-center/canvas-area.tsx index bfbba22..3c84bba 100644 --- a/components/swift/command-center/canvas-area.tsx +++ b/components/swift/command-center/canvas-area.tsx @@ -33,22 +33,50 @@ export function CanvasArea() { } } + // Block animations volgens UX specificatie (sectie 11.1): + // Openen: Slide up + fade in (200ms), Scale: 0.95 → 1.0 + // Sluiten: Slide down + fade out (200ms), Scale: 1.0 → 0.95 const blockAnimations = { initial: { opacity: 0, y: 20, scale: 0.95 }, - animate: { opacity: 1, y: 0, scale: 1 }, - exit: { opacity: 0, y: -20, scale: 0.95 }, - transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] as [number, number, number, number] }, + animate: { + opacity: 1, + y: 0, + scale: 1, + transition: { + duration: 0.2, + ease: [0.4, 0, 0.2, 1] as [number, number, number, number], + }, + }, + exit: { + opacity: 0, + y: 20, // Slide down (niet omhoog) + scale: 0.95, + transition: { + duration: 0.2, + ease: [0.4, 0, 0.2, 1] as [number, number, number, number], + }, + }, }; return (
- + {activeBlock ? ( - + {renderBlock(activeBlock, prefillData)} ) : activePatient ? ( - + ) : ( @@ -57,6 +85,7 @@ export function CanvasArea() { initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} + transition={{ duration: 0.2 }} > @@ -70,7 +99,7 @@ function EmptyState() { return (
-
+
-

Wat wil je doen?

+

Wat wil je doen?

Typ of spreek je intentie

@@ -100,8 +129,8 @@ function EmptyState() {
-

- ⌘K om te focussen +

+ ⌘K om te focussen

); @@ -109,9 +138,9 @@ function EmptyState() { function ExampleCommand({ icon, text }: { icon: string; text: string }) { return ( -
+
{icon} - "{text}" + "{text}"
); } diff --git a/components/swift/command-center/command-input.tsx b/components/swift/command-center/command-input.tsx index 9edce3c..a71b89f 100644 --- a/components/swift/command-center/command-input.tsx +++ b/components/swift/command-center/command-input.tsx @@ -72,7 +72,7 @@ export const CommandInput = forwardRef(function CommandInput(_ animationRef.current = requestAnimationFrame(draw); analyserNode.getByteFrequencyData(dataArray); - ctx.fillStyle = 'rgb(30, 41, 59)'; // slate-800 + ctx.fillStyle = 'rgb(248, 250, 252)'; // slate-50 ctx.fillRect(0, 0, canvas.width, canvas.height); const barWidth = (canvas.width / bufferLength) * 2.5; @@ -179,7 +179,7 @@ export const CommandInput = forwardRef(function CommandInput(_ const isDisabled = isProcessing || activeBlock !== null; return ( -