diff --git a/FRONTEND.md b/FRONTEND.md index 23c5f47..fe02551 100644 --- a/FRONTEND.md +++ b/FRONTEND.md @@ -1,5 +1,19 @@ # Frontend Agent Guidelines (mm_poc_v2) +## Design System Authority + +All UI, styling, layout, spacing, colors, typography, and visual decisions +MUST strictly follow the Design System defined in: + +- **[./design-system/AGENTS.md](./design-system/AGENTS.md)** - Brand authority and core principles +- **[./design-system/DESIGN.md](./design-system/DESIGN.md)** - Design system overview and complete index +- **[./design-system/tokens/](./design-system/tokens/)** - Authoritative design tokens (colors, typography, spacing, etc.) +- **[./design-system/*.md](./design-system/)** - Complete implementation guides + +This AGENT must not override, reinterpret, or invent visual rules. +If a visual decision is missing, consult the design system documentation or request clarification. +Failure to follow the Design System must be treated as a defect, not a stylistic preference. + This file defines **frontend-specific** conventions for LLM agents working in `frontend/`. It extends the repository-wide [GENERAL-WEB-APP.md](https://github.com/shemaobt/reference-agents-md/blob/main/GENERAL-WEB-APP.md): follow those global guidelines first, then apply what is below. --- @@ -85,8 +99,12 @@ frontend/src/ ## 3. Styling and Tailwind - **Use Tailwind only** for layout, spacing, colors, typography, and responsive behavior. -- **Avoid inline styles** for things Tailwind can do (e.g. `className="flex items-center gap-2"` instead of `style={{ display: 'flex', alignItems: 'center' }}`). Use inline `style` only when necessary (e.g. dynamic values, third-party integration). -- **Use the design tokens** from `tailwind.config.js`: `branco`, `areia`, `azul`, `telha`, `verde`, `verde-claro`, `preto`, and semantic tokens (`primary`, `background`, `border`, `ring`, etc.). Do not introduce arbitrary hex values in JSX; extend the theme if new tokens are needed. +- **Avoid inline styles** for things Tailwind can handle (e.g. `className="flex items-center gap-2"` instead of `style={{ display: 'flex', alignItems: 'center' }}`). + Use inline `style` **only when strictly necessary** (e.g. dynamic values or third-party integrations). +- **Always use the design tokens** defined in `tailwind.config.js` for colors and semantics + (`branco`, `areia`, `azul`, `telha`, `verde`, `verde-claro`, `preto`, and semantic tokens like `primary`, `background`, `border`, `ring`). +- `tailwind.config.js` **must stay in sync** with `design-system/tokens/*.json`. + Do **not** introduce arbitrary hex values in JSX; extend the theme if new tokens are required. ### Centralized style constants @@ -162,3 +180,5029 @@ frontend/src/ --- *Reference copy from [mm_poc_v2/frontend/AGENTS.md](https://github.com/shemaobt/mm_poc_v2/blob/main/frontend/AGENTS.md). Place in your repo at `frontend/AGENTS.md` or `frontend/FRONTEND.md`. Built using [agents.md](https://agents.md/).* +--- + +# Design System — Shema (Conteúdo Completo Mesclado) + +> O conteúdo abaixo foi mesclado a partir de todos os arquivos `.md` da pasta `design-system/`. +> Informações duplicadas entre os arquivos originais foram consolidadas em seções únicas. +> O arquivo `README.md` foi omitido pois serve apenas como índice de navegação. + +--- + +## DS-1. Guia para AI Agents — Princípios de Marca e Regras Visuais + +> Origem: `design-system/AGENTS.md` + +## 1. Purpose +This Design System defines the visual and behavioral rules for creating interfaces for the **Shema** platform, covering **Web** and **Mobile App (Flutter)**. + +The Shema brand operates in the context of biblical translation and sacred text reading. Its visual identity must reflect the following values: + +- Simple +- Accessible +- Lively +- Friendly +- Human + +This document acts as a **mandatory contract** for designers, developers, and AI agents. + +--- + +## 2. Visual Principles + +### Natural Feel +- Avoid pure white (#FFFFFF) as the main background. +- Use **Shema White / Cream (#F6F5EB)** to simulate paper and provide visual comfort. +- Pure white is reserved only for elevated surfaces (cards, inputs). + +### Soft Contrast +- Text uses **Shema Black (#0A0703)**, never absolute black. +- Subtitles and secondary text use **Shema Dark Green (#3F3E20)**. + +### Typography +- **Montserrat**: entire interface (UI, buttons, navigation). +- **Merriweather**: long-form texts, biblical content, and continuous reading. +- Fonts observed in screenshots should be ignored if they conflict with this guide. + +### Color Hierarchy +- **Tile / Clay (#BE4A01)** is exclusive to: + - CTAs + - Primary actions + - Active icons +- Never use Tile as a neutral decorative color. + +--- + +## 3. UI Generation Rules + +### What TO DO + +#### Mobile (Flutter) +- Use **Elevation** to separate surfaces. +- Buttons and cards with generously rounded corners (16px+). +- Large touch areas. +- Components compatible with `ColorScheme` and `TextTheme`. + +#### Web +- Wider, more breathable layouts. +- Cards with corner radius between 8px and 12px. +- Hover and focus states using opacity, never new colors. + +#### Colors +- Use only the defined design tokens. +- Variations only through **opacity** or **state**. + +--- + +## Color Modes Governance + +The Shema Design System officially supports two visual modes. + +--- + +### ☀️ Light Mode — “Paper & Ink” + +**Metaphor:** Printed paper. + +- Background: Cream Shema (#F6F5EB) +- Surface: Pure White (#FFFFFF) +- Primary Text: Black Shema (#0A0703) +- Secondary Text: Dark Green (#3F3E20) +- Borders: Sand (#C5C29F) + +Pure white must never be used as a page background. + +--- + +### 🌙 Dark Mode — “Night & Earth” + +**Metaphor:** Organic night environment. + +- Background: Black Shema (#0A0703) +- Surface: Black Shema with visible borders +- Highlight Surface: Dark Green (#3F3E20) +- Primary Text: Cream Shema (#F6F5EB) +- Secondary Text: Sand (#C5C29F) + +--- + +### Strict Restrictions + +- Do NOT use generic neutral greys. +- Do NOT approximate Material Design dark palettes. +- Dark interfaces must be composed only using Shema palette colors. + +Failure to follow these rules must be treated as a design defect, not a stylistic preference. + +### What NOT TO DO +- Do not create complex gradients. +- Do not invent new semantic colors outside the earthy palette. +- Do not use Merriweather for buttons, menus, or navigation. +- Do not mix Web and App patterns without explicit documentation. + +--- + +### Spacing and Layout +- **Generous breathing room**: Use the 4px base spacing scale (Tailwind). +- **Card padding**: 16px minimum (mobile), 24px recommended (desktop). +- **Section gaps**: Space-y-6 or space-y-8 for vertical rhythm. +- **Grid systems**: Responsive grids that adapt from single column (mobile) to multi-column (desktop). + +### Component Guidelines + +#### Buttons +- **Primary (Tile)**: Reserved for main CTAs only. +- **Rounded corners**: 8px+ for buttons (Web), 16px+ for mobile. +- **Touch targets**: Minimum 44px height for mobile buttons. +- **States**: Use opacity for hover/focus, never introduce new colors. + +#### Cards +- **Background**: White (#FFFFFF) for elevated surfaces. +- **Borders**: Subtle with `border-areia/30`. +- **Corner radius**: 8-12px (Web), 16px+ (Mobile). +- **Shadows**: Soft shadows for elevation (`shadow-sm`, `shadow-md`). +- **Hover states**: Increase shadow and adjust border opacity. + +#### Forms +- **Inputs**: White background with `border-areia`. +- **Focus states**: Ring with telha color (`ring-telha`). +- **Labels**: Montserrat medium, text-sm. +- **Validation**: Use verde-claro for success, red for errors. + +#### Badges +- **Rounded**: Full rounded (`rounded-full`) for pill-shaped badges. +- **Category colors**: Predefined color combinations for participants, events, discourse. +- **Size**: text-xs with medium weight for clarity. + +--- + +## 4. Animation Principles + +### Transitions +- **Duration**: 200ms default for most interactions. +- **Easing**: Use `ease-out` for entrances, `ease-in-out` for state changes. +- **Properties**: Prefer `transform` and `opacity` (GPU-accelerated). + +### Keyframes +- **fade-in**: Subtle entrance with vertical movement. +- **slide-in**: Horizontal entrance for modals/sheets. +- **pulse-soft**: Gentle attention grabber. +- **celebrate**: Success feedback animation. + +### Best Practices +- Avoid animating layout properties (width, height, top, left). +- Respect `prefers-reduced-motion` user preference. +- Keep animations subtle and non-distracting. + +For complete animation specifications, see [animations.md](./animations.md). + +--- + +## 5. Detailed Color Usage + +### Primary Colors +- **Telha (#BE4A01)**: Exclusive to CTAs, primary actions, active states. + - **Variations**: `telha-light`, `telha-dark`, `telha-muted` for different contexts. + - **Never** use telha as neutral decoration or background. + +- **Shema White / Cream (#F6F5EB)**: Main background color. + - Provides paper-like warmth and reduces eye strain. + - Pure white (#FFFFFF) is reserved for elevated surfaces (cards, inputs). + +- **Shema Black (#0A0703)**: Primary text color. + - Softer than absolute black, better for long reading sessions. + +- **Shema Dark Green (#3F3E20)**: Secondary text, subtitles, descriptions. + +### Supporting Colors +- **Blue (#89AAA3)**: Supporting elements, subtle backgrounds. +- **Light Green (#777D45)**: Success states, positive indicators, validation. +- **Sand (#C5C29F)**: Borders, muted elements, warnings. + +### Opacity Patterns +- `/10`: Very subtle backgrounds +- `/20`: Soft backgrounds for badges/highlights +- `/30`: Borders and subtle separators +- `/50`: Medium overlays +- `/90`: Strong hover states + +For complete color specifications, see [colors.md](./colors.md). + +--- + +## 6. Governance + +The single source of truth consists of: + +### Conflict Resolution +1. **Token files** override visual references +2. **This AGENTS.md** defines brand authority and principles +3. **Implementation docs** provide detailed usage patterns +4. When in doubt, consult token files first, then this document + +Any exception must be documented. + +--- + +## DS-2. Design System — Visão Geral e Quick Start + +## 📖 Overview + +The She design system for the **Shema** platform provides a comprehensive visual language and component library for creating consistent, accessible, and beautiful interfaces across Web and Mobile applications. + +### Brand Values + +Shema operates in the context of biblical translation and sacred text reading. The design system reflects these core values: + +- **Simple** - Clean interfaces that don't overwhelm +- **Accessible** - Usable by all, with proper contrast and semantic HTML +- **Lively** - Warm, engaging colors that invite interaction +- **Friendly** - Approachable components and gentle animations +- **Human** - Natural feel with paper-like backgrounds and soft contrasts + +--- + +## 🎨 Quick Start + +### Color Palette (Earthy Tones) + +| Color | Hex | Usage | +|-------|-----|-------| +| **Telha** (Clay/Tile) | `#BE4A01` | CTAs, primary actions, active states | +| **Shema White** (Cream) | `#F6F5EB` | Main background | +| **Shema Black** | `#0A0703` | Primary text | +| **Shema Dark Green** | `#3F3E20` | Secondary text | +| **Blue** | `#89AAA3` | Supporting elements | +| **Light Green** | `#777D45` | Success, validation | +| **Sand** | `#C5C29F` | Borders, muted elements | + +### Typography + +- **Montserrat**: Entire UI (buttons, navigation, labels, headings) +- **Merriweather**: Long-form text, biblical content, continuous reading + +### Spacing Scale + +Based on **4px base unit** (Tailwind default): +- `space-2` (8px) - Tight spacing +- `space-4` (16px) - Default spacing +- `space-6` (24px) - Section spacing +- `space-8` (32px) - Large gaps + +### Component Basics + +```tsx +import { Button, Card, Badge } from '@/components/ui' +import { cardStyles } from '@/styles' + +// Primary button + + +// Card with content + + + Title + + Content + + +// Category badge + + Person + +``` + +--- + +## 📚 Complete Documentation + +### Design Tokens (Authoritative Source) + +Tokens are the single source of truth. All implementation must align with these files: + +- **[colors.json](./tokens/colors.json)** - Color palette, semantic tokens, category colors +- **[typography.json](./tokens/typography.json)** - Font families, scales, weights, line heights +- **[spacing.json](./tokens/spacing.json)** - Spacing scale, semantic spacing values +- **[animations.json](./tokens/animations.json)** - Keyframes, durations, easing functions +- **[borders.json](./tokens/borders.json)** - Border widths, corner radius values +- **[shadows.json](./tokens/shadows.json)** - Shadow scales for elevation + +### Implementation Guides + +Detailed usage patterns and code examples for each design system element: + +1. **[colors.md](./colors.md)** - Complete color system + - Base palette and semantic tokens + - Category colors (participants, events, discourse) + - Validation and state colors + - Opacity patterns and usage examples + +2. **[typography.md](typography.md)** - Typography hierarchy + - Font families (Montserrat, Merriweather) + - Type scale (headings, body, captions) + - Font weights, line heights, letter spacing + - Hebrew text specifications + +3. **[spacing.md](./spacing.md)** - Spacing and layout + - Spacing scale (4px base) + - Layout patterns (grids, containers) + - Padding and margin conventions + - Label → Input/Select spacing (mb-2 default) + - Dropdown spacing and icon positioning + +4. **[animations.md](./animations.md)** - Motion design + - Keyframes (fade-in, slide-in, pulse, celebrate) + - Transition patterns and durations + - Performance best practices + +5. **[components.md](./components.md)** - UI components + - Progress Step (preferred option for progress indicators) + - Button, Card, Input, Select, Dialog + - Component variants and sizes + - Usage patterns and examples + +6. **[cards.md](./cards.md)** - Card system + - Card variants (base, hover, selected, dashed) + - Specialized cards (clause, event, participant) + - States and interactions + +7. **[badges.md](./badges.md)** - Badge system + - Badge variants and sizes + - Category colors and semantic badges + - Validation and status badges + +8. **[states.md](./states.md)** - UI states + - Loading states and spinners + - Error, success, warning banners + - Empty states and placeholders + +9. **[layout.md](./layout.md)** - Layout patterns + - Grid systems (responsive) + - Page templates and containers + - Modal and dialog layouts + +10. **[border-radius.md](./border-radius.md)** - Corner radius + - Radius scale (sm, md, lg) + - Component-specific radius values + - Platform differences (Web vs Mobile) + +11. **[sections.md](./sections.md)** - Section patterns + - Collapsible sections + - Section variants (roles, emotions, etc.) + - Header patterns + +12. **[themes.md](./themes.md)** - Theme system + - Light theme (current) + - Dark theme (future) + - Theme switching implementation + +--- + +## 🎯 Design Principles + +### 1. Natural Feel + +Avoid stark, clinical interfaces. Use **Shema White / Cream (#F6F5EB)** as the main background to simulate paper texture and provide visual comfort. Reserve pure white (#FFFFFF) for elevated surfaces like cards and inputs. + +### 2. Soft Contrast + +Text uses **Shema Black (#0A0703)** instead of absolute black. Secondary text uses **Shema Dark Green (#3F3E20)**. This creates legible but gentle contrast suitable for long reading sessions. + +### 3. Intentional Color + +**Telha / Clay (#BE4A01)** is exclusive to primary actions, CTAs, and active states. Never use Telha as neutral decoration. This preserves its visual weight and guides users to key actions. + +### 4 Responsive Typography + +Use **Montserrat** for all UI elements (navigation, buttons, labels). Use **Merriweather** exclusively for long-form biblical text and continuous reading contexts. + +### 5. Elevation Through Shadow + +Create depth with subtle shadows (`shadow-sm`, `shadow-md`), not heavy outlines or thick borders. Hover states should increase shadow intensity. + +### 6. Gentle Motion + +Animations are subtle and non-distracting. Default duration is 200ms. Prefer `transform` and `opacity` for smooth, GPU-accelerated transitions. + +--- + +## 🛠️ Using the Design System + +### In React Components + +```tsx +import { Button, Card, Badge, Input } from '@/components/ui' +import { cardStyles, participantCategoryColors } from '@/styles' +import { cn } from '@/utils/cn' + +export function ExampleComponent() { + return ( + + + + + Passage Details + + Genesis 1:1-3 + + +
+ + + Divine + +
+
+ + + + +
+ ) +} +``` + +### With Tailwind Classes + +```tsx +// Background and text colors +
+

Heading

+

Description

+
+ +// Spacing and layout +
+
+ ... +
+
+ +// Transitions and hover + +``` + +--- + +## 📱 Platform Differences + +### Web +- Border radius: 8-12px for cards, 8px for buttons +- Hover states: Use opacity and shadow changes +- Layouts: Wider, more breathable spacing + +### Mobile (Flutter) +- Border radius: 16px+ for generous rounded corners +- Touch targets: Minimum 44px height +- Elevation: Use Material elevation for depth +- Large touch areas for accessibility + +--- + +## 🔄 Governance and Authority + +### Hierarchy of Truth + +1. **Token files** (`/tokens/*.json`) are authoritative. If there's a conflict between code and tokens, tokens win. +2. **[AGENTS.md](./AGENTS.md)** defines brand values and core principles. +3. **Implementation docs** (this file and others) provide detailed usage patterns. + +### When to Update + +- **Tokens**: Only update with design team approval. +- **Implementation docs**: Update when patterns evolve or new use cases emerge. +- **Visual references**: Update when major visual changes occur. + +### Requesting Changes + +Document any exceptions or deviations. Propose token changes through design review process. Never introduce arbitrary colors or typography outside the defined system. + +--- + +## ✅ Checklist for Contributors + +Before creating or modifying UI: + +- [ ] Use colors from `colors.json` only +- [ ] Use Montserrat for UI, Merriweather for reading content +- [ ] Follow spacing scale (4px base) +- [ ] Use existing components from `/components/ui` +- [ ] Apply centralized styles from `/styles` +- [ ] Test hover and focus states +- [ ] Verify accessibility (contrast, keyboard navigation) +- [ ] Respect `prefers-reduced-motion` for animations +- [ ] Check responsive behavior (mobile, tablet, desktop) + +--- + +*This design system is maintained by the Shema design team. For questions or contributions, consult the governance section above.* + +--- + +## DS-3. Sistema de Cores + +## Overview + +The Shema Design System uses an earthy color palette inspired by natural tones, reflecting the brand values: simple, accessible, lively, friendly, and human. + +## Base Palette + +| Name | Hex | Token | Usage | +|------|-----|-------|-----| +| **Telha (Clay/Tile)** | `#BE4A01` | `telha` | Primary color, CTAs, primary actions, active states | +| **Shema White (Cream)** | `#F6F5EB` | `branco` | Main background, simulates paper | +| **Sand** | `#C5C29F` | `areia` | Borders, secondary elements, muted | +| **Blue** | `#89AAA3` | `azul` | Supporting elements, subtle backgrounds | +| **Light Green** | `#777D45` | `verde-claro` | Success, validation, positive states | +| **Dark Green** | `#3F3E20` | `verde` | Secondary text, descriptions | +| **Shema Black** | `#0A0703` | `preto` | Primary text, foreground | +| **Pure White** | `#FFFFFF` | `white` | Elevated surfaces (cards, inputs) | + +> [!IMPORTANT] +> **Shema Brand Rule**: Never use pure white (#FFFFFF) as the main background. Use **Shema White / Cream (#F6F5EB)** to simulate paper and provide visual comfort. Pure white is reserved exclusively for elevated surfaces (cards, inputs). + +## Primary Colors + +### Telha (#BE4A01) + +**Exclusive to CTAs, primary actions, and active icons.** + +- **Never** use Telha as neutral decoration or background. +- Variations are created through opacity or state changes. +- Hover states use opacity, never new colors. + +### Shema White / Cream (#F6F5EB) + +**Main background color.** + +- Provides paper-like warmth and reduces eye strain. +- Pure white (#FFFFFF) is reserved for elevated surfaces (cards, inputs). + +### Shema Black (#0A0703) + +**Primary text color.** + +- Softer than absolute black, better for long reading sessions. +- Never use absolute black (#000000). + +### Shema Dark Green (#3F3E20) + +**Secondary text, subtitles, descriptions.** + +## Supporting Colors + +### Blue (#89AAA3) + +Supporting elements and subtle backgrounds. + +### Light Green (#777D45) + +Success states, positive indicators, validation. + +### Sand (#C5C29F) + +Borders, muted elements, warnings. + +## Semantic Tokens + +The system defines semantic tokens that map to base colors: + +```typescript +primary: { + DEFAULT: '#BE4A01', // telha + foreground: '#F6F5EB', // branco +} + +secondary: { + DEFAULT: '#89AAA3', // azul + foreground: '#0A0703', // preto +} + +success: { + DEFAULT: '#777D45', // verde-claro + foreground: '#F6F5EB', // branco +} + +background: '#F6F5EB' // branco (Shema Cream) +foreground: '#0A0703' // preto (Shema Black) + +card: { + DEFAULT: '#FFFFFF', // white + foreground: '#0A0703', // preto +} + +border: '#C5C29F' // areia +input: '#C5C29F' // areia +ring: '#BE4A01' // telha (focus rings) + +muted: { + DEFAULT: '#C5C29F', // areia + foreground: '#3F3E20', // verde +} + +accent: { + DEFAULT: '#89AAA3', // azul + foreground: '#0A0703', // preto +} + +destructive: { + DEFAULT: '#BE4A01', // telha (same as primary) + foreground: '#F6F5EB', // branco +} +``` + +## Opacity Patterns + +The system uses opacity to create subtle variations: + +- `/10` - Very subtle backgrounds (e.g., `bg-telha/10`) +- `/20` - Soft backgrounds for badges/highlights (e.g., `bg-verde-claro/20`) +- `/30` - Borders and subtle separators (e.g., `border-areia/30`) +- `/50` - Medium overlays +- `/90` - Strong hover states + +### Examples + +```tsx +// Soft background +
...
+ +// Border with opacity +
...
+ +// Hover with opacity + +``` + +## Category Colors + +### Participants + +Colors for different participant categories: + +```typescript +participantCategoryColors = { + divine: 'bg-amber-100 text-amber-800 border-amber-200', + person: 'bg-telha/10 text-telha-dark border-telha/20', + place: 'bg-azul/20 text-verde border-azul/30', + time: 'bg-verde-claro/20 text-verde border-verde-claro/30', + object: 'bg-gray-100 text-gray-800 border-gray-200', + abstract: 'bg-areia/30 text-preto border-areia', + group: 'bg-indigo-100 text-indigo-800 border-indigo-200', + animal: 'bg-emerald-100 text-emerald-800 border-emerald-200', +} +``` + +### Events + +Colors for event categories: + +```typescript +eventCategoryColors = { + ACTION: 'bg-telha/10 text-telha border-telha/20', + SPEECH: 'bg-azul/20 text-verde border-azul/30', + MOTION: 'bg-verde-claro/20 text-verde border-verde-claro/30', + STATE: 'bg-areia/30 text-verde border-areia', + PROCESS: 'bg-purple-100 text-purple-800 border-purple-200', + TRANSFER: 'bg-blue-100 text-blue-800 border-blue-200', + INTERNAL: 'bg-pink-100 text-pink-800 border-pink-200', + RITUAL: 'bg-amber-100 text-amber-800 border-amber-200', + META: 'bg-gray-100 text-gray-800 border-gray-200', +} +``` + +### Discourse + +Colors for discourse relations: + +```typescript +discourseCategoryColors = { + temporal: 'bg-blue-100 text-blue-800', + logical: 'bg-purple-100 text-purple-800', + rhetorical: 'bg-orange-100 text-orange-800', + narrative: 'bg-emerald-100 text-emerald-800', +} +``` + +## Validation States + +Colors for validation states: + +```typescript +validationBadgeStyles = { + validated: 'bg-verde-claro/20 text-verde-claro border-verde-claro/30', + pending: 'bg-areia/30 text-verde border-areia', + error: 'bg-red-100 text-red-800 border-red-200', +} +``` + +## Accessibility + +### Contrast + +All color combinations follow WCAG standards: + +- **Normal text**: Minimum contrast of 4.5:1 +- **Large text**: Minimum contrast of 3:1 +- **Interactive elements**: Minimum contrast of 3:1 + +### Contrast Examples + +- `preto` on `branco`: ✅ 21:1 (Excellent) +- `telha` on `branco`: ✅ 4.8:1 (Adequate) +- `verde` on `branco`: ✅ 8.2:1 (Excellent) +- `telha` on `areia`: ⚠️ 2.1:1 (Not adequate - avoid) + +## Usage in Code + +### Tailwind Classes + +```tsx +// Direct colors +
...
+
...
+ +// With opacity +
...
+ +// Semantic tokens +
...
+``` + +### TypeScript/JavaScript + +```typescript +import { participantCategoryColors } from '@/styles' + +const categoryColor = participantCategoryColors[participant.category] +``` +--- + +## DS-4. Tipografia + +## Font Families + +### Montserrat — Primary Font (UI) + +**Usage**: Entire interface (buttons, navigation, labels, headings, forms) + +```css +font-family: 'Montserrat', system-ui, -apple-system, sans-serif; +``` + +> [!IMPORTANT] +> **Montserrat is exclusive for UI**. Use Montserrat for all interface elements: buttons, menus, navigation, card titles, form labels, badges, and any interactive element. + +### Merriweather — Secondary Font (Reading) + +**Usage**: Long-form text, biblical content, continuous reading + +```css +font-family: 'Merriweather', Georgia, serif; +``` + +> [!IMPORTANT] +> **Merriweather is exclusive for reading contexts**. Use Merriweather only for continuous reading text, especially biblical content and extensive passages. + +### Tailwind Configuration + +```javascript +fontFamily: { + sans: ['Montserrat', 'system-ui', '-apple-system', 'sans-serif'], + serif: ['Merriweather', 'Georgia', 'serif'], +} +``` + +### Hebrew Text Font + +For Hebrew text, use a serif font with RTL direction: + +```css +.hebrew-text { + font-family: serif; + text-align: right; + direction: rtl; + font-size: 1.125rem; /* text-lg */ + line-height: 1.75; /* leading-relaxed */ +} +``` + +## Font Weights + +Available weights: + +| Class | Weight | Usage | +|--------|------|-----| +| `font-normal` | 400 | Default text, body, reading | +| `font-medium` | 500 | Labels, badges, subtle emphasis | +| `font-semibold` | 600 | Card titles, subtitles | +| `font-bold` | 700 | Main headings, strong emphasis | + +## Type Scale + +### Web Scale + +| Style | Font Family | Weight | Size | Line Height | Usage | +|-------|-------------|--------|------|-------------|-------| +| `h1` | Montserrat | 700 | 32px | 1.2 | Main page titles | +| `h2` | Montserrat | 700 | 24px | 1.3 | Section headings | +| `h3` | Montserrat | 600 | 20px | 1.4 | Card titles, subsections | +| `body` | Montserrat | 400 | 16px | 1.5 | Default UI text | +| `body_serif` | Merriweather | 400 | 16px | 1.6 | Reading contexts | +| `caption` | Montserrat | 500 | 12px | 1.5 | Labels, hints, badges | + +### App Scale (Flutter) + +| Style | Font Family | Weight | Size | Flutter Style | +|-------|-------------|--------|------|---------------| +| `display` | Montserrat | 700 | 28px | headlineMedium | +| `title` | Montserrat | 700 | 20px | titleLarge | +| `body` | Montserrat | 400 | 16px | bodyMedium | +| `label` | Montserrat | 500 | 14px | labelLarge | + +## Tailwind Size Classes + +| Class | Size | Line Height | Usage | +|--------|---------|-------------|-----| +| `text-xs` | 0.75rem (12px) | 1rem | Small labels, badges, hints | +| `text-sm` | 0.875rem (14px) | 1.25rem | Secondary text, descriptions, inputs | +| `text-base` | 1rem (16px) | 1.5rem | Default body text | +| `text-lg` | 1.125rem (18px) | 1.75rem | Hebrew text, highlights, subtitles | +| `text-xl` | 1.25rem (20px) | 1.75rem | Card titles, section subtitles | +| `text-2xl` | 1.5rem (24px) | 2rem | Page titles, main headers | +| `text-3xl` | 1.875rem (30px) | 2.25rem | Hero titles, large titles | +| `text-4xl` | 2.25rem (36px) | 2.5rem | Large headers (mobile hero) | + +## Line Height + +| Class | Value | Usage | +|--------|-------|-----| +| `leading-none` | 1 | Very compact headings | +| `leading-tight` | 1.25 | Headings, headers | +| `leading-snug` | 1.375 | Subtitles | +| `leading-normal` | 1.5 | Default UI text | +| `leading-relaxed` | 1.75 | Hebrew text, reading, long paragraphs | +| `leading-loose` | 2 | Very spaced text | + +## Letter Spacing + +| Class | Value | Usage | +|--------|-------|-----| +| `tracking-tighter` | -0.05em | Large display headings | +| `tracking-tight` | -0.025em | Normal headings | +| `tracking-normal` | 0 | Default (most cases) | +| `tracking-wide` | 0.025em | Labels, badges, uppercase | +| `tracking-wider` | 0.05em | Spaced headers | +| `tracking-widest` | 0.1em | Decorative headings | + +## Typography Hierarchy + +### Page Title + +```tsx +

+ + Page Title +

+``` + +**Font**: Montserrat Bold 24px, text-preto + +### Card Title + +```tsx + + Card Title + +``` + +**Font**: Montserrat Semibold 20px, text-preto + +### Description + +```tsx + + Card or section description + +``` + +**Font**: Montserrat Regular 14px, text-verde + +### Body Text (UI) + +```tsx +

+ Application body text +

+``` + +**Font**: Montserrat Regular 16px, text-preto + +### Reading Content (Biblical Content) + +```tsx +
+

+ In the beginning, God created the heavens and the earth... +

+
+``` + +**Font**: Merriweather Regular 16px, leading-relaxed, text-preto + +### Secondary Text + +```tsx +

+ Secondary or descriptive text +

+``` + +**Font**: Montserrat Regular 14px, text-verde + +### Labels and Hints + +```tsx + + + Hint or help + +``` + +**Font**: Montserrat Medium/Regular, text-xs or text-sm + +## Text Styles + +### Decoration + +```tsx +// Underlined (links) +Link + +// Strikethrough +Strikethrough text + +// No decoration +No decoration text +``` + +### Transformation + +```tsx +// Uppercase +UPPERCASE TEXT + +// Lowercase +lowercase text + +// Capitalize +capitalized text +``` + +### Alignment + +```tsx +// Left (default) +

...

+ +// Center +

...

+ +// Right +

...

+ +// Justified +

...

+``` + +## Truncation and Overflow + +```tsx +// Truncate with ellipsis +

Very long text that will be truncated...

+ +// Break words +

Text that breaks long words

+ +// Break all +

Text that breaks anywhere

+``` + +## Antialiasing + +The application uses antialiasing to improve font rendering: + +```css +body { + font-smoothing: antialiased; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +``` + +## Font Features + +Advanced typographic features are enabled: + +```css +body { + font-feature-settings: "rlig" 1, "calt" 1; +} +``` + +- `rlig`: Required ligatures +- `calt`: Contextual alternates + +## Text Colors + +### Primary Colors + +```tsx +// Primary text (Shema Black) +

Primary text

+ +// Secondary text (Shema Dark Green) +

Secondary text

+ +// Muted text +

Muted text

+ +// Text on primary button + +``` + +### Semantic Colors + +```tsx +// Success +

Success text

+ +// Error +

Error text

+ +// Warning +

Warning text

+ +// Info +

Informative text

+``` + +## Component Examples + +### CardTitle (Montserrat) + +```tsx + + Card Title + +``` + +### CardDescription (Montserrat) + +```tsx + + Card description + +``` + +### Page Header (Montserrat) + +```tsx +
+ + Page Title +
+

Subtitle or description

+``` + +### Reading Content (Merriweather) + +```tsx +
+

+ This is an example of long text for continuous reading. + The Merriweather font is optimized for on-screen reading and + provides a comfortable experience even with extensive texts. +

+
+``` + +## DS-5. Espaçamento + +## Overview + +The application uses the Tailwind CSS spacing system, based on a 4px (0.25rem) scale. + +## Base Unit + +The spacing system uses a **4px base unit** (Tailwind default). + +## Spacing Scale + +| Class | Value | Pixels | Usage | +|---------|-------|--------|-----| +| `0` | 0 | 0px | No spacing | +| `0.5` | 0.125rem | 2px | Minimum spacing | +| `1` | 0.25rem | 4px | Very small spacing | +| `1.5` | 0.375rem | 6px | Small spacing | +| `2` | 0.5rem | 8px | Small spacing | +| `2.5` | 0.625rem | 10px | Small-medium spacing | +| `3` | 0.75rem | 12px | Medium spacing | +| `4` | 1rem | 16px | Default spacing | +| `5` | 1.25rem | 20px | Medium-large spacing | +| `6` | 1.5rem | 24px | Large spacing | +| `8` | 2rem | 32px | Very large spacing | +| `10` | 2.5rem | 40px | Extra large spacing | +| `12` | 3rem | 48px | Maximum common spacing | + +### Semantic Spacing Values + +```json +{ + "base": 4, + "scale": { + "xs": { "value": "4px", "flutter": 4 }, + "sm": { "value": "8px", "flutter": 8 }, + "md": { "value": "16px", "flutter": 16 }, + "lg": { "value": "24px", "flutter": 24 }, + "xl": { "value": "32px", "flutter": 32 }, + "xxl": { "value": "48px", "flutter": 48 } + } +} +``` + +## Padding + +### Card Padding + +```tsx +// Default card +... + +// Card header +... + +// Card content +... + +// Card footer +... +``` + +**Minimum**: 16px (mobile), **Recommended**: 24px (desktop) + +### Button Padding + +```tsx +// Default button + + +// Small button + + +// Large button + + +// Icon button + +``` + +### Input Padding + +```tsx +... +``` + +### Badge Padding + +```tsx +... +``` + +### Responsive Padding + +```tsx +// Mobile: p-4, Desktop: p-6 +
...
+ +// Mobile: px-3, Desktop: px-6 +
...
+``` + +## Margin + +### Vertical Spacing (space-y) + +```tsx +// Default spacing between elements +
...
+ +// Small spacing +
...
+ +// Large spacing +
...
+ +// Very large spacing +
...
+``` + +**Recommended**: `space-y-6` or `space-y-8` for vertical rhythm. + +### Horizontal Spacing (space-x) + +```tsx +// Default horizontal spacing +
...
+ +// Large horizontal spacing +
...
+``` + +### Individual Margin + +```tsx +// Top +
...
+ +// Bottom +
...
+ +// Left +
...
+ +// Right +
...
+ +// All sides +
...
+``` + +### Negative Margin + +```tsx +// Element overlap +
...
+``` + +## Gap (Flexbox/Grid) + +### Gap in Flex + +```tsx +// Default gap +
...
+ +// Medium gap +
...
+ +// Large gap +
...
+``` + +### Gap in Grid + +```tsx +// Grid with gap +
...
+ +// Responsive grid +
...
+``` + +## Layout Patterns + +### Container + +```tsx +// Container with padding +
...
+ +// Responsive container padding +
...
+``` + +**Max width**: 1200px (from tokens/spacing.json) + +### Page Layout + +```tsx +// Default page +
...
+ +// Page with smaller spacing +
...
+``` + +### Card Layout + +```tsx +// Card with internal spacing + +
...
+
+``` + +### Form Layout + +```tsx +// Form group +
+ + + Hint +
+ +// Form with multiple groups +
+
...
+
...
+
+``` + +### Modal Layout + +```tsx + + ... + +
...
+
+ +
...
+
+
+``` + +## Grids + +### 2-Column Grid + +```tsx +
...
+``` + +### 3-Column Grid + +```tsx +
...
+``` + +### 4-Column Grid + +```tsx +
...
+``` + +## Component-Specific Spacing + +### Stage Cards + +```tsx +
+
...
+
+``` + +### Clause Cards + +```tsx +
+
...
+
+``` + +### Event Cards + +```tsx +
+
...
+
+``` + +### Participant Cards + +```tsx +
+
...
+
+``` + +## Icon Spacing + +### Icons with Text + +```tsx +// Icon on the left +
+ + Text +
+ +// Icon on the right +
+ Text + +
+``` + +### Icons in Titles + +```tsx +

+ + Title +

+``` + +## Responsive Spacing + +### Breakpoints + +```tsx +// Mobile first +
...
+ +// Conditional spacing +
...
+ +// Responsive gap +
...
+``` + +## Spacing Patterns by Context + +### Empty States + +```tsx +
...
+``` + +### Loading States + +```tsx +
...
+``` + +### Error States + +```tsx +
...
+``` + +### Section Headers + +```tsx +
...
+``` + +## Generous Breathing Room + +The design system emphasizes **generous breathing room**: + +- Use the 4px base spacing scale consistently +- Card padding: 16px minimum (mobile), 24px recommended (desktop) +- Section gaps: `space-y-6` or `space-y-8` for vertical rhythm +- Grid systems: Responsive grids that adapt from single column (mobile) to multi-column (desktop) + + +## DS-6. Animações e Transições + +## Animation System + +The application uses smooth animations and consistent transitions to improve user experience. + +## Keyframes + +### Fade In + +Fade in animation with vertical movement. + +```css +@keyframes fade-in { + 0% { + opacity: 0; + transform: translateY(10px); + } + 100% { + opacity: 1; + transform: translateY(0); + } +} +``` + +#### Tailwind Configuration + +```javascript +keyframes: { + 'fade-in': { + '0%': { opacity: '0', transform: 'translateY(10px)' }, + '100%': { opacity: '1', transform: 'translateY(0)' }, + }, +} +``` + +#### Usage + +```tsx +
...
+``` + +### Slide In + +Slide in animation from the left. + +```css +@keyframes slide-in { + 0% { + opacity: 0; + transform: translateX(-10px); + } + 100% { + opacity: 1; + transform: translateX(0); + } +} +``` + +#### Tailwind Configuration + +```javascript +keyframes: { + 'slide-in': { + '0%': { opacity: '0', transform: 'translateX(-10px)' }, + '100%': { opacity: '1', transform: 'translateX(0)' }, + }, +} +``` + +#### Usage + +```tsx +
...
+``` + +### Pulse Soft + +Soft pulse animation. + +```css +@keyframes pulse-soft { + 0%, 100% { + opacity: 1; + } + 50% { + opacity: 0.7; + } +} +``` + +#### Tailwind Configuration + +```javascript +keyframes: { + 'pulse-soft': { + '0%, 100%': { opacity: '1' }, + '50%': { opacity: '0.7' }, + }, +} +``` + +#### Usage + +```tsx +
...
+``` + +### Bounce Subtle + +Subtle bounce animation. + +```css +@keyframes bounce-subtle { + 0%, 100% { + transform: translateY(0); + } + 50% { + transform: translateY(-3px); + } +} +``` + +#### Tailwind Configuration + +```javascript +keyframes: { + 'bounce-subtle': { + '0%, 100%': { transform: 'translateY(0)' }, + '50%': { transform: 'translateY(-3px)' }, + }, +} +``` + +#### Usage + +```tsx +
...
+``` + +### Celebrate + +Celebration animation (scale). + +```css +@keyframes celebrate { + 0% { + transform: scale(1); + } + 50% { + transform: scale(1.1); + } + 100% { + transform: scale(1); + } +} +``` + +#### Tailwind Configuration + +```javascript +keyframes: { + 'celebrate': { + '0%': { transform: 'scale(1)' }, + '50%': { transform: 'scale(1.1)' }, + '100%': { transform: 'scale(1)' }, + }, +} +``` + +#### Usage + +```tsx +
...
+``` + +## Configured Animations + +### Fade In + +```javascript +animation: { + 'fade-in': 'fade-in 0.3s ease-out', +} +``` + +#### Usage + +```tsx +
...
+``` + +### Slide In + +```javascript +animation: { + 'slide-in': 'slide-in 0.3s ease-out', +} +``` + +#### Usage + +```tsx +
...
+``` + +### Pulse Soft + +```javascript +animation: { + 'pulse-soft': 'pulse-soft 2s ease-in-out infinite', +} +``` + +#### Usage + +```tsx +
...
+``` + +### Bounce Subtle + +```javascript +animation: { + 'bounce-subtle': 'bounce-subtle 0.5s ease-in-out', +} +``` + +#### Usage + +```tsx +
...
+``` + +### Celebrate + +```javascript +animation: { + 'celebrate': 'celebrate 0.4s ease-in-out', +} +``` + +#### Usage + +```tsx +
...
+``` + +## Transitions + +### Default Duration + +The application uses a default duration of **200ms** for most transitions. + +### Hover Transitions + +```tsx +// Card with hover +
+ ... +
+ +// Button with hover + +``` + +### State Transitions + +```tsx +// Element with color transition +
+ ... +
+ +// Element with scale transition + +``` + +### Opacity Transitions + +```tsx +// Element with fade +
+ ... +
+``` + +## Loading Animations + +### Spinner + +```tsx +
+``` + +### Small Spinner + +```tsx +
+``` + +### Spinner with Text + +```tsx +
+
+ Loading... +
+``` + +## Entrance Animations + +### Fade In in List + +```tsx +{items.map((item, index) => ( +
+ ... +
+))} +``` + +### Slide In in Modal + +```tsx + + + ... + + +``` + +## Interaction Animations + +### Button with Scale + +```tsx + +``` + +### Card with Hover + +```tsx + + ... + +``` + +### Badge with Pulse + +```tsx + + New + +``` + +## Validation Animations + +### Celebration on Validation + +```tsx +{isValidated && ( +
+ +
+)} +``` + +### Bounce on Completion + +```tsx +{isCompleted && ( +
+ +
+)} +``` + +## Custom CSS Classes + +### Animate In + +```css +.animate-in { + animation: fade-in 0.3s ease-out; +} +``` + +#### Usage + +```tsx +
...
+``` + +### Slide In Left + +```css +.slide-in-left { + animation: slide-in 0.3s ease-out; +} +``` + +#### Usage + +```tsx +
...
+``` + +## Performance + +### Optimizations + +- Use `transform` and `opacity` for animations (GPU-accelerated) +- Avoid animating `width`, `height`, `top`, `left` (causes reflow) +- Use `will-change` carefully (only when necessary) + +### Optimized Example + +```tsx +// ✅ Good - uses transform +
+ ... +
+ +// ❌ Avoid - animates width +
+ ... +
+``` + +## User Preferences + +### Reduce Motion + +Respect the user preference for reduced animations: + +```css +@media (prefers-reduced-motion: reduce) { + * { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + } +} +``` + +## DS-7. Componentes UI + +## Component System + +The application uses base components built with Radix UI, Tailwind CSS, and class-variance-authority (cva). + +## Component Structure + +All components follow this pattern: + +```tsx +import * as React from "react" +import { cn } from "@/utils/cn" +import { cva, type VariantProps } from "class-variance-authority" + +// Variants using cva +const componentVariants = cva( + "base-classes", + { + variants: { + variant: { ... }, + size: { ... }, + }, + defaultVariants: { ... } + } +) + +// Props interface +export interface ComponentProps + extends React.HTMLAttributes, + VariantProps { + // additional props +} + +// Component +const Component = React.forwardRef( + ({ className, variant, size, ...props }, ref) => { + return ( + + ) + } +) + +Component.displayName = "Component" + +export { Component, componentVariants } +``` + +## Progress Step + +Component for displaying step progress in a process or flow. Supports horizontal (desktop) and vertical (mobile) layouts. + +### States + +- **completed**: Completed step (light green with checkmark) +- **current**: Current step (telha with number and pulse animation) +- **pending**: Pending step (areia/30 with number) + +### Base Styles + +#### Progress Step Container + +```typescript +ProgressStepContainer: "bg-white rounded-xl border border-areia/30 shadow-sm p-6 md:p-8" +ProgressStepTitle: "text-xl font-semibold text-preto mb-6 flex items-center gap-2" +``` + +#### Step Circle (Step Icon) + +**Mobile (w-10 h-10):** +```typescript +// Completed +"w-10 h-10 rounded-full bg-verde-claro flex items-center justify-center text-white" + +// Current +"w-10 h-10 rounded-full bg-telha flex items-center justify-center text-white font-semibold animate-pulse" + +// Pending +"w-10 h-10 rounded-full bg-areia/30 flex items-center justify-center text-verde font-semibold" +``` + +**Desktop (w-12 h-12):** +```typescript +// Completed +"w-12 h-12 rounded-full bg-verde-claro flex items-center justify-center text-white mb-3" + +// Current +"w-12 h-12 rounded-full bg-telha flex items-center justify-center text-white font-semibold mb-3 animate-pulse" + +// Pending +"w-12 h-12 rounded-full bg-areia/30 flex items-center justify-center text-verde font-semibold mb-3" +``` + +#### Connectors (Lines between steps) + +**Mobile (vertical):** +```typescript +// Completed connector +"w-0.5 h-12 bg-verde-claro mt-2" + +// Pending connector +"w-0.5 h-12 bg-areia/50 mt-2" +``` + +**Desktop (horizontal):** +```typescript +// Completed connector +"flex-1 h-1 bg-verde-claro mx-2 -mt-8" + +// Pending connector +"flex-1 h-1 bg-areia/50 mx-2 -mt-8" +``` + +#### Step Texts + +**Mobile:** +```typescript +StepTitle: "font-semibold text-preto" +StepTitlePending: "font-semibold text-verde/60" +StepStatus: "text-sm text-verde mt-1" +StepStatusCurrent: "text-sm text-telha mt-1" +StepStatusPending: "text-sm text-verde/50 mt-1" +``` + +**Desktop:** +```typescript +StepTitle: "font-semibold text-preto text-center" +StepTitlePending: "font-semibold text-verde/60 text-center" +StepStatus: "text-sm text-verde mt-1 text-center" +StepStatusCurrent: "text-sm text-telha mt-1 text-center" +StepStatusPending: "text-sm text-verde/50 mt-1 text-center" +``` + +### Layout Mobile (Vertical) + +```tsx +
+ {steps.map((step, index) => ( +
+
+
+ {step.status === 'completed' ? ( + + ) : ( + {step.number} + )} +
+ {index < steps.length - 1 && ( +
+ )} +
+
+

+ {step.title} +

+

+ {step.statusText} +

+
+
+ ))} +
+``` + +### Layout Desktop (Horizontal) + +```tsx +
+ {steps.map((step, index) => ( + <> +
+
+ {step.status === 'completed' ? ( + + ) : ( + {step.number} + )} +
+

+ {step.title} +

+

+ {step.statusText} +

+
+ {index < steps.length - 1 && ( +
+ )} + + ))} +
+``` + +### Spacing + +- **Container padding**: `p-6 md:p-8` (24px mobile, 32px desktop) +- **Gap between steps (mobile)**: `space-y-4` (16px vertical) +- **Gap between step and content (mobile)**: `gap-4` (16px horizontal) +- **Title margin bottom**: `mb-6` (24px) +- **Status margin top**: `mt-1` (4px) +- **Content padding top (mobile)**: `pt-2` (8px) +- **Circle margin bottom (desktop)**: `mb-3` (12px) +- **Connector horizontal margin (desktop)**: `mx-2` (8px) +- **Connector negative top margin (desktop)**: `-mt-8` (-32px to align with circle) + +### Full Usage + +```tsx +
+

+ + Project Progress +

+ +
+ {/* Mobile Layout */} +
+ {/* Steps here */} +
+ + {/* Desktop Layout */} +
+ {/* Steps here */} +
+
+
+``` + +## Button + +### Variants + +```typescript +variant: { + default: "bg-telha text-white hover:bg-telha-dark shadow-md hover:shadow-lg", + secondary: "bg-azul text-white hover:bg-azul/90", + outline: "border-2 border-areia bg-transparent hover:bg-areia/20 text-preto", + ghost: "hover:bg-areia/20 text-preto", + success: "bg-verde-claro text-white hover:bg-verde", + destructive: "bg-red-500 text-white hover:bg-red-600", + link: "text-telha underline-offset-4 hover:underline", +} +``` + +### Sizes + +```typescript +size: { + default: "h-10 px-4 py-2", + sm: "h-9 rounded-md px-3", + lg: "h-12 rounded-lg px-8 text-base", + icon: "h-10 w-10", +} +``` + +### Usage + +```tsx +import { Button } from '@/components/ui/button' + +// Default button + + +// Secondary button + + +// Outline button + + +// Ghost button + + +// Success button + + +// Destructive button + + +// Link button + + +// Sizes + + + + + +// With icon + +``` + +## Card + +### Structure + +```tsx +import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@/components/ui/card' + + + + Title + Description + + + Content + + + Footer + + +``` + +### Styles + +```typescript +Card: "rounded-xl border border-areia/30 bg-white shadow-sm transition-all duration-200 hover:shadow-md" +CardHeader: "flex flex-col space-y-1.5 p-6" +CardTitle: "text-xl font-semibold leading-none tracking-tight text-preto" +CardDescription: "text-sm text-verde" +CardContent: "p-6 pt-0" +CardFooter: "flex items-center p-6 pt-0" +``` + +### Usage + +```tsx + + + Card Title + Card description + + +

Card content

+
+ + + +
+``` + +## Input + +### Styles + +```typescript +Input: "flex h-10 w-full rounded-lg border border-areia bg-white px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-verde/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-telha focus-visible:ring-offset-2 focus-visible:border-telha disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-200" +``` + +### Usage + +```tsx +import { Input } from '@/components/ui/input' + + + + + + + + +``` + +## Textarea + +### Styles + +Similar to Input, but with adjustable height. + +### Usage + +```tsx +import { Textarea } from '@/components/ui/textarea' + + +``` + +### Badges + +```tsx +// Default badge (full circle) +... +``` + +### Modals and Dialogs + +```tsx +// Dialog +... + +// Sheet +... +``` + +## Specific Border Radius + +### Individual Corners + +```tsx +// Top left +
...
+ +// Top right +
...
+ +// Bottom left +
...
+ +// Bottom right +
...
+ +// Top (both) +
...
+ +// Bottom (both) +
...
+ +// Left (both) +
...
+ +// Right (both) +
...
+``` + +## Usage Patterns + +### Cards with Border Radius + +```tsx +// Default card + + ... + + +// Card with hover + + ... + +``` + +### Buttons with Border Radius + +```tsx +// Primary button + + +// Outline button + +``` + +### Inputs with Border Radius + +```tsx +// Default input + + +// Input with focus + +``` + +### Badges with Border Radius + +```tsx +// Default badge (always rounded-full) + + Badge + +``` + +## Border Radius in States + +### Selected Cards + +```tsx +
+ ... +
+``` + +### Cards with Hover + +```tsx +
+ ... +
+``` + +## Responsive Border Radius + +Although uncommon, responsive border radius can be used: + +```tsx +// Mobile: rounded-md, Desktop: rounded-lg +
...
+``` + +## Special Shapes + +### Circles + +```tsx +// Circular avatar +
+ ... +
+ +// Circular icon + +``` + +### Pills + +```tsx +// Pill-shaped badge + + Badge + + +// Pill-shaped button + +``` + +## Border Radius in Sections + +### Collapsible Sections + +```tsx +
+
+ Header +
+
+ Content +
+
+``` + +### Cards with Border Left + +```tsx +// Card with highlighted left border +
+ ... +
+ +// Mainline clause card +
+ ... +
+ +// Background clause card +
+ ... +
+``` + +## Visual Consistency + +### Border Radius Hierarchy + +1. **Small elements** (badges, tags): `rounded-full` +2. **Medium elements** (buttons, inputs): `rounded-lg` +3. **Large elements** (cards, modals): `rounded-xl` +4. **Very large elements** (containers): `rounded-2xl` + +### Hierarchy Examples + +```tsx +// Large container +
+ {/* Medium card */} + + {/* Small button */} + + {/* Badge */} + ... + +
+``` + +## DS-13. Seções Colapsáveis + +## Section System + +The application uses collapsible sections with different visual variants to organize related content. + +## Base Section + +### Section Structure + +```tsx +
+ +
+ Section Content +
+
+``` + +## Section Variants + +### Variant Types + +```typescript +export type SectionVariant = + | 'default' + | 'roles' + | 'modifiers' + | 'pragmatic' + | 'emotion' + | 'la-tags' + | 'figurative' + | 'key-terms' + | 'speech' + | 'narrator' +``` + +### Style Interface + +```typescript +export interface SectionStyle { + header: string + content: string + border: string +} +``` + +## Styles by Variant + +### Default + +```typescript +default: { + header: 'bg-areia/10 hover:bg-areia/20', + content: 'bg-white', + border: 'border-areia/30', +} +``` + +#### Usage + +```tsx +import { sectionStyles } from '@/styles' + +
+ +
+ Content +
+
+``` + +### Roles + +```typescript +roles: { + header: 'bg-amber-50 hover:bg-amber-100', + content: 'bg-amber-50/50', + border: 'border-l-4 border-l-amber-400 border-areia/30', +} +``` + +#### Usage + +```tsx +
+ +
+ Roles content +
+
+``` + +### Modifiers + +```typescript +modifiers: { + header: 'bg-slate-50 hover:bg-slate-100', + content: 'bg-white', + border: 'border-areia/30', +} +``` + +#### Usage + +```tsx +
+ +
+ Modifiers content +
+
+``` + +### Pragmatic + +```typescript +pragmatic: { + header: 'bg-yellow-50 hover:bg-yellow-100', + content: 'bg-yellow-50/50', + border: 'border-areia/30', +} +``` + +### Emotion + +```typescript +emotion: { + header: 'bg-pink-50 hover:bg-pink-100', + content: 'bg-pink-50/50', + border: 'border-areia/30', +} +``` + +### LA Tags + +```typescript +'la-tags': { + header: 'bg-emerald-50 hover:bg-emerald-100', + content: 'bg-emerald-50/50', + border: 'border-areia/30', +} +``` + +### Figurative + +```typescript +figurative: { + header: 'bg-purple-50 hover:bg-purple-100', + content: 'bg-purple-50/50', + border: 'border-areia/30', +} +``` + +### Key Terms + +```typescript +'key-terms': { + header: 'bg-orange-50 hover:bg-orange-100', + content: 'bg-orange-50/50', + border: 'border-areia/30', +} +``` + +### Speech + +```typescript +speech: { + header: 'bg-blue-50 hover:bg-blue-100', + content: 'bg-blue-50/50', + border: 'border-areia/30', +} +``` + +### Narrator + +```typescript +narrator: { + header: 'bg-indigo-50 hover:bg-indigo-100', + content: 'bg-indigo-50/50', + border: 'border-areia/30', +} +``` + +## Collapsible Section + +### Collapsible Section Component + +```tsx +import { useState } from 'react' +import { ChevronDown, ChevronUp } from 'lucide-react' +import { sectionStyles } from '@/styles' +import { cn } from '@/utils/cn' + +function CollapsibleSection({ variant = 'default', title, children }) { + const [isOpen, setIsOpen] = useState(false) + const styles = sectionStyles[variant] + + return ( +
+ + {isOpen && ( +
+ {children} +
+ )} +
+ ) +} +``` + +### Usage + +```tsx + +
+ {/* Content */} +
+
+``` + +## Section with Icon + +### Header with Icon + +```tsx + +``` + +## Section with Badge + +### Header with Counter + +```tsx + +``` + +## Section with Actions + +### Header with Buttons + +```tsx + +
+ +``` + +## Multiple Sections + +### Section List + +```tsx +
+ + ... + + + ... + + + ... + +
+``` + +## Section Expanded by Default + +### Initially Open Section + +```tsx +function CollapsibleSection({ variant = 'default', title, children, defaultOpen = false }) { + const [isOpen, setIsOpen] = useState(defaultOpen) + // ... +} +``` + +### Usage + +```tsx + + ... + +``` + +## Section with Custom Content + +### Content with Custom Padding + +```tsx +
+ {children} +
+``` + +## Nested Section + +### Sections Within Sections + +```tsx + +
+ + ... + +
+
+``` + +## Section with Validation State + +### Validated Section + +```tsx +
+ + ... +
+``` + +## DS-14. Temas (Light / Dark) + +## Overview + +The Shema Design System officially supports two visual modes: **Light Mode** ("Paper & Ink") and **Dark Mode** ("Night & Earth"). + +## Light Mode — "Paper & Ink" + +**Metaphor:** Printed paper. + +### Colors + +```typescript +// Base colors +background: '#F6F5EB' // Shema White (Cream) - Main background +surface: '#FFFFFF' // Pure White - Elevated surfaces +primaryText: '#0A0703' // Shema Black - Primary text +secondaryText: '#3F3E20' // Shema Dark Green - Secondary text +borders: '#C5C29F' // Sand - Borders +``` + +### CSS Variables + +```css +:root { + --background: 48 29% 95%; /* Shema White (Cream) */ + --foreground: 30 43% 3%; /* Shema Black */ + --card: 0 0% 100%; /* Pure White */ + --card-foreground: 30 43% 3%; /* Shema Black */ + --primary: 22 97% 38%; /* Telha */ + --primary-foreground: 48 29% 95%; /* Shema White */ + --secondary: 167 19% 60%; /* Blue */ + --secondary-foreground: 30 43% 3%; /* Shema Black */ + --muted: 53 19% 70%; /* Sand */ + --muted-foreground: 60 34% 19%; /* Dark Green */ + --accent: 167 19% 60%; /* Blue */ + --accent-foreground: 30 43% 3%; /* Shema Black */ + --destructive: 22 97% 38%; /* Telha */ + --destructive-foreground: 48 29% 95%; /* Shema White */ + --border: 53 19% 70%; /* Sand */ + --input: 53 19% 70%; /* Sand */ + --ring: 22 97% 38%; /* Telha */ + --radius: 0.5rem; +} +``` + +### Body Application + +```css +body { + background: hsl(var(--background)); /* Shema Cream, not pure white */ + color: hsl(var(--foreground)); /* Shema Black, softer than absolute black */ + font-family: 'Montserrat', system-ui, sans-serif; +} +``` + +> [!IMPORTANT] +> Pure white must never be used as a page background. Use Shema White / Cream (#F6F5EB) to simulate paper and provide visual comfort. + +## Dark Mode — "Night & Earth" + +**Metaphor:** Organic night environment. + +### Colors + +```typescript +// Base colors +background: '#0A0703' // Shema Black - Main background +surface: '#0A0703' // Shema Black with visible borders +highlightSurface: '#3F3E20' // Dark Green - Highlighted surfaces +primaryText: '#F6F5EB' // Shema White (Cream) - Primary text +secondaryText: '#C5C29F' // Sand - Secondary text +borders: '#3F3E20' // Dark Green - Borders +``` + +### Web CSS Variables (Proposed) + +```css +[data-theme="dark"] { + --background: 30 43% 3%; /* Shema Black */ + --foreground: 48 29% 95%; /* Shema White (Cream) */ + --card: 30 43% 3%; /* Shema Black */ + --card-foreground: 48 29% 95%; /* Shema White */ + --primary: 22 97% 38%; /* Telha */ + --primary-foreground: 48 29% 95%; /* Shema White */ + --secondary: 167 19% 60%; /* Blue */ + --secondary-foreground: 48 29% 95%; /* Shema White */ + --muted: 60 34% 19%; /* Dark Green */ + --muted-foreground: 53 19% 70%; /* Sand */ + --border: 60 34% 19%; /* Dark Green */ + --input: 60 34% 19%; /* Dark Green */ + --ring: 22 97% 38%; /* Telha */ +} +``` + +## Strict Restrictions + +- Do **NOT** use generic neutral greys. +- Do **NOT** approximate Material Design dark palettes. +- Dark interfaces must be composed **only** using Shema palette colors. + +Failure to follow these rules must be treated as a design defect, not a stylistic preference. + +## Theme Switching + +### Implementation (Future) + +#### 1. Add Theme Toggle + +```tsx +import { useState, useEffect } from 'react' + +function ThemeToggle() { + const [theme, setTheme] = useState<'light' | 'dark'>('light') + + useEffect(() => { + const root = document.documentElement + if (theme === 'dark') { + root.setAttribute('data-theme', 'dark') + } else { + root.removeAttribute('data-theme') + } + }, [theme]) + + return ( + + ) +} +``` + +#### 2. Persist Preference + +```tsx +useEffect(() => { + const savedTheme = localStorage.getItem('theme') as 'light' | 'dark' | null + if (savedTheme) { + setTheme(savedTheme) + } else { + const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches + setTheme(prefersDark ? 'dark' : 'light') + } +}, []) + +useEffect(() => { + localStorage.setItem('theme', theme) +}, [theme]) +``` + +#### 3. Update Components + +All components should use CSS variables or Tailwind classes that support both themes: + +```tsx +// ✅ Good - uses CSS variables +
+ ... +
+ +// ✅ Good - uses Tailwind with dark: +
+ ... +
+ +// ❌ Avoid - hardcoded colors +
+ ... +
+``` + +## System Preference + +### Detect User Preference + +```tsx +useEffect(() => { + const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)') + + const handleChange = (e: MediaQueryListEvent) => { + setTheme(e.matches ? 'dark' : 'light') + } + + mediaQuery.addEventListener('change', handleChange) + return () => mediaQuery.removeEventListener('change', handleChange) +}, []) +``` + +## Theme Transitions + +### Smooth Animation + +```css +* { + transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; +} +``` + +## Accessibility + +### Contrast in Both Themes + +- **Light Theme**: Minimum contrast of 4.5:1 for normal text +- **Dark Theme**: Minimum contrast of 4.5:1 for normal text +- Both themes must pass WCAG AA tests + +### Reduced Motion Preference + +```css +@media (prefers-reduced-motion: reduce) { + * { + transition: none !important; + } +} +``` \ No newline at end of file