feat(design): restyle Modal as a flat Modernist dialog

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 19:04:43 +08:00
co-authored by Claude Haiku 4.5
parent 4411ed54b5
commit e7416bf236
2 changed files with 62 additions and 8 deletions
+10 -8
View File
@@ -1,6 +1,7 @@
'use client'
import { useEffect } from 'react'
import { X } from 'lucide-react'
interface ModalProps {
open: boolean
@@ -25,15 +26,16 @@ export function Modal({ open, onClose, title, children, footer, width = 'md' }:
return (
<div className="fixed inset-0 z-50 flex items-center justify-center p-4" role="dialog" aria-modal="true">
<div className="absolute inset-0 bg-gray-900/50" onClick={onClose} />
<div className="absolute inset-0 bg-neutral-900/50" onClick={onClose} />
<div className={`relative w-full ${maxW} bg-surface shadow-lg`}>
<div className="flex items-center justify-between px-6 py-4 border-b border-divider">
<h2 className="text-sm font-semibold text-gray-900">{title}</h2>
<button onClick={onClose} aria-label="Close"
className="text-gray-400 hover:text-gray-600 p-1 hover:bg-gray-100 transition-colors cursor-pointer">
<svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2.5}>
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18 18 6M6 6l12 12" />
</svg>
<div className="flex items-center justify-between px-6 py-4 border-b-2 border-divider">
<h2 className="text-xl font-extrabold text-ink">{title}</h2>
<button
onClick={onClose}
aria-label="Close"
className="inline-flex w-9 h-9 items-center justify-center text-ink cursor-pointer transition-colors hover:bg-ink/7 active:bg-ink/15"
>
<X size={18} strokeWidth={2} aria-hidden />
</button>
</div>
<div className="px-6 py-5">{children}</div>