feat(web): 支持登录密码显示与隐藏
原因:登录时缺少密码可见性切换,长密码输入难以核对。 影响:新增可复用 PasswordInput,在登录表单提供眼睛按钮,并补充禁用态、焦点样式和无障碍标签。 风险:密码仅在用户主动点击时于当前输入框显示,不改变提交、存储或日志行为。 验证:前端 112 项测试通过;pnpm lint 通过;@easyai-ai-gateway/web 生产构建通过。
This commit is contained in:
@@ -420,6 +420,48 @@
|
||||
padding: 0 11px;
|
||||
}
|
||||
|
||||
.shPasswordInputRoot {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.shPasswordInput {
|
||||
padding-right: 42px;
|
||||
}
|
||||
|
||||
.shPasswordInputToggle {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 3px;
|
||||
display: grid;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
place-items: center;
|
||||
transform: translateY(-50%);
|
||||
border: 0;
|
||||
border-radius: calc(var(--control-radius) - 2px);
|
||||
background: transparent;
|
||||
color: var(--text-soft);
|
||||
cursor: pointer;
|
||||
transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
|
||||
}
|
||||
|
||||
.shPasswordInputToggle:hover {
|
||||
background: var(--surface-muted);
|
||||
color: var(--text-strong);
|
||||
}
|
||||
|
||||
.shPasswordInputToggle:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 1px var(--ring);
|
||||
}
|
||||
|
||||
.shPasswordInputToggle:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.shSelect {
|
||||
appearance: none;
|
||||
padding-right: 30px;
|
||||
|
||||
Reference in New Issue
Block a user