feat(design): add IMS Admin primitives (Button, StatusTag, Checkbox, FilterChip, Segmented, Avatar, Drawer) and restyle Field, Card, Modal

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:28:34 +08:00
co-authored by Claude Haiku 4.5
parent 01343d732e
commit 2a5b9332c7
15 changed files with 417 additions and 248 deletions
+10 -13
View File
@@ -2,6 +2,7 @@
import { useEffect } from 'react'
import { X } from 'lucide-react'
import { Button } from './button'
interface ModalProps {
open: boolean
@@ -26,21 +27,17 @@ 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-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-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 className="absolute inset-0 bg-black/30" onClick={onClose} />
<div className={`relative w-full ${maxW} bg-surface rounded-xl shadow-float`}>
<div className="flex items-center justify-between px-5 py-3.5 border-b border-rule">
<h2 className="text-base font-[650]">{title}</h2>
<Button variant="icon" aria-label="Close" onClick={onClose}>
<X size={16} strokeWidth={2} aria-hidden />
</Button>
</div>
<div className="px-6 py-5">{children}</div>
<div className="px-5 py-4">{children}</div>
{footer && (
<div className="px-6 py-4 border-t border-divider flex justify-end gap-2">
<div className="px-5 py-3.5 border-t border-rule flex justify-end gap-2">
{footer}
</div>
)}