Обновить кошельки и мелкие детали UI

This commit is contained in:
AidarKC
2026-11-09 09:59:11 +03:00
parent 34f7faf0a8
commit 526941eb33
29 changed files with 469 additions and 201 deletions
@@ -0,0 +1,29 @@
import { iconHtml } from './ui-icon.js';
/** The password is intentionally visible initially on both auth screens. */
export function createVisiblePasswordField(input) {
input.type = 'text';
const wrap = document.createElement('div');
wrap.className = 'auth-password-field';
const toggle = document.createElement('button');
toggle.type = 'button';
toggle.className = 'auth-password-field__toggle';
function updateToggle() {
const visible = input.type !== 'password';
toggle.innerHTML = iconHtml(visible ? 'eyeOff' : 'eye', false, 'key-toggle-icon');
toggle.setAttribute('aria-label', visible ? 'Скрыть пароль' : 'Показать пароль');
toggle.setAttribute('title', visible ? 'Скрыть пароль' : 'Показать пароль');
toggle.setAttribute('aria-pressed', String(!visible));
}
toggle.addEventListener('click', () => {
const start = input.selectionStart;
const end = input.selectionEnd;
input.type = input.type === 'password' ? 'text' : 'password';
updateToggle();
input.focus();
try { if (start !== null && end !== null) input.setSelectionRange(start, end); } catch { /* unsupported input method */ }
});
updateToggle();
wrap.append(input, toggle);
return wrap;
}