+```
+
+✅ **Group related inputs:**
+
+```html
+
+```
+
+### 5. Color and Contrast
+
+✅ **Minimum contrast ratios (WCAG AA):**
+
+- **Normal text**: 4.5:1
+- **Large text (18pt+ or 14pt+ bold)**: 3:1
+- **UI components and graphics**: 3:1
+
+```javascript
+// Test contrast ratios
+function testColorContrast() {
+ var button = document.querySelector('.firebaseui-id-submit');
+ var bgColor = getComputedStyle(button).backgroundColor;
+ var textColor = getComputedStyle(button).color;
+
+ var contrastRatio = calculateContrastRatio(bgColor, textColor);
+
+ // Assert minimum contrast ratio
+ assertTrue(contrastRatio >= 4.5,
+ 'Contrast ratio ' + contrastRatio + ' is below minimum 4.5:1');
+}
+```
+
+✅ **Don't rely on color alone:**
+
+```html
+
+
+ ⚠
+ Invalid email
+
+
+
+
Invalid email
+```
+
+### 6. Images and Icons
+
+✅ **Provide alt text for images:**
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+### 7. Dialogs and Modals
+
+✅ **Proper dialog implementation:**
+
+```html
+
+
+
Confirm Sign Out
+
Are you sure you want to sign out?
+
+
+
+
+```
+
+```javascript
+function testDialogAccessibility() {
+ // When dialog opens
+ dialog.show();
+
+ // Focus should move to dialog
+ assertTrue(dialog.contains(document.activeElement));
+
+ // Focus should be trapped in dialog
+ var lastElement = dialog.querySelector('button:last-child');
+ lastElement.focus();
+ simulateKeyPress(lastElement, KeyCodes.TAB);
+ var firstElement = dialog.querySelector('button:first-child');
+ assertEquals(firstElement, document.activeElement);
+
+ // Esc should close dialog
+ simulateKeyPress(document.activeElement, KeyCodes.ESC);
+ assertFalse(dialog.isShown());
+
+ // Focus should return to trigger element
+ assertEquals(triggerButton, document.activeElement);
+}
+```
+
+### 8. Loading and Processing States
+
+✅ **Announce loading states:**
+
+```html
+
+
+ Loading, please wait...
+
+
+
+
+
+ 50% complete
+
+```
+
+### 9. Time Limits
+
+✅ **Provide warnings and extensions for time limits:**
+
+```javascript
+function testSessionTimeout() {
+ // Warn user before timeout
+ showTimeoutWarning(60); // 60 seconds before timeout
+
+ // Provide option to extend session
+ var extendButton = document.querySelector('.extend-session');
+ assertNotNull(extendButton);
+
+ // Verify warning is announced to screen readers
+ var warning = document.querySelector('[role="alert"]');
+ assertTrue(warning.textContent.indexOf('session will expire') !== -1);
+}
+```
+
+### 10. Link Accessibility
+
+✅ **Descriptive link text:**
+
+```html
+
+Get help with sign-in
+
+
+Click here
+
+
+
+ Terms of Service
+ (opens in new window)
+
+
+
+
+ Privacy Policy
+ (opens in new window)
+
+```
+
+## Testing Workflow
+
+### 1. Automated Tests
+
+Run automated tests on every build:
+
+```bash
+# Run accessibility tests
+npm run test:a11y
+
+# Run with specific WCAG level
+npm run test:a11y -- --level AA
+```
+
+### 2. Manual Keyboard Testing
+
+Test all user flows with keyboard only:
+
+1. **Sign-up flow**:
+ - Tab through all fields
+ - Fill out form using keyboard
+ - Submit using Enter/Space
+ - Navigate error messages
+
+2. **Sign-in flow**:
+ - Tab to email/password fields
+ - Tab to provider buttons
+ - Activate buttons with Enter/Space
+
+3. **Password reset**:
+ - Navigate reset form
+ - Submit and navigate confirmation
+
+### 3. Screen Reader Testing
+
+Test with at least one screen reader:
+
+1. Enable screen reader (NVDA/VoiceOver/JAWS)
+2. Navigate to sign-in page
+3. Listen to page announcement
+4. Navigate form fields
+5. Listen to field labels
+6. Trigger validation errors
+7. Listen to error announcements
+8. Complete sign-in flow
+
+### 4. Color Contrast Testing
+
+1. Use browser DevTools
+2. Check all text against backgrounds
+3. Check button states (hover, focus, disabled)
+4. Check error messages
+5. Check links
+
+## Test File Template
+
+```javascript
+/*
+ * Copyright 2025 Google Inc. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0
+ */
+
+/**
+ * @fileoverview Accessibility tests for [component name]
+ */
+
+goog.provide('firebaseui.auth.a11y.[componentName]Test');
+goog.setTestOnly('firebaseui.auth.a11y.[componentName]Test');
+
+goog.require('[component under test]');
+goog.require('goog.testing.jsunit');
+
+
+function testKeyboardNavigation() {
+ // Test tab order
+ // Test Enter/Space activation
+ // Test Esc to close
+}
+
+
+function testAriaLabels() {
+ // Verify all inputs have labels
+ // Verify aria-required
+ // Verify aria-invalid
+ // Verify aria-describedby for errors
+}
+
+
+function testScreenReaderAnnouncements() {
+ // Test role="alert" for errors
+ // Test aria-live for dynamic content
+ // Test status messages
+}
+
+
+function testFocusManagement() {
+ // Test focus indicators
+ // Test focus trap in modals
+ // Test focus return after modal close
+}
+
+
+function testColorContrast() {
+ // Test text contrast ratios
+ // Test button contrast
+ // Test error message contrast
+}
+```
+
+## Common Accessibility Issues and Fixes
+
+### Issue 1: Missing Form Labels
+
+**Problem:**
+```html
+
+```
+
+**Fix:**
+```html
+
+
+```
+
+### Issue 2: Keyboard Trap
+
+**Problem:**
+```javascript
+// Modal with no Esc handler
+dialog.show();
+```
+
+**Fix:**
+```javascript
+dialog.show();
+dialog.addEventListener('keydown', function(e) {
+ if (e.keyCode === KeyCodes.ESC) {
+ dialog.close();
+ }
+});
+```
+
+### Issue 3: Low Contrast
+
+**Problem:**
+```css
+.button {
+ background: #bbb;
+ color: #999; /* Contrast ratio: 1.5:1 - FAIL */
+}
+```
+
+**Fix:**
+```css
+.button {
+ background: #1976d2;
+ color: #ffffff; /* Contrast ratio: 6.3:1 - PASS */
+}
+```
+
+### Issue 4: No Error Announcement
+
+**Problem:**
+```html
+
Invalid email
+```
+
+**Fix:**
+```html
+
+ Invalid email
+
+```
+
+### Issue 5: Unclear Button Purpose
+
+**Problem:**
+```html
+
+```
+
+**Fix:**
+```html
+
+```
+
+## Screen Reader Only Content
+
+Use this CSS class for content that should only be announced by screen readers:
+
+```css
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border-width: 0;
+}
+```
+
+```html
+
+```
+
+## Resources
+
+- [WCAG 2.1 Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)
+- [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/)
+- [WebAIM](https://webaim.org/)
+- [A11Y Project](https://www.a11yproject.com/)
+- [axe DevTools](https://www.deque.com/axe/)
+- [Color Contrast Checker](https://webaim.org/resources/contrastchecker/)
+
+## Conclusion
+
+Accessibility is everyone's responsibility. By following these guidelines and testing thoroughly, we can ensure FirebaseUI Web is usable by everyone, regardless of their abilities.
+
+**Remember: If it's not accessible, it's not done.**
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 407252b40..78862fa0a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,43 +1,688 @@
-Want to contribute? Great! First, read this page (including the small print at
-the end).
+# Contributing to FirebaseUI Web
-### Before you contribute
+Thank you for your interest in contributing to FirebaseUI Web! We appreciate your help in making authentication and UI components easier for Firebase developers worldwide. This document provides comprehensive guidelines for contributing to the project.
-Before we can use your code, you must sign the [Google Individual Contributor
-License Agreement](https://cla.developers.google.com/about/google-individual)
-(CLA), which you can do online. The CLA is necessary mainly because you own the
-copyright to your changes, even after your contribution becomes part of our
-codebase, so we need your permission to use and distribute your code. We also
-need to be sure of various other things—for instance that you'll tell us if you
-know that your code infringes on other people's patents. You don't have to sign
-the CLA until after you've submitted your code for review and a member has
-approved it, but you must do it before we can put your code into our codebase.
+## Table of Contents
-### Adding new features
+1. [Code of Conduct](#code-of-conduct)
+2. [Getting Started](#getting-started)
+3. [Development Setup](#development-setup)
+4. [Project Structure](#project-structure)
+5. [Making Changes](#making-changes)
+6. [Testing](#testing)
+7. [Code Style and Standards](#code-style-and-standards)
+8. [Commit Messages](#commit-messages)
+9. [Pull Request Process](#pull-request-process)
+10. [Documentation](#documentation)
+11. [Performance Considerations](#performance-considerations)
+12. [Security Guidelines](#security-guidelines)
+13. [Browser Compatibility](#browser-compatibility)
+14. [Troubleshooting](#troubleshooting)
-Before you start working on a larger contribution, you should get in touch with
-us first through the issue tracker with your idea so that we can help out and
-possibly guide you. Coordinating up front makes it much easier to avoid
-frustration later on.
+## Code of Conduct
-If this has been discussed in an issue, make sure to mention the issue number.
-If not, go file an issue about this to make sure this is a desirable change.
+### Our Commitment
-If this is a new feature please co-ordinate with someone on
-[FirebaseUI-Android](https://github.com/firebase/FirebaseUI-Android) and someone
-on [FirebaseUI-iOS](https://github.com/firebase/FirebaseUI-iOS)
-to make sure that we can implement this on all platforms and maintain feature
-parity. Feature parity (where it makes sense) is a strict requirement for
-feature development in FirebaseUI.
+We are committed to providing a welcoming and inspiring community for all. Please read and adhere to our Code of Conduct:
-### Code reviews
+- **Be Respectful**: Treat all community members with respect and courtesy. Disagreements are natural, but they should be handled professionally and constructively.
+- **Be Inclusive**: We welcome contributions from people of all backgrounds and experience levels. Ensure your language and behavior are inclusive.
+- **Be Professional**: Keep discussions focused on the project and maintain a professional tone. Harassment, discrimination, or offensive behavior will not be tolerated.
+- **Report Issues**: If you witness or experience unacceptable behavior, please report it to the Firebase team through appropriate channels.
-All submissions, including submissions by project members, require review. We
-use Github pull requests for this purpose. Please refer to the
-[Style Guide](STYLEGUIDE.md) and ensure you respect it before submitting a PR.
+## Getting Started
-### The small print
+### Prerequisites
-Contributions made by corporations are covered by a different agreement than the
-one above, the [Software Grant and Corporate Contributor License
-Agreement](https://cla.developers.google.com/about/google-corporate).
+Before you begin contributing, ensure you have the following installed:
+
+- **Node.js**: Version 14.0.0 or higher (check with `node --version`)
+- **npm**: Version 6.0.0 or higher (check with `npm --version`)
+- **Git**: For version control (check with `git --version`)
+- **TypeScript**: Familiarity with TypeScript is helpful but not required
+- **Firebase Account**: A Firebase project for testing (create one at https://console.firebase.google.com/)
+
+### Forking and Cloning
+
+1. Fork the FirebaseUI Web repository by clicking the "Fork" button on GitHub.
+2. Clone your forked repository:
+ ```bash
+ git clone https://github.com/YOUR_USERNAME/firebaseui-web.git
+ cd firebaseui-web
+ ```
+3. Add the upstream repository as a remote:
+ ```bash
+ git remote add upstream https://github.com/firebase/firebaseui-web.git
+ ```
+
+### Verifying Your Setup
+
+After cloning, verify that everything is working:
+
+```bash
+npm install
+npm run build
+npm run test
+```
+
+If all commands execute successfully, you're ready to contribute!
+
+## Development Setup
+
+### Installation
+
+1. Install all dependencies:
+ ```bash
+ npm install
+ ```
+
+2. The project uses the following development tools:
+ - **TypeScript**: For static typing
+ - **Webpack**: For module bundling
+ - **Karma**: For test running
+ - **Jasmine**: For testing framework
+ - **ESLint**: For code linting
+ - **Prettier**: For code formatting
+
+### Building the Project
+
+To build the project:
+
+```bash
+npm run build
+```
+
+This compiles TypeScript files and generates distribution bundles in the `dist/` directory.
+
+### Development Server
+
+For development with hot reload:
+
+```bash
+npm run serve
+```
+
+This starts a development server where you can test your changes in real-time.
+
+### Available Scripts
+
+- `npm run build`: Build the project for production
+- `npm run serve`: Start development server
+- `npm run test`: Run the test suite
+- `npm run test:watch`: Run tests in watch mode
+- `npm run lint`: Lint code using ESLint
+- `npm run lint:fix`: Automatically fix linting issues
+- `npm run format`: Format code using Prettier
+- `npm run clean`: Remove build artifacts
+
+## Project Structure
+
+Understanding the project layout is essential for efficient contributions:
+
+```
+firebaseui-web/
+├── src/ # Source code
+│ ├── ui/ # UI components
+│ ├── auth/ # Authentication logic
+│ ├── storage/ # State and storage utilities
+│ └── [feature-modules]/ # Feature-specific modules
+├── dist/ # Compiled output (generated)
+├── npm-module/ # NPM package configuration
+├── public/ # Static assets
+├── test/ # Test files
+├── javascript/ # JavaScript examples and integrations
+├── .husky/ # Git hooks
+├── webpack.config.js # Webpack configuration
+├── tsconfig.json # TypeScript configuration
+├── karma.conf.js # Karma test runner config
+├── .eslintrc.js # ESLint configuration
+├── .prettierrc.js # Prettier configuration
+└── package.json # Project dependencies
+```
+
+### Key Directories
+
+**src/ui/**: Contains UI components like account chooser, password recovery, signin page, etc.
+
+**src/auth/**: Contains authentication-related utilities and managers.
+
+**test/**: Contains unit tests and integration tests for all features.
+
+**javascript/**: Contains example implementations and integrations.
+
+## Making Changes
+
+### Creating a Feature Branch
+
+Always create a new branch for your changes:
+
+```bash
+git checkout -b feature/your-feature-name
+```
+
+Use descriptive branch names that follow this pattern:
+- `feature/short-description` - For new features
+- `fix/short-description` - For bug fixes
+- `docs/short-description` - For documentation improvements
+- `refactor/short-description` - For refactoring
+- `test/short-description` - For test improvements
+- `perf/short-description` - For performance improvements
+
+### Development Workflow
+
+1. **Create your branch**: `git checkout -b feature/my-feature`
+2. **Make your changes**: Edit files as needed
+3. **Run tests locally**: `npm run test`
+4. **Run linter**: `npm run lint`
+5. **Format code**: `npm run format`
+6. **Commit your changes**: Follow commit message guidelines (see below)
+7. **Push to your fork**: `git push origin feature/my-feature`
+8. **Create a Pull Request**: Describe your changes clearly
+
+### Guidelines for Code Changes
+
+- **Keep changes focused**: Each pull request should address a single concern.
+- **Update related files**: If you modify a feature, update relevant tests and documentation.
+- **Avoid breaking changes**: Maintain backward compatibility unless explicitly approved.
+- **Add comments**: Document complex logic or non-obvious code.
+- **Remove dead code**: Don't commit commented-out code or unused imports.
+- **Follow existing patterns**: Maintain consistency with the codebase style.
+
+## Testing
+
+### Understanding the Test Suite
+
+The FirebaseUI Web project uses a comprehensive testing strategy:
+
+- **Unit Tests**: Test individual functions and components in isolation
+- **Integration Tests**: Test how components work together
+- **UI Tests**: Test user interface behavior and rendering
+
+### Writing Tests
+
+When adding new features, you must include tests. Follow these guidelines:
+
+1. **Test Location**: Place tests in the `test/` directory with the same structure as `src/`.
+2. **File Naming**: Name test files with `.test.ts` or `.spec.ts` suffix.
+3. **Test Structure**: Use Jasmine's describe/it syntax.
+
+Example test structure:
+
+```typescript
+describe('MyComponent', () => {
+ let component: MyComponent;
+
+ beforeEach(() => {
+ component = new MyComponent();
+ });
+
+ afterEach(() => {
+ // Cleanup
+ });
+
+ it('should initialize with default values', () => {
+ expect(component.value).toBe(0);
+ });
+
+ it('should update value when setValue is called', () => {
+ component.setValue(10);
+ expect(component.value).toBe(10);
+ });
+
+ it('should handle edge cases correctly', () => {
+ component.setValue(-1);
+ expect(component.value).toBe(0); // or your expected behavior
+ });
+});
+```
+
+### Running Tests
+
+```bash
+# Run all tests
+npm run test
+
+# Run tests in watch mode (re-run on file changes)
+npm run test:watch
+
+# Run specific test file
+npm run test -- path/to/specific.test.ts
+```
+
+### Test Coverage
+
+Maintain or improve test coverage with your changes:
+
+```bash
+# Check coverage report
+npm run test -- --coverage
+```
+
+Aim for high coverage, especially for:
+- Core authentication logic
+- UI components
+- Utility functions
+- Public APIs
+
+### Testing Best Practices
+
+1. **Test behavior, not implementation**: Focus on what the code does, not how it does it.
+2. **Use descriptive test names**: Test names should clearly describe what is being tested.
+3. **Keep tests isolated**: Tests should not depend on other tests or share state.
+4. **Mock external dependencies**: Use mocks for Firebase SDK and other external services.
+5. **Test error cases**: Include tests for error handling and edge cases.
+6. **Keep tests fast**: Avoid unnecessary delays or long-running operations.
+
+## Code Style and Standards
+
+### TypeScript Standards
+
+- Use strict TypeScript mode (`strict: true` in tsconfig.json)
+- Define types explicitly - avoid `any` type
+- Use interfaces for complex object structures
+- Use enums for fixed sets of values
+- Export public APIs clearly
+
+Example:
+
+```typescript
+// Good
+interface UserProfile {
+ uid: string;
+ email: string;
+ displayName?: string;
+}
+
+export class AuthManager {
+ private user: UserProfile | null = null;
+
+ public getUser(): UserProfile | null {
+ return this.user;
+ }
+}
+
+// Avoid
+export class AuthManager {
+ private user: any = null;
+
+ public getUser() {
+ return this.user;
+ }
+}
+```
+
+### JavaScript/CSS Standards
+
+- Use modern ES6+ syntax
+- Avoid global variables - use modules
+- Use meaningful variable and function names
+- Write CSS that follows BEM (Block Element Modifier) naming convention
+- Use flexbox and CSS Grid for layouts
+- Ensure responsive design for mobile, tablet, and desktop
+
+### Naming Conventions
+
+- **Classes**: PascalCase (e.g., `AuthManager`, `SignInPage`)
+- **Functions**: camelCase (e.g., `validateEmail`, `handleSubmit`)
+- **Constants**: UPPER_SNAKE_CASE (e.g., `DEFAULT_TIMEOUT`, `MAX_RETRIES`)
+- **Private members**: Prefix with underscore (e.g., `_internalState`)
+- **HTML/CSS classes**: kebab-case (e.g., `sign-in-form`, `error-message`)
+
+### Linting and Formatting
+
+All code must pass linting and formatting checks:
+
+```bash
+# Check linting
+npm run lint
+
+# Fix linting issues automatically
+npm run lint:fix
+
+# Format code
+npm run format
+```
+
+Before committing, ensure your code passes these checks. Pre-commit hooks will automatically run these checks.
+
+## Commit Messages
+
+### Commit Message Format
+
+Follow this format for commit messages:
+
+```
+():
+
+
+
+