|
| 1 | +# Dr G Lab Trauma-informed Design System - Component Documentation |
| 2 | + |
| 3 | +This document provides a comprehensive overview of all **implemented and production-ready** trauma-informed components for Dr G Lab's certification courses, organized according to atomic design methodology. |
| 4 | + |
| 5 | +## Implementation Status: ✅ COMPLETE |
| 6 | + |
| 7 | +All components listed below are fully implemented, tested, and available in `src/samples.html` and individual component files. |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +1. [Atoms (Base Components)](#atoms-base-components) |
| 12 | +2. [Molecules (Compound Components)](#molecules-compound-components) |
| 13 | +3. [Organisms (Complex Components)](#organisms-complex-components) |
| 14 | +4. [Templates (Page Layouts)](#templates-page-layouts) |
| 15 | +5. [Trauma-Informed Specialty Components](#trauma-informed-specialty-components) |
| 16 | +6. [Implementation Examples](#implementation-examples) |
| 17 | + |
| 18 | +## Atoms (Base Components) |
| 19 | + |
| 20 | +### ✅ Buttons |
| 21 | +All button components are fully implemented with trauma-informed interactions. |
| 22 | + |
| 23 | +- **Emergency Exit Button** |
| 24 | + - Location: Always visible, bottom-right positioning |
| 25 | + - Classes: `fixed bottom-4 right-4 bg-rhodochrosite-rose-600 text-selenite-white-50 px-md py-sm rounded-md focus:ring-2 focus:ring-rhodochrosite-rose-300 focus:outline-none transition-all duration-300` |
| 26 | + - Features: Single-click activation, no confirmation dialogs, high contrast, clear focus state |
| 27 | + - Trauma-informed: Always accessible, immediate escape from triggering content, visible keyboard navigation |
| 28 | + |
| 29 | +- **Primary Button** |
| 30 | + - Classes: `bg-chrysocolla-green text-selenite-white-50 px-md py-sm rounded-md hover:bg-chrysocolla-green-600 focus:ring-2 focus:ring-chrysocolla-green-300 focus:outline-none transition-all duration-300` |
| 31 | + - Features: Gentle transitions, clear feedback, consistent styling, visible focus state |
| 32 | + - Trauma-informed: Calm color palette, predictable behavior, supportive disabled states, accessible keyboard navigation |
| 33 | + |
| 34 | +- **Secondary Button** |
| 35 | + - Classes: `border-2 border-chrysocolla-green text-chrysocolla-green px-md py-sm rounded-md hover:bg-chrysocolla-green-50 focus:ring-2 focus:ring-chrysocolla-green-200 focus:outline-none transition-all duration-300` |
| 36 | + - Features: Clear hierarchy, gentle hover states, visible focus state |
| 37 | + - Trauma-informed: Non-pressuring visual weight, supportive messaging, accessible keyboard navigation |
| 38 | + |
| 39 | +- **Tertiary Button** |
| 40 | + - Classes: `font-montserrat text-small text-chrysocolla-green hover:text-chrysocolla-green-600 underline focus:ring-2 focus:ring-chrysocolla-green-100 focus:outline-none transition-all duration-300` |
| 41 | + - Features: Minimal styling for optional actions, visible focus state |
| 42 | + - Trauma-informed: Low visual pressure, validates user choice to engage or not, accessible keyboard navigation |
| 43 | + |
| 44 | +### ✅ Form Elements |
| 45 | +All form components include trauma-informed validation and feedback. |
| 46 | + |
| 47 | +- **Text Input** |
| 48 | + - Classes: `w-full border border-grey-300 rounded-md px-md py-sm focus:ring-2 focus:ring-azurite-blue-300` |
| 49 | + - Features: Gentle focus states, supportive error messaging, clear labels |
| 50 | + - Trauma-informed: Non-judgmental validation, clear expectations |
| 51 | + |
| 52 | +- **Checkbox** |
| 53 | + - Classes: `h-4 w-4 rounded border-grey-300 text-chrysocolla-green focus:ring-chrysocolla-green-200` |
| 54 | + - Features: Large touch targets, clear visual feedback |
| 55 | + - Trauma-informed: Easy to use, supports user choice and control |
| 56 | + |
| 57 | +- **Radio Button** |
| 58 | + - Classes: `h-4 w-4 text-chrysocolla-green focus:ring-chrysocolla-green-200` |
| 59 | + - Features: Clear grouping, card-style variants available |
| 60 | + - Trauma-informed: Predictable behavior, clear current selection |
| 61 | + |
| 62 | +- **Select Dropdown** |
| 63 | + - Classes: `w-full border border-grey-300 rounded-md px-md py-sm appearance-none bg-select-arrow` |
| 64 | + - Features: Custom styling, clear option hierarchy |
| 65 | + - Trauma-informed: Non-overwhelming option lists, clear current state |
| 66 | + |
| 67 | +### ✅ Typography |
| 68 | +Complete typography system with semantic hierarchy. |
| 69 | + |
| 70 | +- **Headings (H1-H6)** |
| 71 | + - Classes: `font-playfair font-bold text-h1-mobile md:text-h1-tablet lg:text-h1-desktop text-azurite-blue-900` |
| 72 | + - Features: Responsive scaling, consistent hierarchy |
| 73 | + - Trauma-informed: Clear information hierarchy, comfortable reading |
| 74 | + |
| 75 | +- **Body Text** |
| 76 | + - Classes: `font-montserrat text-grey-800 text-body` |
| 77 | + - Features: Optimal line length, comfortable line spacing |
| 78 | + - Trauma-informed: Easy reading, reduces cognitive load |
| 79 | + |
| 80 | +- **Captions & Labels** |
| 81 | + - Classes: `font-montserrat text-caption text-grey-600` |
| 82 | + - Features: Supporting text without visual competition |
| 83 | + - Trauma-informed: Clear context without overwhelming primary content |
| 84 | + |
| 85 | +### ✅ Status Indicators |
| 86 | + |
| 87 | +- **Category Badges** |
| 88 | + - Classes: `bg-azurite-blue-50 text-azurite-blue-600 px-sm py-xs rounded-md text-caption` |
| 89 | + - Features: Content categorization, color-coded systems |
| 90 | + - Trauma-informed: Clear content expectations, gentle visual indicators |
| 91 | + |
| 92 | +- **Progress Bars** |
| 93 | + - Classes: `h-2 bg-grey-200 rounded-full overflow-hidden` |
| 94 | + - Features: Visual progress indication, supportive messaging |
| 95 | + - Trauma-informed: Celebrates progress, no time pressure, encouraging feedback |
| 96 | + |
| 97 | +- **Status Badges** |
| 98 | + - Classes: Variable based on status (completed, in-progress, not-started) |
| 99 | + - Features: Clear completion states, gentle color coding |
| 100 | + - Trauma-informed: Non-judgmental status indicators, celebrates all progress |
| 101 | + |
| 102 | +## Molecules (Compound Components) |
| 103 | + |
| 104 | +### ✅ Content Warnings |
| 105 | +Comprehensive content warning system. |
| 106 | + |
| 107 | +- **Content Warning Panel** |
| 108 | + - Classes: `bg-rhodochrosite-rose-50 border-l-4 border-rhodochrosite-rose p-md rounded-r-md` |
| 109 | + - Features: Clear warning text, multiple engagement options, skip alternatives |
| 110 | + - Trauma-informed: Gives users control, validates all choices, clear alternatives |
| 111 | + |
| 112 | +- **Supportive Messages** |
| 113 | + - Classes: `bg-azurite-blue-50 border border-azurite-blue-100 rounded-md p-md` |
| 114 | + - Features: Encouraging feedback, non-judgmental language |
| 115 | + - Trauma-informed: Positive reinforcement, validates user experience |
| 116 | + |
| 117 | +### ✅ Form Groups |
| 118 | + |
| 119 | +- **Input with Label** |
| 120 | + - Features: Accessible labeling, helper text, validation messaging |
| 121 | + - Trauma-informed: Clear expectations, supportive error messages, optional field indicators |
| 122 | + |
| 123 | +- **Checkbox Groups** |
| 124 | + - Features: Clear grouping, consistent spacing, accessible markup |
| 125 | + - Trauma-informed: Supports user choice, clear what each option means |
| 126 | + |
| 127 | +### ✅ Navigation Components |
| 128 | + |
| 129 | +- **Breadcrumb Navigation** |
| 130 | + - Classes: `flex items-center space-x-sm text-small` |
| 131 | + - Features: Clear path indication, current location highlighting |
| 132 | + - Trauma-informed: Helps orientation, predictable navigation |
| 133 | + |
| 134 | +- **Course Navigation Sidebar** |
| 135 | + - Features: Module listing, progress indication, learning preferences |
| 136 | + - Trauma-informed: Clear course structure, user control over experience |
| 137 | + |
| 138 | +## Organisms (Complex Components) |
| 139 | + |
| 140 | +### ✅ Course Components |
| 141 | +Complete learning platform implementation. |
| 142 | + |
| 143 | +- **Core Course Card** |
| 144 | + - Location: `src/components/organisms/course/core-course-card.html` |
| 145 | + - Features: Course overview, module preview, clear navigation |
| 146 | + - Trauma-informed: Self-paced messaging, clear expectations, gentle visual design |
| 147 | + |
| 148 | +- **Module Card** |
| 149 | + - Location: `src/components/organisms/course/module-card.html` |
| 150 | + - Features: Progress tracking, content preview, status indicators |
| 151 | + - Trauma-informed: Non-pressuring progress indicators, time estimates, pause options |
| 152 | + |
| 153 | +- **Specialization Course Card** |
| 154 | + - Features: Prerequisites clearly stated, different visual treatment |
| 155 | + - Trauma-informed: Clear skill requirements, no pressure to advance |
| 156 | + |
| 157 | +- **Progress Tracker** |
| 158 | + - Location: `src/components/organisms/course/progress-tracker.html` |
| 159 | + - Features: Visual progress bars, encouraging messaging, module status |
| 160 | + - Trauma-informed: Celebrates small wins, no time pressure, supportive language |
| 161 | + |
| 162 | +- **Quiz Component** |
| 163 | + - Features: Multiple attempts, hints available, skip options |
| 164 | + - Trauma-informed: Learning-focused, not testing-focused, supportive feedback |
| 165 | + |
| 166 | +- **Certificate Component** |
| 167 | + - Features: Achievement recognition, download options, sharing controls |
| 168 | + - Trauma-informed: Celebrates accomplishment, user controls sharing |
| 169 | + |
| 170 | +### ✅ Content Components |
| 171 | + |
| 172 | +- **Blog Card** |
| 173 | + - Location: `src/components/organisms/blog/blog-card.html` |
| 174 | + - Features: Content warnings, author information, reading time |
| 175 | + - Trauma-informed: Content intensity indicators, clear expectations |
| 176 | + |
| 177 | +- **Project Card** |
| 178 | + - Features: Case study previews, categorization, gentle hover effects |
| 179 | + - Trauma-informed: Clear content disclosure, no sudden movements |
| 180 | + |
| 181 | +- **Service Card** |
| 182 | + - Features: Service descriptions, transparent pricing, clear inclusions |
| 183 | + - Trauma-informed: No high-pressure CTAs, clear expectations |
| 184 | + |
| 185 | +- **Toolkit Card** |
| 186 | + - Features: Resource downloads, file format specifications, content preview |
| 187 | + - Trauma-informed: Preview before download, clear file information |
| 188 | + |
| 189 | +### ✅ Learning Interface |
| 190 | + |
| 191 | +- **Main Learning Interface** |
| 192 | + - Features: Video controls, content alternatives, sidebar navigation |
| 193 | + - Trauma-informed: Emergency exit, content warnings, break reminders |
| 194 | + |
| 195 | +- **Video Player Controls** |
| 196 | + - Play/Pause (Primary): `bg-chrysocolla-green text-selenite-white-50 px-md py-sm rounded-md hover:bg-chrysocolla-green-600 focus:ring-2 focus:ring-chrysocolla-green-300 focus:outline-none transition-all duration-300` |
| 197 | + - Speed Controls (Secondary): `border-2 border-chrysocolla-green text-chrysocolla-green px-md py-sm rounded-md hover:bg-chrysocolla-green-50 focus:ring-2 focus:ring-chrysocolla-green-200 focus:outline-none transition-all duration-300` |
| 198 | + - Show Transcript (Tertiary): `font-montserrat text-small text-chrysocolla-green hover:text-chrysocolla-green-600 underline focus:ring-2 focus:ring-chrysocolla-green-100 focus:outline-none transition-all duration-300` |
| 199 | + |
| 200 | +## Templates (Page Layouts) |
| 201 | + |
| 202 | +### ✅ Authentication Templates |
| 203 | +Complete authentication flow. |
| 204 | + |
| 205 | +- **Login Template** |
| 206 | + - Features: Simple form, password reset link, supportive messaging |
| 207 | + - Trauma-informed: Non-judgmental error messages, clear help options |
| 208 | + |
| 209 | +- **Password Reset Template** |
| 210 | + - Features: Reassuring messaging, clear instructions, support contact |
| 211 | + - Trauma-informed: Validates that forgetting is normal, supportive tone |
| 212 | + |
| 213 | +- **Account Creation Template** |
| 214 | + - Features: Minimal required fields, clear privacy information |
| 215 | + - Trauma-informed: Respects user privacy, clear data usage |
| 216 | + |
| 217 | +- **Course Registration Template** |
| 218 | + - Features: Step-by-step process, save progress, clear pricing |
| 219 | + - Trauma-informed: No time pressure, clear expectations, privacy respected |
| 220 | + |
| 221 | +### ✅ Learning Templates |
| 222 | + |
| 223 | +- **Course Grid Templates** |
| 224 | + - Multiple layout variations: Light, dark, gradient, mixed styles |
| 225 | + - Features: Filtering, consistent card layouts, clear categorization |
| 226 | + - Trauma-informed: Content intensity filtering, clear course expectations |
| 227 | + |
| 228 | +- **Learning Interface Template** |
| 229 | + - Features: Full learning environment with safety features integrated |
| 230 | + - Trauma-informed: Emergency exit, break reminders, content alternatives |
| 231 | + |
| 232 | +## Trauma-Informed Specialty Components |
| 233 | + |
| 234 | +### ✅ Safety Features |
| 235 | + |
| 236 | +- **Emergency Exit Button** |
| 237 | + - Always visible, single-click escape, no confirmation dialogs |
| 238 | + - Provides immediate safety for users experiencing distress |
| 239 | + |
| 240 | +- **Content Intensity Controls** |
| 241 | + - User-adjustable content density, warning preferences, format alternatives |
| 242 | + - Gives users complete control over their content experience |
| 243 | + |
| 244 | +- **Emotional Check-in Component** |
| 245 | + - Feeling scale, recommendations based on selection, grounding exercise access |
| 246 | + - Supports user emotional awareness and regulation |
| 247 | + |
| 248 | +- **Grounding Exercise Integration** |
| 249 | + - 5-4-3-2-1 sensory technique, step-by-step guidance, accessible anytime |
| 250 | + - Provides immediate emotional regulation support |
| 251 | + |
| 252 | +- **Support Resources Panel** |
| 253 | + - Crisis resources, course support, grounding techniques |
| 254 | + - Quick access to help when needed |
| 255 | + |
| 256 | +### ✅ Content Management Features |
| 257 | + |
| 258 | +- **Alternative Content Formats** |
| 259 | + - Video, text, audio options for all content |
| 260 | + - Respects different learning preferences and needs |
| 261 | + |
| 262 | +- **Content Warning System** |
| 263 | + - Detailed warnings, content alternatives, skip options |
| 264 | + - Comprehensive protection for sensitive content |
| 265 | + |
| 266 | +- **Break Reminders** |
| 267 | + - Session time tracking, gentle break suggestions |
| 268 | + - Supports healthy engagement patterns |
| 269 | + |
| 270 | +## Implementation Examples |
| 271 | + |
| 272 | +### Basic Component Usage |
| 273 | + |
| 274 | +```html |
| 275 | +<!-- Emergency Exit - Always include --> |
| 276 | +<button class="fixed top-4 right-4 bg-rhodochrosite-rose-600 text-selenite-white-50 px-md py-sm rounded-md"> |
| 277 | + Exit to Safe Space ✕ |
| 278 | +</button> |
| 279 | + |
| 280 | +<!-- Content Warning --> |
| 281 | +<div class="bg-rhodochrosite-rose-50 border-l-4 border-rhodochrosite-rose p-md rounded-r-md mb-lg"> |
| 282 | + <p class="font-montserrat font-medium text-grey-800 mb-xs">Content Notice</p> |
| 283 | + <p class="font-montserrat text-small text-grey-700">This lesson contains discussion of...</p> |
| 284 | + <div class="mt-md flex gap-sm"> |
| 285 | + <button class="bg-selenite-white-50 text-grey-700 px-md py-xs rounded-md border">View summary</button> |
| 286 | + <button class="bg-selenite-white-50 text-grey-700 px-md py-xs rounded-md border">Skip section</button> |
| 287 | + </div> |
| 288 | +</div> |
| 289 | + |
| 290 | +<!-- Primary Button --> |
| 291 | +<button class="bg-chrysocolla-green text-selenite-white-50 px-md py-sm rounded-md hover:bg-chrysocolla-green-600"> |
| 292 | + Continue Learning |
| 293 | +</button> |
| 294 | +``` |
| 295 | + |
| 296 | +### Complete Course Card |
| 297 | + |
| 298 | +```html |
| 299 | +<div class="bg-selenite-white-50 border border-grey-200 rounded-lg shadow-soft p-lg hover:shadow transition-all duration-300"> |
| 300 | + <div class="mb-sm"> |
| 301 | + <span class="bg-azurite-blue-50 text-azurite-blue-600 px-sm py-xs rounded-md text-caption">Core Course</span> |
| 302 | + </div> |
| 303 | + <h3 class="font-playfair font-bold text-azurite-blue-900 text-h3-mobile mb-sm"> |
| 304 | + Introduction to Trauma-Informed Design |
| 305 | + </h3> |
| 306 | + <p class="font-montserrat text-grey-800 text-body mb-lg"> |
| 307 | + This foundational course introduces trauma-informed design principles... |
| 308 | + </p> |
| 309 | + <a href="#" class="inline-block bg-chrysocolla-green text-selenite-white-50 px-md py-sm rounded-md hover:bg-chrysocolla-green-600 focus:ring-2 focus:ring-chrysocolla-green-300 focus:outline-none transition-all duration-300 text-center w-full"> |
| 310 | + Explore Course |
| 311 | + </a> |
| 312 | +</div> |
| 313 | +``` |
| 314 | + |
| 315 | +## Browser Support & Testing |
| 316 | + |
| 317 | +- ✅ **Chrome 90+**: Fully tested and supported |
| 318 | +- ✅ **Firefox 88+**: Fully tested and supported |
| 319 | +- ✅ **Safari 14+**: Fully tested and supported |
| 320 | +- ✅ **Edge 90+**: Fully tested and supported |
| 321 | + |
| 322 | +## Accessibility Compliance |
| 323 | + |
| 324 | +- ✅ **WCAG 2.2 AA**: All components tested and compliant |
| 325 | +- ✅ **Screen Readers**: Compatible with NVDA, JAWS, VoiceOver |
| 326 | +- ✅ **Keyboard Navigation**: Full keyboard accessibility |
| 327 | +- ✅ **Color Contrast**: All text meets minimum contrast requirements |
| 328 | +- ✅ **Focus Management**: Clear focus indicators throughout |
| 329 | + |
| 330 | +## Performance |
| 331 | + |
| 332 | +- ✅ **CSS Size**: Optimized Tailwind build |
| 333 | +- ✅ **Load Time**: Fast loading with minimal dependencies |
| 334 | +- ✅ **Animations**: Respects user motion preferences |
| 335 | +- ✅ **Images**: Lazy loading and alt text support |
| 336 | + |
| 337 | +## Contributing |
| 338 | + |
| 339 | +When contributing to this component library: |
| 340 | + |
| 341 | +1. **Maintain Trauma-Informed Principles**: Never remove safety features |
| 342 | +2. **Test Accessibility**: Verify WCAG compliance |
| 343 | +3. **Document Changes**: Update this documentation |
| 344 | +4. **User Test**: Validate with diverse users including trauma survivors |
| 345 | +5. **Consistent Styling**: Follow established design tokens |
0 commit comments