velxio/frontend/src/components/ComponentPickerModal.css

482 lines
8.5 KiB
CSS

/**
* Component Picker Modal Styles
*/
.component-picker-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
/* Above every floating panel, including the pro AI chat (8000/8001). */
z-index: 9000;
animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.component-picker-modal {
background: white;
border-radius: 12px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
width: 96%;
max-width: 1680px;
/* Fixed height (not max-height) so the modal keeps the SAME size regardless
of how many components the current filter shows — the grid area just has
empty space below when the results are few, instead of the whole modal
shrinking. */
height: 88vh;
display: flex;
flex-direction: column;
animation: slideUp 0.3s ease;
}
@keyframes slideUp {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
/* Header — title, search and category filter share one compact row */
.modal-header {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 20px;
border-bottom: 1px solid #e0e0e0;
}
.modal-header h2 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #333;
white-space: nowrap;
flex-shrink: 0;
}
.close-btn {
background: none;
border: none;
font-size: 20px;
color: #666;
cursor: pointer;
padding: 2px 8px;
line-height: 1;
border-radius: 4px;
flex-shrink: 0;
transition:
background 0.2s,
color 0.2s;
}
.close-btn:hover {
background: #f0f0f0;
color: #333;
}
/* Inline search (lives in the header row) */
.header-search-wrapper {
position: relative;
display: flex;
align-items: center;
flex: 1 1 auto;
min-width: 140px;
}
.search-icon {
position: absolute;
left: 11px;
color: #999;
pointer-events: none;
}
.search-input {
width: 100%;
padding: 8px 34px 8px 34px;
font-size: 14px;
border: 1.5px solid #e0e0e0;
border-radius: 8px;
outline: none;
transition: border-color 0.2s;
}
.search-input:focus {
border-color: var(--color-action-primary);
}
.clear-search-btn {
position: absolute;
right: 10px;
background: none;
border: none;
color: #999;
cursor: pointer;
padding: 4px;
font-size: 16px;
line-height: 1;
border-radius: 4px;
transition:
background 0.2s,
color 0.2s;
}
.clear-search-btn:hover {
background: #f0f0f0;
color: #666;
}
/* Category filter — compact dropdown in the header row */
.category-select {
flex-shrink: 0;
max-width: 190px;
padding: 8px 30px 8px 12px;
font-size: 13px;
font-weight: 500;
color: #444;
background-color: #f5f5f5;
border: 1.5px solid #e0e0e0;
border-radius: 8px;
cursor: pointer;
outline: none;
transition: border-color 0.2s;
appearance: none;
-webkit-appearance: none;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
background-repeat: no-repeat;
background-position: right 10px center;
}
.category-select:hover {
border-color: #ccc;
}
.category-select:focus {
border-color: var(--color-action-primary);
}
/* Components Grid */
.components-grid {
flex: 1;
overflow-y: auto;
padding: 16px 20px;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 12px;
align-content: start;
}
/* Single scroll container wrapping the boards row + components grid in the
"All Components" view, so the modal shows only one scrollbar instead of
two stacked ones. */
.components-scroll {
flex: 1;
overflow-y: auto;
min-height: 0;
}
.components-scroll::-webkit-scrollbar {
width: 8px;
}
.components-scroll::-webkit-scrollbar-track {
background: #f0f0f0;
border-radius: 4px;
}
.components-scroll::-webkit-scrollbar-thumb {
background: #ccc;
border-radius: 4px;
}
.components-scroll::-webkit-scrollbar-thumb:hover {
background: #999;
}
/* When a grid lives inside .components-scroll it should NOT scroll on its
own — the wrapper handles all scrolling. */
.components-grid--inline {
flex: none;
overflow: visible;
}
.loading-state {
grid-column: 1 / -1;
text-align: center;
padding: 60px 20px;
color: #999;
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
.spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid var(--color-action-primary);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.no-results {
grid-column: 1 / -1;
text-align: center;
padding: 40px 20px;
color: #999;
}
.no-results p {
margin: 0 0 16px 0;
font-size: 18px;
}
.clear-filters-btn {
padding: 10px 20px;
background: var(--color-action-primary);
color: white;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s;
}
.clear-filters-btn:hover {
background: #005a9e;
}
/* Component Card */
.component-card {
background: white;
border: 1.5px solid #e0e0e0;
border-radius: 8px;
padding: 10px;
cursor: pointer;
transition: all 0.2s;
text-align: left;
display: flex;
flex-direction: column;
gap: 8px;
}
.component-card:hover {
border-color: var(--color-action-primary);
box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
transform: translateY(-2px);
}
.card-thumbnail {
display: flex;
align-items: center;
justify-content: center;
height: 72px;
background: #f9f9f9;
border-radius: 6px;
overflow: hidden;
position: relative;
}
.component-preview {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
pointer-events: none;
}
.card-thumbnail svg {
max-width: 100%;
max-height: 100%;
}
.card-content {
display: flex;
flex-direction: column;
gap: 4px;
}
.card-name {
font-size: 14px;
font-weight: 600;
color: #333;
line-height: 1.25;
}
.card-description {
font-size: 11.5px;
color: #666;
line-height: 1.35;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.card-meta {
display: flex;
gap: 8px;
font-size: 11px;
color: #999;
}
.card-category {
text-transform: capitalize;
}
.card-pins {
margin-left: auto;
}
/* Footer */
.modal-footer {
padding: 8px 20px;
border-top: 1px solid #e0e0e0;
display: flex;
justify-content: space-between;
align-items: center;
}
.component-count {
font-size: 14px;
color: #666;
}
/* Scrollbar styles */
.components-grid::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.components-grid::-webkit-scrollbar-track {
background: #f0f0f0;
border-radius: 4px;
}
.components-grid::-webkit-scrollbar-thumb {
background: #ccc;
border-radius: 4px;
}
.components-grid::-webkit-scrollbar-thumb:hover {
background: #999;
}
/* Dark mode support */
.component-picker-modal {
background: #2d2d2d;
}
.modal-header h2,
.card-name {
color: #fff;
}
.modal-header,
.modal-footer {
border-color: #444;
}
.search-input {
background: #3d3d3d;
border-color: #555;
color: #fff;
}
.search-input:focus {
border-color: var(--color-action-primary);
}
.search-input::placeholder {
color: #888;
}
.search-icon {
color: #888;
}
.category-select {
background-color: #3d3d3d;
border-color: #555;
color: #ddd;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
.category-select:hover {
border-color: #777;
}
.category-select option {
background: #2d2d2d;
color: #ddd;
}
.component-card {
background: #3d3d3d;
border-color: #555;
}
.component-card:hover {
border-color: var(--color-action-primary);
}
.card-thumbnail {
background: #252525;
}
.card-description {
color: #aaa;
}
.card-meta {
color: #888;
}
.components-grid::-webkit-scrollbar-track,
.components-scroll::-webkit-scrollbar-track {
background: #3d3d3d;
}
.components-grid::-webkit-scrollbar-thumb,
.components-scroll::-webkit-scrollbar-thumb {
background: #555;
}
.loading-state,
.no-results {
color: #aaa;
}
.component-count {
color: #888;
}