feat: implement permission-aware search baseline
This commit is contained in:
@@ -0,0 +1,244 @@
|
||||
.global-search {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: min(360px, 28vw);
|
||||
min-width: 190px;
|
||||
height: 34px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid var(--control-border);
|
||||
border-radius: 4px;
|
||||
background: var(--control-bg);
|
||||
color: var(--muted);
|
||||
padding: 0 8px;
|
||||
box-shadow: var(--shadow-control-inset);
|
||||
}
|
||||
|
||||
.global-search:focus-within {
|
||||
border-color: var(--input-border-focus);
|
||||
box-shadow: var(--focus-ring);
|
||||
}
|
||||
|
||||
.global-search input {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
height: 30px;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: transparent;
|
||||
color: var(--text-strong);
|
||||
padding: 0 7px;
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.global-search input::-webkit-search-cancel-button { display: none; }
|
||||
|
||||
.global-search-clear {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.global-search-clear:hover {
|
||||
background: var(--titlebar-hover-bg);
|
||||
color: var(--text-strong);
|
||||
}
|
||||
|
||||
.global-search-results {
|
||||
position: absolute;
|
||||
z-index: 300;
|
||||
top: calc(100% + 7px);
|
||||
right: 0;
|
||||
width: min(460px, 80vw);
|
||||
overflow: hidden;
|
||||
border: var(--border-line);
|
||||
border-radius: 6px;
|
||||
background: var(--surface);
|
||||
box-shadow: var(--shadow-menu);
|
||||
}
|
||||
|
||||
.global-search-results button {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 3px;
|
||||
border: 0;
|
||||
border-bottom: var(--border-line);
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
cursor: pointer;
|
||||
padding: 9px 12px;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.global-search-results button:hover,
|
||||
.global-search-results button.active {
|
||||
background: var(--titlebar-hover-bg);
|
||||
}
|
||||
|
||||
.global-search-result-title {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
color: var(--text-strong);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.global-search-results .global-search-all {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
border-bottom: 0;
|
||||
color: var(--text-strong);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.search-page {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
background: var(--panel);
|
||||
}
|
||||
|
||||
.search-page-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex: 0 0 auto;
|
||||
border-bottom: var(--border-line);
|
||||
background: var(--panel-header);
|
||||
padding: 12px 20px;
|
||||
}
|
||||
|
||||
.search-page-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: min(760px, 100%);
|
||||
height: 38px;
|
||||
border: 1px solid var(--control-border);
|
||||
border-radius: 4px;
|
||||
background: var(--control-bg);
|
||||
color: var(--muted);
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.search-page-form:focus-within {
|
||||
border-color: var(--input-border-focus);
|
||||
box-shadow: var(--focus-ring);
|
||||
}
|
||||
|
||||
.search-page-form input {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
height: 36px;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: transparent;
|
||||
color: var(--text-strong);
|
||||
padding: 0 10px;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.search-page-form button {
|
||||
align-self: stretch;
|
||||
border: 0;
|
||||
border-left: var(--border-line);
|
||||
background: linear-gradient(var(--control-gradient-start), var(--control-gradient-end));
|
||||
color: var(--control-text);
|
||||
cursor: pointer;
|
||||
padding: 0 16px;
|
||||
font: inherit;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.search-page-form button:hover {
|
||||
background: linear-gradient(var(--control-gradient-start), var(--control-gradient-end-hover));
|
||||
}
|
||||
|
||||
.search-results-viewport {
|
||||
min-height: 0;
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.search-result-list {
|
||||
display: grid;
|
||||
max-width: 960px;
|
||||
}
|
||||
|
||||
.search-result {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
border-bottom: var(--border-line);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
cursor: pointer;
|
||||
padding: 14px 12px;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.search-result:hover {
|
||||
background: var(--sidebar-hover-bg);
|
||||
}
|
||||
|
||||
.search-result-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
color: var(--text-strong);
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.search-result-summary {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.search-result-meta,
|
||||
.search-empty {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.global-search {
|
||||
width: 34px;
|
||||
min-width: 34px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.global-search:focus-within {
|
||||
position: absolute;
|
||||
right: 170px;
|
||||
width: min(360px, calc(100vw - 190px));
|
||||
}
|
||||
|
||||
.global-search:not(:focus-within) input,
|
||||
.global-search:not(:focus-within) .global-search-clear {
|
||||
width: 0;
|
||||
padding: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user