also looking at this
refactor(ui): use shared auth submit buttons
#13
4 files
+74
-3
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -197,6 +197,14 @@ export default { | ||
| 197 | 197 | + 'hover:bg-[color-mix(in_srgb,var(--accent)_88%,#000)] ' |
| 198 | 198 | + 'active:translate-y-px disabled:opacity-60 disabled:cursor-default', |
| 199 | 199 | |
| 200 | // Shared Button owns semantics and reactive state. These explicit | |
| 201 | // overrides preserve the existing auth controls without depending on | |
| 202 | // utility order or copying the component into the app. | |
| 203 | 'auth-submit': '!py-2.5 !shadow-none ' | |
| 204 | + '![transition:transform_0.12s_ease,opacity_0.15s_ease] ' | |
| 205 | + 'hover:!bg-[color-mix(in_srgb,var(--accent)_88%,#000)] ' | |
| 206 | + 'active:translate-y-px disabled:!opacity-60 disabled:!cursor-default', | |
| 207 | ||
| 200 | 208 | 'oauth-btn': 'bg-panel border border-line rounded-[10px] text-ink ' |
| 201 | 209 | + '[transition:border-color_0.15s_ease,transform_0.12s_ease] ' |
| 202 | 210 | + 'hover:border-[color-mix(in_srgb,var(--accent)_45%,var(--border))] ' |
| @@ -163,7 +163,7 @@ async function onVerify(e: Event): Promise<void> { | ||
| 163 | 163 | <span>Keep me signed in for 30 days</span> |
| 164 | 164 | </label> |
| 165 | 165 | |
| 166 | <button type="submit" :disabled="loading()" :text="loading() ? 'Signing in…' : 'Sign in'" class="py-2.5 w-full font-semibold text-sm btn-solid">Sign in</button> | |
| 166 | <Button type="submit" size="sm" fullWidth :disabled="loading()" :label="loading() ? 'Signing in…' : 'Sign in'" className="auth-submit">Sign in</Button> | |
| 167 | 167 | </form> |
| 168 | 168 | |
| 169 | 169 | {{-- Step 2: TOTP, shown only when the account has 2FA enabled. --}} |
| @@ -173,7 +173,7 @@ async function onVerify(e: Event): Promise<void> { | ||
| 173 | 173 | <label for="login-code" class="block mb-1.5 font-medium text-muted text-xs">Authentication code</label> |
| 174 | 174 | <input id="login-code" name="code" type="text" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="123456" :model="code" class="px-3.5 py-2.5 w-full text-sm field" :aria-invalid="error() ? 'true' : 'false'" :aria-describedby="error() ? 'login-error' : ''"> |
| 175 | 175 | </div> |
| 176 | <button type="submit" :disabled="loading()" :text="loading() ? 'Verifying…' : 'Verify and sign in'" class="py-2.5 w-full font-semibold text-sm btn-solid">Verify and sign in</button> | |
| 176 | <Button type="submit" size="sm" fullWidth :disabled="loading()" :label="loading() ? 'Verifying…' : 'Verify and sign in'" className="auth-submit">Verify and sign in</Button> | |
| 177 | 177 | </form> |
| 178 | 178 | |
| 179 | 179 | @if (oauthError) |
| @@ -112,7 +112,7 @@ async function onRegister(e: Event): Promise<void> { | ||
| 112 | 112 | <input id="register-password" name="password" type="password" required autocomplete="new-password" placeholder="At least 8 characters" :model="password" class="px-3.5 py-2.5 w-full text-sm field" :aria-invalid="error() ? 'true' : 'false'" :aria-describedby="error() ? 'form-error' : ''"> |
| 113 | 113 | </div> |
| 114 | 114 | |
| 115 | <button type="submit" :disabled="loading()" :text="loading() ? 'Creating account…' : 'Create account'" class="py-2.5 w-full font-semibold text-sm btn-solid">Create account</button> | |
| 115 | <Button type="submit" size="sm" fullWidth :disabled="loading()" :label="loading() ? 'Creating account…' : 'Create account'" className="auth-submit">Create account</Button> | |
| 116 | 116 | </form> |
| 117 | 117 | |
| 118 | 118 | @if (anyOauth) |