From 4fff12648fb3e19938407ea30269461aa514d2c1 Mon Sep 17 00:00:00 2001 From: idevakk <219866223+idevakk@users.noreply.github.com> Date: Fri, 6 Mar 2026 10:59:51 +0530 Subject: [PATCH] docs: implement comprehensive design system and auto-update protocol --- .ai/guidelines/design-system.md | 25 + .junie/guidelines.md | 34 ++ CLAUDE.md | 34 ++ DESIGN.md | 902 ++++++++++++++++++++++++++++++++ GEMINI.md | 34 ++ 5 files changed, 1029 insertions(+) create mode 100644 .ai/guidelines/design-system.md create mode 100644 DESIGN.md diff --git a/.ai/guidelines/design-system.md b/.ai/guidelines/design-system.md new file mode 100644 index 0000000..1dc959f --- /dev/null +++ b/.ai/guidelines/design-system.md @@ -0,0 +1,25 @@ +# Design System (CRITICAL — Auto-Read Required) + +This project has a comprehensive Design System documented in `DESIGN.md` at the project root. + +## Before Any UI/UX Work + +**BEFORE** making ANY frontend, UI, UX, styling, component, animation, Blade template, or Tailwind-related change, you MUST read `DESIGN.md` using your file reading tool to understand the established: +- Design tokens and color system +- Typography scale and font conventions +- Component patterns (toasts, modals, buttons, indicators) +- Spacing constants and layout architecture +- Animation and transition conventions +- Responsive breakpoint rules + +This applies to: Blade views, CSS files, Alpine.js interactions, GSAP animations, Livewire component UI, toast notifications, modals, buttons, indicators, and any other visual element. + +## After Completing UI/UX Work + +**AFTER** completing any UI/UX change, you MUST update `DESIGN.md` per its Section 15 (Maintenance Protocol): +- Add a new entry to Section 14 (Iteration History) using the provided template. +- Update Section 9 (Component Library) if a component was created or modified. +- Update Sections 5/6/7 if design tokens, fonts, or colors were added/changed. +- Bump the version number and "Last updated" date at the top of the file. + +Failure to read and follow `DESIGN.md` will result in inconsistent UI, visual regressions, and wasted iteration cycles. diff --git a/.junie/guidelines.md b/.junie/guidelines.md index ea68f0f..e8aef0e 100644 --- a/.junie/guidelines.md +++ b/.junie/guidelines.md @@ -1,4 +1,37 @@ +=== .ai/design-system rules === + +# Design System (CRITICAL — Auto-Read Required) + + +This project has a comprehensive Design System documented in `DESIGN.md` at the project root. + + +## Before Any UI/UX Work + + +**BEFORE** making ANY frontend, UI, UX, styling, component, animation, Blade template, or Tailwind-related change, you MUST read `DESIGN.md` using your file reading tool to understand the established: +- Design tokens and color system +- Typography scale and font conventions +- Component patterns (toasts, modals, buttons, indicators) +- Spacing constants and layout architecture +- Animation and transition conventions +- Responsive breakpoint rules + +This applies to: Blade views, CSS files, Alpine.js interactions, GSAP animations, Livewire component UI, toast notifications, modals, buttons, indicators, and any other visual element. + + +## After Completing UI/UX Work + + +**AFTER** completing any UI/UX change, you MUST update `DESIGN.md` per its Section 15 (Maintenance Protocol): +- Add a new entry to Section 14 (Iteration History) using the provided template. +- Update Section 9 (Component Library) if a component was created or modified. +- Update Sections 5/6/7 if design tokens, fonts, or colors were added/changed. +- Bump the version number and "Last updated" date at the top of the file. + +Failure to read and follow `DESIGN.md` will result in inconsistent UI, visual regressions, and wasted iteration cycles. + === foundation rules === # Laravel Boost Guidelines @@ -27,6 +60,7 @@ This application is a Laravel application and its main Laravel ecosystems packag - phpunit/phpunit (PHPUNIT) - v11 - rector/rector (RECTOR) - v2 - tailwindcss (TAILWINDCSS) - v4 +- laravel-echo (ECHO) - v2 ## Skills Activation diff --git a/CLAUDE.md b/CLAUDE.md index ea68f0f..e8aef0e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,4 +1,37 @@ +=== .ai/design-system rules === + +# Design System (CRITICAL — Auto-Read Required) + + +This project has a comprehensive Design System documented in `DESIGN.md` at the project root. + + +## Before Any UI/UX Work + + +**BEFORE** making ANY frontend, UI, UX, styling, component, animation, Blade template, or Tailwind-related change, you MUST read `DESIGN.md` using your file reading tool to understand the established: +- Design tokens and color system +- Typography scale and font conventions +- Component patterns (toasts, modals, buttons, indicators) +- Spacing constants and layout architecture +- Animation and transition conventions +- Responsive breakpoint rules + +This applies to: Blade views, CSS files, Alpine.js interactions, GSAP animations, Livewire component UI, toast notifications, modals, buttons, indicators, and any other visual element. + + +## After Completing UI/UX Work + + +**AFTER** completing any UI/UX change, you MUST update `DESIGN.md` per its Section 15 (Maintenance Protocol): +- Add a new entry to Section 14 (Iteration History) using the provided template. +- Update Section 9 (Component Library) if a component was created or modified. +- Update Sections 5/6/7 if design tokens, fonts, or colors were added/changed. +- Bump the version number and "Last updated" date at the top of the file. + +Failure to read and follow `DESIGN.md` will result in inconsistent UI, visual regressions, and wasted iteration cycles. + === foundation rules === # Laravel Boost Guidelines @@ -27,6 +60,7 @@ This application is a Laravel application and its main Laravel ecosystems packag - phpunit/phpunit (PHPUNIT) - v11 - rector/rector (RECTOR) - v2 - tailwindcss (TAILWINDCSS) - v4 +- laravel-echo (ECHO) - v2 ## Skills Activation diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 0000000..2faad21 --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,902 @@ +# Zemail (iMail) — Design System & UI/UX Guidelines + +> **Version:** 1.1.0 — Last updated: 2026-03-06 +> +> This document is the single source of truth for every visual, interactive, and architectural decision in the Zemail project. Any developer or AI agent working on this codebase **must** read this document before making any frontend changes, and **must** update it after completing any UI/UX-related work. + +--- + +## Table of Contents + +1. [Activated Skills & References](#1-activated-skills--references) +2. [Design Philosophy](#2-design-philosophy) +3. [Tech Stack](#3-tech-stack) +4. [Aesthetic Preset: "DevTool Dark"](#4-aesthetic-preset-devtool-dark) +5. [Design Tokens (CSS Custom Properties)](#5-design-tokens-css-custom-properties) +6. [Typography](#6-typography) +7. [Color System](#7-color-system) +8. [Spacing & Layout](#8-spacing--layout) +9. [Component Library](#9-component-library) +10. [Animation & Micro-Interactions](#10-animation--micro-interactions) +11. [Real-Time UI Patterns](#11-real-time-ui-patterns) +12. [Responsive Design Rules](#12-responsive-design-rules) +13. [Accessibility](#13-accessibility) +14. [Iteration History & Design Decisions](#14-iteration-history--design-decisions) +15. [Maintenance Protocol (MANDATORY)](#15-maintenance-protocol-mandatory) + +--- + +## 1. Activated Skills & References + +The following `.agents/skills` were activated during the initial design and development of this project. **Any future developer or AI agent must activate the relevant skill before working in that domain.** + +| Skill | Path | When to Activate | +|-------|------|------------------| +| **`bento-landing-page-generator`** | `.agents/skills/bento-landing-page-generator/SKILL.md` | Building or modifying Bento-style landing pages, hero sections, feature grids. This was the **primary skill** used to establish the entire visual language of this project. | +| **`tailwindcss-development`** | `.agents/skills/tailwindcss-development/SKILL.md` | Any styling work. Uses Tailwind CSS **v4** with CSS-first `@theme` configuration. Never use deprecated v3 utilities. | +| **`fluxui-development`** | `.agents/skills/fluxui-development/SKILL.md` | Building forms, modals, inputs, or interactive UI components. Uses the **Flux UI Free** edition. | +| **`volt-development`** | `.agents/skills/volt-development/SKILL.md` | Creating single-file Livewire components. Check existing Volt components for functional vs. class-based style before creating new ones. | +| **`cinematic-landing-page-builder`** | `.agents/skills/cinematic-landing-page-builder/SKILL.md` | Building cinematic, pixel-perfect landing pages with strict design system enforcement, micro-interactions, and GSAP animations. | +| **`pest-testing`** | `.agents/skills/pest-testing/SKILL.md` | Writing or modifying tests. Uses Pest 3. | + +### External References Used + +- **Appwrite Dashboard** — Dark UI inspiration for surface colors, card borders, and glow effects. +- **Vercel** — Minimal dark theme, clean typography hierarchy, terminal-style code blocks. +- **Stripe / BentoNow** — Asymmetric Bento Grid layout patterns, card span ratios. +- **Heroicons** — Default icon set. Search at [heroicons.com](https://heroicons.com/). Never guess icon names. + +--- + +## 2. Design Philosophy + +### Core Principles + +1. **Premium-First**: Every element must feel premium and state-of-the-art. No basic MVPs, no generic layouts. The user should be "wowed" at first glance. +2. **Dark Mode Native**: The application is dark-mode-only (`class="dark"` on ``). All design tokens, colors, and contrasts are optimized for dark backgrounds. +3. **Cinematic Motion**: Interfaces should feel alive. Use GSAP for scroll-driven reveals, Alpine.js for instant state transitions, and CSS `transition-all` for micro-interactions. +4. **Information Density**: Mailbox UIs are information-dense by nature. Use compact typography (`text-[10px]`, `text-[11px]`), uppercase tracking (`tracking-widest`, `tracking-[0.2em]`), and monospace fonts for data. +5. **No Placeholders**: Never use placeholder images or `lorem ipsum`. Build all visuals with HTML/CSS/SVG. Use `generate_image` tool if real images are needed. +6. **Glassmorphism & Glow**: Frosted glass effects (`backdrop-blur-xl`, `bg-white/5`) and colored glows (`shadow-[0_0_30px_rgba(236,72,153,0.3)]`) are signature visual elements. + +### The "Bento Box" Layout Rules + +- Use **asymmetric CSS Grids** (e.g., `grid-cols-1 md:grid-cols-3` or `md:grid-cols-4`). +- Cards must have **distinct spans** (`col-span-2`, `row-span-2`) to create a mosaic effect. +- All cards use `rounded-2xl` or `rounded-3xl` border radii. +- Cards use `bg-zinc-900` surface color with `border border-white/5` borders. +- Background glows inside cards use `blur-2xl` with accent color at very low opacity (`bg-pink-500/5`). + +--- + +## 3. Tech Stack + +| Layer | Technology | Version | +|-------|-----------|---------| +| Backend | Laravel | v12 | +| Real-Time | Livewire | v3 | +| Client-Side Reactivity | Alpine.js | (bundled with Livewire) | +| Styling | Tailwind CSS | v4 | +| Animations | GSAP | 3.12.5 | +| Component Library | Flux UI Free | v2 | +| WebSocket | Laravel Reverb | v1 | +| Fonts | Google Fonts (via Bunny) | Inter, JetBrains Mono | +| Icons | Heroicons (via Flux) | — | +| QR Generator | QRious | 4.0.2 | +| Build Tool | Vite | v7 | + +### Asset Pipeline + +``` +resources/css/app.css → Tailwind v4 with @theme design tokens +resources/js/app.js → Laravel Echo + Pusher + WebSocket status dispatching +resources/views/ → Blade templates, Livewire components, anonymous components +``` + +All frontend changes require `npm run build` (or `npm run dev` during development) to take effect. + +--- + +## 4. Aesthetic Preset: "DevTool Dark" + +This project uses **Preset A — "DevTool Dark"**, inspired by Appwrite and Vercel. + +| Property | Value | +|----------|-------| +| Background | `#09090B` (`bg-app-bg`) | +| Surface | `#18181B` (`bg-app-surface` / `bg-zinc-900`) | +| Borders | `#27272A` (`border-app-border` / `border-white/5`) | +| Primary Accent | `#EC4899` (Pink) | +| Secondary Accent | `#10B981` (Emerald) | +| Text Primary | `#FAFAFA` | +| Text Secondary | `#737373` (`text-zinc-500`) | +| Text Muted | `#525252` (`text-zinc-600`) | +| Selection Highlight | `rgba(236, 72, 153, 0.3)` (`selection:bg-[#EC4899]/30`) | + +--- + +## 5. Design Tokens (CSS Custom Properties) + +All design tokens are defined in `resources/css/app.css` using Tailwind v4's CSS-first `@theme` directive. + +```css +@theme { + /* Core Application Colors */ + --color-app-bg: #09090B; + --color-app-surface: #18181B; + --color-app-border: #27272A; + --color-app-red: #EC6A5F; /* macOS-style traffic light red */ + --color-app-yellow: #F4BF4F; /* macOS-style traffic light yellow */ + --color-app-green: #61C554; /* macOS-style traffic light green */ + + /* Zinc Scale (Dark Mode Neutrals) */ + --color-zinc-50: #fafafa; + --color-zinc-500: #737373; + --color-zinc-600: #525252; + --color-zinc-800: #262626; + --color-zinc-900: #171717; + --color-zinc-950: #0a0a0a; + + /* Primary (Purple/Indigo Scale — used for accents) */ + --color-primary-500: #787ddc; + --color-primary-600: #615dce; + + /* App Primary (oklch scale — for gradients and advanced color) */ + --color-app-primary-500: oklch(0.589 0.137 290.02); + --color-app-primary-600: oklch(0.506 0.16 288.92); + + /* Typography */ + --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif; +} +``` + +### Important Token Rules + +- **Never hardcode colors** that already exist as tokens. Use `bg-app-bg`, `text-zinc-500`, etc. +- **Opacity modifiers** use the Tailwind v4 slash syntax: `bg-pink-500/10`, not the deprecated `bg-opacity-*`. +- **New tokens** must be added to `@theme {}` in `app.css`, not in a `tailwind.config.js` file (Tailwind v4 is CSS-first). + +--- + +## 6. Typography + +### Font Stack + +| Usage | Font | Weight | Loaded Via | +|-------|------|--------|------------| +| Body & UI | **Inter** | 400, 500, 600, 700 | Bunny Fonts CDN | +| Code, Data, Addresses | **JetBrains Mono** | 400, 500 | Bunny Fonts CDN | + +### Font Loading + +```html + + +``` + +### Typography Scale + +| Element | Classes | Example Usage | +|---------|---------|---------------| +| Page Heading | `text-2xl font-black tracking-tight uppercase italic` | Confirm modal title | +| Section Label | `text-[10px] font-bold text-zinc-500 uppercase tracking-widest` | "Active Mailbox", "Your Sessions" | +| Category Label | `text-[10px] font-bold text-zinc-600 uppercase tracking-[0.2em]` | Sidebar section headers | +| Data Display (email) | `text-[11px] font-mono text-white break-all` | Email address display | +| Toast Type Label | `text-[10px] font-black uppercase tracking-[0.2em] opacity-40` | Toast "SUCCESS", "INFO" label | +| Toast Message | `text-[11px] font-bold tracking-wide whitespace-pre-wrap` | Toast notification body | +| Button Text | `text-xs font-bold` | Primary action buttons | +| Compact Button Text | `text-[10px] font-black uppercase tracking-[0.2em]` | Modal confirm/cancel buttons | +| Timer Display | `text-[10px] font-mono text-pink-500` | Expiration countdown | +| Badge/Count | `text-[10px] font-bold px-1.5 py-0.5` | Unread count badge | + +### Typography Rules + +- **No comments in code** unless logic is exceptionally complex. Use PHPDoc blocks instead. +- **Uppercase + Wide Tracking** is the signature style for labels and metadata text. +- **Monospace (`font-mono`)** is used for any machine-readable data: email addresses, timers, code blocks. +- **`break-all`** must be applied to email addresses to prevent overflow on small screens. + +--- + +## 7. Color System + +### Semantic Color Mapping + +These semantic colors are used consistently across all components (toasts, modals, buttons, indicators): + +| Semantic | Background | Border | Text | Icon BG | Glow | +|----------|-----------|--------|------|---------|------| +| **Success** | `bg-emerald-500/10` | `border-emerald-500/20` | `text-emerald-100` | `bg-emerald-500/20 text-emerald-400` | `bg-emerald-500/10` | +| **Info** | `bg-blue-500/10` | `border-blue-500/20` | `text-blue-100` | `bg-blue-500/20 text-blue-400` | `bg-blue-400/10` | +| **Warning** | `bg-amber-500/10` | `border-amber-500/20` | `text-amber-100` | `bg-amber-500/20 text-amber-400` | `bg-amber-400/10` | +| **Danger** | `bg-rose-500/10` | `border-rose-500/20` | `text-rose-100` | `bg-rose-500/20 text-rose-400` | `bg-rose-400/10` | + +### Important Color Rules + +- **Never use generic red/blue/green**. Always use the curated semantic mapping above. +- **Pink (`#EC4899` / `pink-500`)** is the project's primary accent. Used for highlights, CTAs, gradients, and the expiration progress bar. +- **Emerald (`emerald-500`)** is the secondary accent. Used for success states and the WebSocket connection indicator. +- **Rose (`rose-500`)** is used for destructive actions, errors, and the disconnected WebSocket indicator. +- The **expiration progress bar** uses a gradient from pink to emerald: `bg-gradient-to-r from-pink-500 to-emerald-500`. +- **Toast notification types**: `success`, `info`, `warning`, `danger`. **Never** use `error` — use `danger` instead. + +--- + +## 8. Spacing & Layout + +### Global Spacing Constants + +| Context | Value | Tailwind Class | +|---------|-------|----------------| +| Card Padding | 16px | `p-4` | +| Card Border Radius | 16px | `rounded-2xl` | +| Modal Border Radius | 32px | `rounded-[32px]` | +| Button Border Radius | 16px | `rounded-2xl` | +| Icon Container Radius | 12px | `rounded-xl` | +| Section Gap | 24px | `space-y-6` | +| Inner Element Gap | 8px | `space-y-2` / `gap-2` | +| Toast Container Spacing | 12px | `gap-3` | +| Screen Edge Margin | 24px | `bottom-6 left-6 right-6` (responsive) | + +### Layout Architecture + +The main mailbox view (`mailbox.blade.php`) uses a **three-panel layout**: + +``` +┌──────────┬──────────────┬──────────────────────┐ +│ Sidebar │ Email List │ Email Detail │ +│ (280px) │ (flex-1) │ (flex-1, lg only) │ +│ │ │ │ +│ - Active │ - Search │ - Header │ +│ Mailbox│ - Email rows │ - Body (iframe) │ +│ - Create │ - Pagination │ - Attachments │ +│ - Sessions │ │ +└──────────┴──────────────┴──────────────────────┘ +``` + +- Sidebar uses `w-[280px]` when open, collapses on smaller screens. +- `overflow-hidden` on `` prevents page-level scrolling. Each panel scrolls independently. +- Use `scrollbar-hide` utility class (custom CSS) to hide scrollbars in compact panels. + +### Body-Level Styling + +```html + +``` + +--- + +## 9. Component Library + +### 9.1 Global Toast Notification System + +**Location:** `resources/views/components/layouts/app.blade.php` +**Trigger:** `$this->dispatch('notify', message: '...', type: 'success')` from Livewire, or `addToast('...', 'success')` from Alpine.js. +**Event:** `@notify.window` on ``. + +#### Architecture + +``` + + └── @notify.window="addToast($event.detail.message, $event.detail.type)" + └── @ws-status.window="wsConnected = $event.detail.connected" + └──
+ └──