iter(g49): 新增 autoComplete 自动补全组件
This commit is contained in:
@@ -2721,3 +2721,91 @@ button.ua-step-dot:hover {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
.ua-autocomplete {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
}
|
||||
.ua-autocomplete-input {
|
||||
width: 100%;
|
||||
padding: 8px var(--ua-space-2);
|
||||
font-size: var(--ua-font-size-sm);
|
||||
color: var(--ua-color-text);
|
||||
background: var(--ua-color-surface);
|
||||
border: 1px solid var(--ua-color-border);
|
||||
border-radius: var(--ua-radius-sm);
|
||||
outline: none;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
.ua-autocomplete-input:focus {
|
||||
border-color: var(--ua-color-accent);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ua-color-accent) 18%, transparent);
|
||||
}
|
||||
.ua-autocomplete-input:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.ua-autocomplete-pop {
|
||||
position: absolute;
|
||||
z-index: 40;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: none;
|
||||
margin-top: 4px;
|
||||
border: 1px solid var(--ua-color-border);
|
||||
border-radius: var(--ua-radius-md);
|
||||
background: var(--ua-color-surface);
|
||||
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
|
||||
overflow: hidden;
|
||||
}
|
||||
.ua-autocomplete-pop.ua-open {
|
||||
display: block;
|
||||
animation: ua-ac-in 0.15s ease both;
|
||||
}
|
||||
.ua-autocomplete-pop.is-flip {
|
||||
margin-top: 0;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.ua-autocomplete-list {
|
||||
max-height: 220px;
|
||||
margin: 0;
|
||||
padding: var(--ua-space-1);
|
||||
overflow: auto;
|
||||
list-style: none;
|
||||
}
|
||||
.ua-autocomplete-opt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--ua-space-1);
|
||||
padding: 6px var(--ua-space-1);
|
||||
border-radius: var(--ua-radius-sm);
|
||||
font-size: var(--ua-font-size-sm);
|
||||
color: var(--ua-color-text);
|
||||
cursor: pointer;
|
||||
transition: background 0.15s ease;
|
||||
}
|
||||
.ua-autocomplete-opt.is-active,
|
||||
.ua-autocomplete-opt:hover {
|
||||
background: color-mix(in srgb, var(--ua-color-accent) 10%, transparent);
|
||||
}
|
||||
.ua-autocomplete-hint {
|
||||
font-size: var(--ua-font-size-sm);
|
||||
color: var(--ua-color-text-muted);
|
||||
}
|
||||
.ua-autocomplete-empty {
|
||||
padding: var(--ua-space-2) 0;
|
||||
text-align: center;
|
||||
font-size: var(--ua-font-size-sm);
|
||||
color: var(--ua-color-text-muted);
|
||||
}
|
||||
@keyframes ua-ac-in {
|
||||
from { opacity: 0; transform: translateY(-4px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ua-autocomplete-pop.ua-open { animation: none; }
|
||||
.ua-autocomplete-input,
|
||||
.ua-autocomplete-opt { transition: none; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user