UNPKG

@narangcia-oss/cryptic-auth-client-react

Version:

React hooks and components for cryptic-auth authentication with seamless OAuth2 integration

335 lines (288 loc) 5.55 kB
/* Basic styles for cryptic-auth-client-react components */ /* OAuth Button Styles */ .oauth-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 2px solid #e1e5e9; border-radius: 8px; background: white; color: #333; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: all 0.2s ease; min-width: 200px; box-sizing: border-box; } .oauth-button:hover { background: #f8f9fa; border-color: #d0d7de; transform: translateY(-1px); } .oauth-button:active { transform: translateY(0); } .oauth-button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; } /* Provider-specific button styles */ .oauth-button-google { border-color: #4285f4; color: #4285f4; } .oauth-button-google:hover { background: #4285f4; color: white; } .oauth-button-github { border-color: #24292f; color: #24292f; } .oauth-button-github:hover { background: #24292f; color: white; } .oauth-button-discord { border-color: #5865f2; color: #5865f2; } .oauth-button-discord:hover { background: #5865f2; color: white; } /* Login Form Styles */ .login-form { max-width: 400px; margin: 0 auto; padding: 24px; background: white; border-radius: 12px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); } .form-field { margin-bottom: 20px; } .form-field label { display: block; margin-bottom: 6px; font-weight: 500; color: #333; font-size: 14px; } .form-field input { width: 100%; padding: 12px 16px; border: 2px solid #e1e5e9; border-radius: 8px; font-size: 16px; transition: border-color 0.2s ease; box-sizing: border-box; } .form-field input:focus { outline: none; border-color: #0969da; box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1); } .form-field input:disabled { background: #f6f8fa; color: #656d76; cursor: not-allowed; } .error-message { color: #d1242f; font-size: 14px; margin: 12px 0; padding: 8px 12px; background: #ffebee; border: 1px solid #ffcdd2; border-radius: 6px; } .submit-button { width: 100%; padding: 12px 24px; background: #0969da; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 500; cursor: pointer; transition: background-color 0.2s ease; } .submit-button:hover { background: #0860ca; } .submit-button:disabled { background: #8c959f; cursor: not-allowed; } .signup-link { text-align: center; margin-top: 20px; font-size: 14px; color: #656d76; } .signup-link a { color: #0969da; text-decoration: none; } .signup-link a:hover { text-decoration: underline; } /* Auth Guard Styles */ .auth-guard-loading { display: flex; justify-content: center; align-items: center; min-height: 200px; font-size: 16px; color: #656d76; } .auth-guard-fallback { text-align: center; padding: 40px 20px; } /* Loading Spinner */ .loading-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid #f3f3f3; border-top: 2px solid #0969da; border-radius: 50%; animation: spin 1s linear infinite; } .loading-spinner.large { width: 40px; height: 40px; border-width: 4px; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } /* Responsive Design */ @media (max-width: 768px) { .login-form { margin: 16px; padding: 20px; } .oauth-button { width: 100%; margin-bottom: 12px; } .form-field input { font-size: 16px; /* Prevents zoom on iOS */ } } /* Example Layout Styles */ .app { min-height: 100vh; background: #f6f8fa; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .dashboard { max-width: 1200px; margin: 0 auto; padding: 20px; } .dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid #d0d7de; } .user-menu { position: relative; display: inline-block; } .user-menu-trigger { padding: 8px 16px; background: white; border: 1px solid #d0d7de; border-radius: 6px; cursor: pointer; font-size: 14px; } .user-menu-dropdown { position: absolute; top: 100%; right: 0; min-width: 160px; background: white; border: 1px solid #d0d7de; border-radius: 6px; box-shadow: 0 8px 24px rgba(140, 149, 159, 0.2); z-index: 100; } .user-menu-dropdown a, .user-menu-dropdown button { display: block; width: 100%; padding: 8px 16px; text-align: left; text-decoration: none; color: #24292f; background: none; border: none; cursor: pointer; font-size: 14px; } .user-menu-dropdown a:hover, .user-menu-dropdown button:hover { background: #f6f8fa; } .user-menu-dropdown hr { margin: 8px 0; border: none; border-top: 1px solid #d0d7de; } /* Notifications */ .notifications { position: fixed; top: 20px; right: 20px; z-index: 1000; max-width: 400px; } .notification { margin-bottom: 12px; padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; animation: slideIn 0.3s ease; } .notification-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; } .notification-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; } .notification-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; } @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }