"use client"; import { Button } from "@suphark/ui/components/shared/button/button"; import { Badge } from "@suphark/ui/components/ui/badge"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@suphark/ui/components/ui/card"; import { InputGroup, InputGroupAddon, InputGroupInput, } from "@suphark/ui/components/ui/input-group"; import { Kbd } from "@suphark/ui/components/ui/kbd"; import { cn } from "@suphark/ui/lib/utils"; import { Accessibility, ArrowRight, Boxes, CheckCircle2, Compass, FileCode2, Layers, Palette, RefreshCw, Search, Sparkles, Zap, } from "lucide-react"; import { searchIndex } from "../search-index"; import { HeroSpecimen } from "./hero-specimen"; interface ShowcaseOverviewProps { onSelectTab: (tab: string) => void; links?: { shell?: string }; onJump: (tab: string, anchor?: string) => void; searchQuery: string; onSearchChange: (query: string) => void; } export function ShowcaseOverview({ onSelectTab, links, onJump, searchQuery, onSearchChange, }: ShowcaseOverviewProps) { const pillars = [ { id: "guidelines", tab: "guidelines-recipes", title: "1. Web Interface Guidelines", subtitle: "Mandatory Baseline Standard", icon: Accessibility, badge: "Baseline", description: "มาตรฐานการเข้าถึง (A11y), Keyboard Navigation, Focus Rings, Accessible Labels, Error Recovery และ Motion Accessibility ตาม Vercel Web Interface Guidelines", highlights: [ "Visible focus rings (focus-visible:ring-2)", "Icon buttons have aria-label / sr-only", "Dialogs/Sheets require accessible Title & Description", "Clear error guidance without user-blame", ], }, { id: "shadcn", tab: "primitives", title: "2. shadcn/ui Primitives", subtitle: "Source-Owned UI Architecture", icon: Boxes, badge: "60+ Primitives", description: "คอมโพเนนต์พื้นฐานที่ครอบคลุมทั้ง UI และ Base UI ผสมผสานผ่าน Tailwind v4 Semantic Tokens และ Composition-first pattern", highlights: [ "FieldGroup + Field for unified forms", "InputGroup for icons & embedded actions", "Button loading with Spinner + data-icon", "Items strictly within their Group containers", ], }, { id: "frontend-design", tab: "guidelines-recipes", title: "3. Frontend Design & UX Voice", subtitle: "Intentionality & Copywriting", icon: Sparkles, badge: "User Voice", description: "การออกแบบที่เจาะจงกับแอปงานภายในของ Suphark การจัดลำดับสายตา ความกระชับสแกนง่าย และภาษา UX ที่เน้นสิ่งที่ผู้ใช้ควบคุมได้ (Active Voice)", highlights: [ "Dense & scannable operational density", "Active voice actions ('Save changes', not 'Submit')", "Action-to-toast consistency ('Publish' -> 'Published')", "Empty states as invitations to act", ], }, { id: "redesign", tab: "guidelines-recipes", title: "4. Redesign Workflow", subtitle: "Behavior-Preserving Evolution", icon: RefreshCw, badge: "Safety", description: "ระเบียบการปรับปรุง UI โดยคงความสามารถเดิม 100% เช่น RBAC Permissions, Data Contracts, Routes, Server Actions, Filters, และ Pagination", highlights: [ "Preserve server action guards & auth contracts", "Preserve URL search params & filter states", "Preserve loading skeletons & empty fallbacks", "Zero-regression verification plan", ], }, ]; const quickLinks = [ { name: "Semantic Color Tokens", tab: "foundations", icon: Palette }, { name: "Buttons & Action Hierarchy", tab: "primitives", icon: Zap }, { name: "Field-based Forms & InputGroup", tab: "forms", icon: Layers }, { name: "Data Tables & States", tab: "data-display", icon: Boxes }, { name: "Overlays (Dialog, Sheet, Drawer)", tab: "overlays", icon: Compass }, { name: "Rules & Code Recipes", tab: "guidelines-recipes", icon: FileCode2 }, ]; return (
ศูนย์กลางมาตรฐานการออกแบบและการประกอบคอมโพเนนต์สำหรับทุกแอปของ Suphark (Pi Auth, DueBell, Pi PDF, supplychain) เน้นความกระชับ สแกนง่าย รองรับงานประจำวันที่มีข้อมูลหนาแน่น (Operational Density) ผสาน 4 เสาหลัก: Web Interface Guidelines,{" "} shadcn/ui Primitives,Frontend Design & UX Copy, และ{" "} Redesign Safety Workflow
พิมพ์ชื่อคอมโพเนนต์, Token, Pattern หรือ Rule ที่ต้องการค้นหา
ทุกหน้าจอและฟีเจอร์ใน codebase นี้ต้องสอดคล้องกับหลักการทั้ง 4 ด้านอย่างเคร่งครัด
{pillar.description}
ข้อควรปฏิบัติและข้อห้ามสำหรับการสร้างและแก้ไข UI ใน codebase นี้
FieldGroup และ Field เป็นโครงสร้างฟอร์มเสมอ
flex flex-col gap-* หรือ grid gap แทน space-x/y
aria-label ใน icon-only button ทุกตัวโดยไม่มีข้อยกเว้น
size-* เมื่อความกว้างและความสูงเท่ากัน (เช่น Avatar, Icon box)
bg-blue-500 หรือ{" "}
text-red-500 ในระบบงานจริง
text-[10px] หรือ{" "}
text-[9px]
z-index บน overlay (Dialog, Sheet, Popover จัดการเอง)
src/components/ui/* โดยตรงโดยไม่ได้รับอนุญาต