mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-02 05:05:12 +09:00
2036 lines
59 KiB
SCSS
2036 lines
59 KiB
SCSS
// ============================================
|
|
// DATABASE EXPLORER
|
|
// Full-bleed, DataGrip-style source tree + tabbed query/data workspace.
|
|
// ============================================
|
|
|
|
$dbx-sqlite: #3d8fd1;
|
|
|
|
@mixin dbx-trunc {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.db-explorer {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
width: 100%;
|
|
max-width: none;
|
|
margin: 0;
|
|
// flush full-height console (demo `.db-layout`): panes join on 1px borders,
|
|
// no outer padding / gaps / card radii
|
|
padding: 0;
|
|
gap: 0;
|
|
box-sizing: border-box;
|
|
overflow: hidden;
|
|
|
|
// On PageLayout the console renders inside the shell's fill region, which
|
|
// is a plain block: make it the flex column `.dbx-body { flex: 1 }` needs,
|
|
// or the body collapses to its content and the status bar floats up.
|
|
.sk-pageshell__fill {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
// ─── shared controls ─────────────────────────────────
|
|
.dbx-icon-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: $control-sm;
|
|
height: $control-sm;
|
|
padding: 0;
|
|
background: transparent;
|
|
border: 1px solid transparent;
|
|
border-radius: $radius-control;
|
|
color: $text-secondary;
|
|
cursor: pointer;
|
|
transition: background $transition-fast, color $transition-fast;
|
|
|
|
&:hover:not(:disabled) { background: $bg-hover; color: $text-primary; }
|
|
&:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
&.is-danger:hover:not(:disabled) { @include status-variant($danger, $danger-bg); }
|
|
}
|
|
|
|
.dbx-chip {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
height: $control-sm;
|
|
padding: 0 $space-3;
|
|
background: $bg-tertiary;
|
|
border: 1px solid transparent;
|
|
border-radius: $radius-control;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
transition: background $transition-fast, color $transition-fast, border-color $transition-fast;
|
|
|
|
&:hover:not(:disabled) { background: $bg-hover; color: $text-primary; }
|
|
&.is-active { background: $accent-glow; color: $accent-primary; border-color: fade($accent-primary-raw, 30%); }
|
|
&:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
|
|
.dbx-mono { font-family: $font-mono; font-size: $text-xs; }
|
|
.dbx-spin { animation: dbx-spin 1s linear infinite; }
|
|
@keyframes dbx-spin { to { transform: rotate(360deg); } }
|
|
|
|
@keyframes dbx-pop {
|
|
from { opacity: 0; transform: translateY(-4px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
// ─── Body grid ────────────────────────────────────────
|
|
.dbx-body {
|
|
display: grid;
|
|
grid-template-columns: 280px 1fr;
|
|
gap: 0;
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow: hidden;
|
|
|
|
&.is-collapsed { grid-template-columns: 1fr; }
|
|
|
|
@media (max-width: $breakpoint-lg) { grid-template-columns: 240px 1fr; }
|
|
@media (max-width: $breakpoint-md) {
|
|
grid-template-columns: 1fr;
|
|
grid-template-rows: minmax(140px, 240px) 1fr;
|
|
}
|
|
}
|
|
|
|
// ─── Tree panel ───────────────────────────────────────
|
|
.dbx-tree-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
background: $bg-card;
|
|
border-right: 1px solid $border-default;
|
|
overflow: hidden;
|
|
|
|
@media (max-width: $breakpoint-md) {
|
|
border-right: none;
|
|
border-bottom: 1px solid $border-default;
|
|
}
|
|
}
|
|
|
|
// Holds a <SearchField>, which brings its own icon/input styling — this is
|
|
// only the strip it sits in.
|
|
.dbx-tree-search {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: $space-2 $space-3;
|
|
border-bottom: 1px solid $border-default;
|
|
background: $bg-elevated;
|
|
flex-shrink: 0;
|
|
|
|
.sk-searchfield { flex: 1; min-width: 0; }
|
|
}
|
|
|
|
.dbx-tree-scroll {
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow-y: auto;
|
|
padding: $space-2;
|
|
scrollbar-width: thin;
|
|
&::-webkit-scrollbar { width: 6px; }
|
|
&::-webkit-scrollbar-thumb { background: $border-active; border-radius: $radius-badge; }
|
|
}
|
|
|
|
.dbx-tree-loading {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
padding: $space-4;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
}
|
|
|
|
// ─── Tree rows ────────────────────────────────────────
|
|
.dbx-tree, .dbx-tree-children {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
// The row owns its own padding and truncation; the node is only the
|
|
// grouping element that carries a row plus its children.
|
|
.dbx-tree-node { min-width: 0; }
|
|
|
|
.dbx-tree-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-1;
|
|
padding: $space-tight $space-1;
|
|
border-radius: $radius-badge;
|
|
cursor: pointer;
|
|
color: $text-primary;
|
|
user-select: none;
|
|
transition: background $transition-fast;
|
|
|
|
&:hover,
|
|
&:focus-within { background: $bg-hover; .dbx-tree-more { opacity: 1; } }
|
|
&:focus-visible { outline: 2px solid $accent-primary; outline-offset: -2px; }
|
|
|
|
&.is-selected { background: $accent-glow; }
|
|
&.is-selected .dbx-tree-label { color: $accent-primary; font-weight: $font-weight-medium; }
|
|
|
|
// engine tints on the leading icon
|
|
&.is-mysql .dbx-tree-icon { color: $color-mysql; }
|
|
&.is-postgresql .dbx-tree-icon { color: $color-postgresql; }
|
|
&.is-mariadb .dbx-tree-icon { color: $color-mariadb; }
|
|
&.is-mongodb .dbx-tree-icon { color: $color-mongodb; }
|
|
&.is-redis .dbx-tree-icon { color: $color-redis; }
|
|
&.is-sqlite .dbx-tree-icon { color: $dbx-sqlite; }
|
|
&.is-docker .dbx-tree-icon { color: $color-docker; }
|
|
&.is-table .dbx-tree-icon { color: $text-tertiary; }
|
|
}
|
|
|
|
// "lives in a Docker container" badge on a database row surfaced under its
|
|
// engine node — a small docker-blue chip carrying the owning app's name.
|
|
.dbx-tree-source {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-1;
|
|
flex-shrink: 0;
|
|
margin-left: $space-1;
|
|
padding: 1px $space-tight;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
line-height: 1.5;
|
|
border-radius: $radius-full;
|
|
color: $color-docker;
|
|
background: fade($color-docker, 12%);
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
|
|
.dbx-tree-chevron {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 16px;
|
|
height: 16px;
|
|
flex-shrink: 0;
|
|
background: transparent;
|
|
border: none;
|
|
color: $text-tertiary;
|
|
cursor: pointer;
|
|
border-radius: $radius-badge;
|
|
&:hover { color: $text-primary; }
|
|
&--leaf { cursor: default; }
|
|
}
|
|
|
|
.dbx-tree-icon { display: flex; flex-shrink: 0; }
|
|
|
|
.dbx-tree-label {
|
|
flex: 1;
|
|
min-width: 0;
|
|
@include dbx-trunc;
|
|
font-size: $text-xs;
|
|
}
|
|
|
|
.dbx-tree-badge {
|
|
flex-shrink: 0;
|
|
padding: 0 $space-tight;
|
|
font-size: $text-xs;
|
|
color: $text-tertiary;
|
|
background: $bg-tertiary;
|
|
border-radius: $radius-full;
|
|
line-height: 16px;
|
|
}
|
|
|
|
// How many children a node actually holds. Deliberately not a pill: it is a
|
|
// fact read off the loaded tree, so it sits quieter than the size badge.
|
|
.dbx-tree-count {
|
|
flex-shrink: 0;
|
|
font-size: $text-xs;
|
|
line-height: 16px;
|
|
color: $text-tertiary;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
// Why a not-installed engine offers no install button.
|
|
.dbx-tree-hint {
|
|
flex-shrink: 0;
|
|
font-size: $text-xs;
|
|
font-style: italic;
|
|
color: $text-tertiary;
|
|
}
|
|
|
|
.dbx-tree-status {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
flex-shrink: 0;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
color: $text-tertiary;
|
|
|
|
.dbx-status-dot { width: 7px; height: 7px; border-radius: $radius-full; background: currentColor; }
|
|
&.is-active { color: $success; }
|
|
&.is-inactive { color: $warning; }
|
|
&.is-missing { color: $text-tertiary; }
|
|
}
|
|
|
|
.dbx-tree-more {
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: $space-hair;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: $radius-badge;
|
|
color: $text-tertiary;
|
|
cursor: pointer;
|
|
opacity: 0;
|
|
transition: opacity $transition-fast, background $transition-fast;
|
|
&:hover { background: $bg-tertiary; color: $text-primary; }
|
|
}
|
|
|
|
.dbx-tree-leaf-msg {
|
|
padding: $space-1 $space-tight;
|
|
font-size: $text-xs;
|
|
color: $text-tertiary;
|
|
font-style: italic;
|
|
&.is-error { color: $danger; }
|
|
}
|
|
|
|
// The same message, but the missing thing is one click away. Reads as a
|
|
// link rather than italic prose, because it does something.
|
|
.dbx-tree-leaf-link {
|
|
padding: 0;
|
|
background: none;
|
|
border: none;
|
|
color: $accent-primary;
|
|
font-family: inherit;
|
|
font-size: inherit;
|
|
font-style: normal;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
|
|
&:hover { text-decoration: underline; }
|
|
&:focus-visible { outline: 2px solid $accent-primary; outline-offset: 2px; }
|
|
}
|
|
|
|
// ─── Workspace ────────────────────────────────────────
|
|
.dbx-workspace {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
background: $bg-card;
|
|
overflow: hidden;
|
|
}
|
|
|
|
// ─── Tab bar ──────────────────────────────────────────
|
|
.dbx-tabbar {
|
|
display: flex;
|
|
align-items: stretch;
|
|
gap: $space-hair;
|
|
padding: $space-1 $space-1 0;
|
|
background: $bg-elevated;
|
|
border-bottom: 1px solid $border-default;
|
|
overflow-x: auto;
|
|
flex-shrink: 0;
|
|
scrollbar-width: thin;
|
|
&::-webkit-scrollbar { height: 4px; }
|
|
&::-webkit-scrollbar-thumb { background: $border-active; border-radius: $radius-badge; }
|
|
}
|
|
|
|
.dbx-tab {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
height: $control-md;
|
|
padding: 0 $space-2 0 $space-3;
|
|
max-width: 220px;
|
|
background: transparent;
|
|
border: 1px solid transparent;
|
|
border-bottom: none;
|
|
border-radius: $radius-control $radius-control 0 0;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
transition: background $transition-fast, color $transition-fast;
|
|
|
|
&:hover { background: $bg-hover; color: $text-primary; }
|
|
&:focus-visible { outline: 2px solid $accent-primary; outline-offset: -2px; }
|
|
|
|
&.is-active {
|
|
background: $bg-card;
|
|
color: $text-primary;
|
|
border-color: $border-default;
|
|
position: relative;
|
|
// accent rule along the top edge marks the live tab
|
|
box-shadow: inset 0 2px 0 $accent-primary; // geometry: draws the active-tab top rule
|
|
}
|
|
|
|
// engine-tinted icon
|
|
&.is-mysql > svg:first-child { color: $color-mysql; }
|
|
&.is-postgresql > svg:first-child { color: $color-postgresql; }
|
|
&.is-sqlite > svg:first-child { color: $dbx-sqlite; }
|
|
&.is-docker > svg:first-child { color: $color-docker; }
|
|
> svg:first-child { flex-shrink: 0; }
|
|
}
|
|
|
|
.dbx-tab-title { @include dbx-trunc; }
|
|
|
|
// demo's `+` new-tab pill at the end of the strip
|
|
.dbx-tab-new {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: $control-sm;
|
|
height: $control-sm;
|
|
padding: 0;
|
|
align-self: center;
|
|
border-radius: $radius-control;
|
|
color: $text-tertiary;
|
|
|
|
&:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
&:hover:not(:disabled) { background: $bg-hover; color: $text-primary; }
|
|
}
|
|
|
|
.dbx-tab-close {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: $space-hair;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: $radius-badge;
|
|
color: $text-tertiary;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
&:hover { background: $bg-tertiary; color: $text-primary; }
|
|
}
|
|
|
|
// ─── Panes ────────────────────────────────────────────
|
|
.dbx-panes { flex: 1; min-height: 0; display: flex; }
|
|
.dbx-tabpane {
|
|
flex: 1;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.dbx-tabpane[hidden] { display: none; }
|
|
|
|
.dbx-welcome {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: $space-8;
|
|
}
|
|
|
|
// The workspace is already a bordered card, so the global .empty-state card
|
|
// (components/_cards.scss) renders here as a faint card-in-card outline — its
|
|
// fill matches the workspace, so only the border shows. That guard only drops
|
|
// inside `.card`, which this surface isn't. Neutralize it for empty/result
|
|
// states so they read as clean centered content, not a nested card.
|
|
.dbx-welcome .empty-state,
|
|
.dbx-grid-status .empty-state {
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: 0;
|
|
padding: $space-6 $space-5;
|
|
}
|
|
|
|
// ─── Console ──────────────────────────────────────────
|
|
.dbx-console { display: flex; flex-direction: column; height: 100%; min-height: 0; }
|
|
|
|
.dbx-console-toolbar,
|
|
.dbx-table-toolbar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
padding: $space-2 $space-3;
|
|
border-bottom: 1px solid $border-default;
|
|
background: $bg-elevated;
|
|
flex-shrink: 0;
|
|
}
|
|
.dbx-console-toolbar-spacer,
|
|
.dbx-table-toolbar-spacer { flex: 1; }
|
|
|
|
.dbx-run {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
padding: $space-tight $space-3;
|
|
background: $accent-primary;
|
|
border: none;
|
|
border-radius: $radius-control;
|
|
color: #fff;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-semibold;
|
|
cursor: pointer;
|
|
box-shadow: none;
|
|
transition: background $transition-fast, transform $transition-fast;
|
|
|
|
&:hover:not(:disabled) { background: $accent-hover; }
|
|
&:active:not(:disabled) { transform: translateY(1px); }
|
|
&:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
|
|
kbd {
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
padding: 1px $space-tight;
|
|
background: rgba(255, 255, 255, 0.18);
|
|
border-radius: $radius-badge;
|
|
}
|
|
}
|
|
|
|
.dbx-toggle {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
padding: $space-tight $space-3;
|
|
background: $bg-tertiary;
|
|
border: 1px solid transparent;
|
|
border-radius: $radius-control;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
cursor: pointer;
|
|
transition: background $transition-fast, color $transition-fast;
|
|
|
|
&:hover { background: $bg-hover; color: $text-primary; }
|
|
&.is-write {
|
|
background: $warning-bg;
|
|
border-color: $warning-border;
|
|
color: $warning;
|
|
}
|
|
}
|
|
|
|
.dbx-console-split { display: flex; min-height: 0; flex-shrink: 0; }
|
|
|
|
.dbx-editor-wrap { position: relative; flex: 1; min-width: 0; }
|
|
|
|
// SQL editor (demo .sql-editor): line-number gutter + keyword tints. A
|
|
// transparent textarea sits over a highlighted <pre>; gutter/pre/textarea
|
|
// MUST share identical font metrics or the overlay drifts.
|
|
.dbx-sqled {
|
|
display: flex;
|
|
height: 184px;
|
|
min-height: 96px;
|
|
max-height: 50vh;
|
|
resize: vertical;
|
|
overflow: hidden;
|
|
background: $bg-body;
|
|
border-bottom: 1px solid $border-default;
|
|
|
|
&__gutter {
|
|
flex-shrink: 0;
|
|
min-width: 40px;
|
|
padding: $space-3 $space-3 $space-3 $space-3;
|
|
overflow: hidden;
|
|
text-align: right;
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
line-height: $line-height-relaxed;
|
|
color: $text-tertiary;
|
|
border-right: 1px solid $border-subtle;
|
|
user-select: none;
|
|
}
|
|
|
|
&__stack {
|
|
position: relative;
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
&__hl,
|
|
&__input {
|
|
position: absolute;
|
|
inset: 0;
|
|
margin: 0;
|
|
padding: $space-3 $space-4;
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
line-height: $line-height-relaxed;
|
|
white-space: pre;
|
|
tab-size: 4;
|
|
}
|
|
|
|
&__hl {
|
|
overflow: hidden;
|
|
pointer-events: none;
|
|
color: $text-primary;
|
|
|
|
.tok-kw { color: var(--accent-bright); font-weight: $font-weight-semibold; }
|
|
.tok-str { color: $success; }
|
|
.tok-num { color: $warning; }
|
|
.tok-cmt { color: var(--text-ghost); font-style: italic; }
|
|
}
|
|
|
|
&__input {
|
|
background: transparent;
|
|
border: none;
|
|
resize: none;
|
|
outline: none;
|
|
color: transparent;
|
|
caret-color: $text-primary;
|
|
overflow: auto;
|
|
|
|
&::placeholder { color: $text-tertiary; }
|
|
&::selection { background: fade($accent-primary-raw, 28%); }
|
|
}
|
|
}
|
|
|
|
.dbx-editor-badge {
|
|
height: 20px; // geometry: badge height (20px badge spec)
|
|
position: absolute;
|
|
bottom: 10px;
|
|
right: 14px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-1;
|
|
padding: 0 $space-tight;
|
|
background: $bg-card;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-badge;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
color: $text-tertiary;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.dbx-history {
|
|
width: 280px;
|
|
flex-shrink: 0;
|
|
border-left: 1px solid $border-default;
|
|
border-bottom: 1px solid $border-default;
|
|
background: $bg-elevated;
|
|
overflow-y: auto;
|
|
|
|
.dbx-history-head {
|
|
padding: $space-2 $space-3;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-semibold;
|
|
color: $text-tertiary;
|
|
border-bottom: 1px solid $border-subtle;
|
|
}
|
|
.dbx-history-empty { padding: $space-3; font-size: $text-xs; color: $text-tertiary; }
|
|
ul { list-style: none; margin: 0; padding: 0; }
|
|
li button {
|
|
display: block;
|
|
width: 100%;
|
|
text-align: left;
|
|
padding: $space-2 $space-3;
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid $border-subtle;
|
|
cursor: pointer;
|
|
transition: background $transition-fast;
|
|
&:hover { background: $bg-hover; }
|
|
code {
|
|
display: block;
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
color: $text-primary;
|
|
@include dbx-trunc;
|
|
}
|
|
}
|
|
.dbx-history-time {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-1;
|
|
margin-top: $space-1;
|
|
font-size: $text-xs;
|
|
color: $text-tertiary;
|
|
}
|
|
}
|
|
|
|
.dbx-results { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
|
|
|
|
.dbx-console-hint {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
p { margin: 0; }
|
|
kbd {
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
padding: 1px $space-tight;
|
|
background: $bg-tertiary;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-badge;
|
|
color: $text-secondary;
|
|
}
|
|
}
|
|
|
|
// ─── Table tab ────────────────────────────────────────
|
|
.dbx-table-tab { display: flex; flex-direction: column; height: 100%; min-height: 0; }
|
|
.dbx-table-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
|
|
|
|
// The Structure view is a real list surface (chrome, then rows); the Data
|
|
// view next to it is a raw result set and keeps the bare grid.
|
|
.dbx-structure-pane {
|
|
flex: 1;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
padding: $space-3;
|
|
}
|
|
|
|
.dbx-segmented {
|
|
display: inline-flex;
|
|
gap: $space-hair;
|
|
padding: $space-hair;
|
|
background: $bg-tertiary;
|
|
border-radius: $radius-control;
|
|
|
|
button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
padding: $space-tight $space-3;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: $radius-badge;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
cursor: pointer;
|
|
transition: background $transition-fast, color $transition-fast;
|
|
&:hover { color: $text-primary; }
|
|
&.is-active { background: $bg-card; color: $accent-primary; box-shadow: none; }
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
}
|
|
|
|
.dbx-pager {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-1;
|
|
.dbx-pager-label { font-size: $text-xs; color: $text-secondary; font-variant-numeric: tabular-nums; }
|
|
.dbx-pager-total { color: $text-tertiary; }
|
|
}
|
|
|
|
// ─── Results grid (shared) ────────────────────────────
|
|
.dbx-grid-scroll {
|
|
flex: 1;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
overflow: auto;
|
|
background: $bg-card;
|
|
scrollbar-width: thin;
|
|
&::-webkit-scrollbar { width: 10px; height: 10px; }
|
|
&::-webkit-scrollbar-thumb { background: $border-active; border-radius: $radius-badge; }
|
|
}
|
|
|
|
.dbx-grid {
|
|
border-collapse: separate;
|
|
border-spacing: 0;
|
|
width: max-content;
|
|
min-width: 100%;
|
|
font-size: $text-xs;
|
|
|
|
thead th {
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 1;
|
|
background: $bg-elevated;
|
|
border-bottom: 1px solid $border-default;
|
|
border-right: 1px solid $border-subtle;
|
|
text-align: left;
|
|
font-weight: $font-weight-semibold;
|
|
color: $text-secondary;
|
|
white-space: nowrap;
|
|
padding: 0;
|
|
|
|
&:last-child { border-right: none; }
|
|
}
|
|
|
|
.dbx-grid-th {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-1;
|
|
width: 100%;
|
|
min-height: $control-md;
|
|
padding: 0 $space-3;
|
|
background: transparent;
|
|
border: none;
|
|
color: inherit;
|
|
font: inherit;
|
|
font-weight: $font-weight-semibold;
|
|
cursor: pointer;
|
|
text-align: left;
|
|
&:hover { color: $text-primary; }
|
|
svg { color: $accent-primary; }
|
|
}
|
|
.dbx-grid-th-name { @include dbx-trunc; }
|
|
|
|
tbody td {
|
|
max-width: 380px;
|
|
padding: $space-tight $space-3;
|
|
border-bottom: 1px solid $border-subtle;
|
|
border-right: 1px solid $border-subtle;
|
|
color: $text-primary;
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
@include dbx-trunc;
|
|
&:last-child { border-right: none; }
|
|
&.is-null { color: $text-tertiary; font-style: italic; }
|
|
&.is-strv { color: $success; }
|
|
&.is-pos { color: $success; }
|
|
&.is-neg { color: $warning; }
|
|
}
|
|
|
|
tbody tr:hover td { background: $bg-hover; }
|
|
|
|
.dbx-grid-rownum {
|
|
position: sticky;
|
|
left: 0;
|
|
z-index: 1;
|
|
min-width: 44px;
|
|
width: 44px;
|
|
text-align: right;
|
|
color: $text-tertiary;
|
|
background: $bg-elevated;
|
|
border-right: 1px solid $border-default;
|
|
font-size: $text-xs;
|
|
user-select: none;
|
|
}
|
|
thead .dbx-grid-rownum { z-index: 2; }
|
|
tbody tr:hover .dbx-grid-rownum { background: $bg-tertiary; }
|
|
}
|
|
|
|
// A converted table inside the workspace: the chrome above it stays put and
|
|
// the rows scroll under a pinned header, which is what the hand-rolled
|
|
// tables did with their own sticky <thead>.
|
|
.dbx-pane-scroll {
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow: auto;
|
|
|
|
.sk-dtable thead th {
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 2;
|
|
background: $bg-elevated;
|
|
}
|
|
}
|
|
|
|
.dbx-pk { color: $color-star; flex-shrink: 0; }
|
|
|
|
.dbx-engine-tag {
|
|
align-items: center;
|
|
height: 20px; // geometry: badge height (20px badge spec)
|
|
display: inline-flex;
|
|
padding: 0 $space-tight;
|
|
border-radius: $radius-badge;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
&.is-mysql { background: fade($color-mysql, 16%); color: $color-mysql; }
|
|
&.is-postgresql { background: fade($color-postgresql, 20%); color: $color-postgresql-secondary; }
|
|
}
|
|
|
|
.dbx-grid-actions { text-align: right; }
|
|
|
|
.dbx-grid-status,
|
|
.dbx-grid-error,
|
|
.dbx-structure-fallback { flex: 1; min-height: 0; }
|
|
|
|
.dbx-grid-status { display: flex; align-items: center; justify-content: center; width: 100%; }
|
|
|
|
.dbx-grid-error {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: $space-2;
|
|
padding: $space-4;
|
|
margin: $space-4;
|
|
background: $danger-bg;
|
|
border: 1px solid $danger-border;
|
|
border-radius: $radius-control;
|
|
color: $danger;
|
|
font-size: $text-xs;
|
|
svg { flex-shrink: 0; margin-top: 2px; }
|
|
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: $font-mono; font-size: $text-xs; }
|
|
}
|
|
|
|
.dbx-structure-fallback { padding: $space-6; color: $text-secondary; font-size: $text-xs; }
|
|
|
|
// ─── Backups tab ──────────────────────────────────────
|
|
.dbx-backups {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
min-height: 0;
|
|
padding: $space-3;
|
|
}
|
|
|
|
// ─── Status bar ───────────────────────────────────────
|
|
.dbx-statusbar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: $space-3;
|
|
min-height: 32px; // geometry: fixed status-bar chrome
|
|
padding: $space-1 $space-3;
|
|
background: $bg-card;
|
|
border-top: 1px solid $border-default;
|
|
flex-shrink: 0;
|
|
flex-wrap: wrap;
|
|
}
|
|
.dbx-statusbar-left, .dbx-statusbar-right { display: flex; align-items: center; gap: $space-3; flex-wrap: wrap; }
|
|
|
|
.dbx-status-item {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
font-size: $text-xs;
|
|
color: $text-secondary;
|
|
svg { color: $text-tertiary; }
|
|
&.is-write { color: $warning; font-weight: $font-weight-medium; }
|
|
&.dbx-status-muted { color: $text-tertiary; }
|
|
|
|
// Green "● Connected" segment (matches the prototype status bar)
|
|
&.is-connected {
|
|
color: $success;
|
|
font-family: $font-mono;
|
|
&::before {
|
|
content: '';
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: $radius-full;
|
|
background: currentColor;
|
|
}
|
|
}
|
|
}
|
|
|
|
// ─── Engine install affordances (tree) ────────────────
|
|
// A "+" that only surfaces on the row you are pointing at, so the tree stays
|
|
// a tree until you reach for it.
|
|
.dbx-tree-add {
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 18px;
|
|
height: 18px;
|
|
padding: 0;
|
|
background: $bg-tertiary;
|
|
border: none;
|
|
border-radius: $radius-badge;
|
|
color: $text-tertiary;
|
|
cursor: pointer;
|
|
opacity: 0;
|
|
transition: opacity $transition-fast, background $transition-fast, color $transition-fast;
|
|
|
|
&:hover { background: $accent-primary; color: #fff; }
|
|
}
|
|
.dbx-tree-row:hover .dbx-tree-add,
|
|
.dbx-tree-row:focus-within .dbx-tree-add { opacity: 1; }
|
|
|
|
// Unlike the "+", this one is always visible: an engine you cannot install
|
|
// is the whole problem, so the way out must not be hidden behind a hover.
|
|
.dbx-tree-install-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-1;
|
|
flex-shrink: 0;
|
|
height: 20px; // geometry: inline action inside a dense tree row (badge-sized)
|
|
padding: 0 $space-2;
|
|
background: $accent-glow;
|
|
border: 1px solid transparent;
|
|
border-radius: $radius-control;
|
|
color: $accent-primary;
|
|
font-family: inherit;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
transition: background $transition-fast, color $transition-fast, border-color $transition-fast;
|
|
|
|
&:hover { background: $accent-primary; color: $bg-card; border-color: $accent-primary; }
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
|
|
.dbx-tree-status.is-installing { color: $warning; }
|
|
.dbx-tree-status.is-failed { color: $danger; }
|
|
.dbx-tree-row.is-installing .dbx-tree-label { color: $warning; }
|
|
|
|
// The last row of the tree: how you get an engine the tree doesn't list.
|
|
// Dashed, because it adds to the tree rather than being part of it.
|
|
.dbx-tree-install {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
width: 100%;
|
|
margin: $space-2 0 $space-1;
|
|
min-height: $control-md;
|
|
padding: 0 $space-3;
|
|
background: transparent;
|
|
border: 1px dashed $border-active;
|
|
border-radius: $radius-control;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
transition: color $transition-fast, border-color $transition-fast, background $transition-fast;
|
|
|
|
&:hover {
|
|
color: $accent-primary;
|
|
border-color: $accent-primary;
|
|
background: $accent-glow;
|
|
}
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
|
|
// How many engines the catalog behind that row actually holds.
|
|
.dbx-tree-install-count {
|
|
margin-left: auto;
|
|
flex-shrink: 0;
|
|
font-size: $text-xs;
|
|
color: $text-tertiary;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
// ─── Main-pane blank states ───────────────────────────
|
|
// Reachable three ways: an engine mid-install, an engine that is up but
|
|
// empty, a database with nothing in it.
|
|
.dbx-blank {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
text-align: center;
|
|
padding: $space-8 $space-5;
|
|
|
|
&__icon {
|
|
position: relative;
|
|
display: grid;
|
|
place-items: center;
|
|
width: 52px;
|
|
height: 52px;
|
|
margin-bottom: $space-4;
|
|
background: $bg-elevated;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-card;
|
|
color: $text-secondary;
|
|
|
|
&.is-failed { border-color: $danger-border; color: $danger; }
|
|
}
|
|
|
|
// The ring turns the engine glyph itself into the progress indicator,
|
|
// rather than parking a second spinner beside it.
|
|
&__spin {
|
|
position: absolute;
|
|
inset: -7px;
|
|
width: auto;
|
|
height: auto;
|
|
color: $warning;
|
|
}
|
|
|
|
&__title {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
margin: 0;
|
|
font-size: $text-lg;
|
|
font-weight: $font-weight-semibold;
|
|
color: $text-primary;
|
|
}
|
|
|
|
&__body {
|
|
max-width: 46ch;
|
|
margin: $space-2 0 0;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
line-height: 1.6;
|
|
|
|
code {
|
|
padding: 1px $space-tight;
|
|
border-radius: $radius-badge;
|
|
background: $bg-tertiary;
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
color: $text-primary;
|
|
}
|
|
}
|
|
|
|
&__actions {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
gap: $space-2;
|
|
margin-top: $space-5;
|
|
}
|
|
|
|
&__note {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
max-width: 46ch;
|
|
margin: $space-5 0 0;
|
|
font-size: $text-xs;
|
|
color: $text-tertiary;
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
}
|
|
|
|
// ─── Context menu ─────────────────────────────────────
|
|
.dbx-context {
|
|
position: fixed;
|
|
min-width: 200px;
|
|
padding: $space-1;
|
|
background: $bg-card;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
box-shadow: $shadow-raised;
|
|
z-index: $z-tooltip;
|
|
animation: dbx-pop 0.12s $ease-out-quart;
|
|
|
|
button {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
width: 100%;
|
|
padding: $space-2 $space-3;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: $radius-badge;
|
|
color: $text-primary;
|
|
font-size: $text-xs;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
transition: background $transition-fast;
|
|
&:hover { background: $bg-hover; }
|
|
&.is-danger { color: $danger; }
|
|
&.is-danger:hover { background: $danger-bg; }
|
|
svg { flex-shrink: 0; opacity: 0.85; }
|
|
}
|
|
}
|
|
}
|
|
|
|
// Honor reduced-motion: drop the entrance animations and spinners.
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.db-explorer {
|
|
.dbx-context { animation: none; }
|
|
.dbx-spin { animation: none; }
|
|
}
|
|
}
|
|
|
|
// ============================================
|
|
// ENGINE CATALOG & INSTALL (drawer + modal chrome)
|
|
//
|
|
// Everything below renders inside a Radix portal — a drawer or a modal is NOT a
|
|
// descendant of `.db-explorer`, so these rules must live at the top level or
|
|
// they simply never reach the markup. Same `dbx-` namespace, different host.
|
|
// ============================================
|
|
|
|
// The portalled half of the spinner: @keyframes bubble to the top level, the
|
|
// class that uses them does not.
|
|
.dbx-spin { animation: dbx-spin 1s linear infinite; }
|
|
|
|
.dbx-drawer {
|
|
// Three stacked regions inside the sheet body — filters, scroller, footer —
|
|
// so the footer stays put while the catalog scrolls under it.
|
|
&__shell {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
min-height: 0;
|
|
}
|
|
|
|
&__scroll {
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow-y: auto;
|
|
padding: $space-4 $space-5 $space-6;
|
|
}
|
|
|
|
&__lead {
|
|
margin: 0 0 $space-4;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
line-height: 1.55;
|
|
}
|
|
|
|
&__foot {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
flex-shrink: 0;
|
|
padding: $space-3 $space-5;
|
|
border-top: 1px solid $border-subtle;
|
|
background: $bg-elevated;
|
|
|
|
.btn:first-child { margin-right: auto; }
|
|
&--split { justify-content: space-between; }
|
|
}
|
|
|
|
&__footnote {
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
// A drawer is not inside a page form, so its bare controls have no styling
|
|
// to inherit — give them the panel's own instead of the browser's.
|
|
select {
|
|
width: 100%;
|
|
padding: $space-2 $space-3;
|
|
background: $bg-elevated;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
color: $text-primary;
|
|
font-family: inherit;
|
|
font-size: $text-xs;
|
|
cursor: pointer;
|
|
|
|
&:focus {
|
|
outline: none;
|
|
border-color: $accent-primary;
|
|
box-shadow: $focus-ring;
|
|
}
|
|
}
|
|
}
|
|
|
|
// ─── Fields ───────────────────────────────────────────────
|
|
.dbx-field {
|
|
margin-bottom: $space-4;
|
|
&:last-child { margin-bottom: 0; }
|
|
|
|
&__label {
|
|
display: block;
|
|
margin-bottom: $space-2;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
}
|
|
|
|
&__optional { color: $text-tertiary; font-weight: $font-weight-normal; }
|
|
}
|
|
|
|
.dbx-field-row {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: $space-3;
|
|
align-items: start;
|
|
}
|
|
|
|
.dbx-field-hint {
|
|
margin: $space-tight 0 0;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
line-height: 1.5;
|
|
|
|
code {
|
|
padding: 1px $space-tight;
|
|
border-radius: $radius-badge;
|
|
background: $bg-tertiary;
|
|
font-family: $font-mono;
|
|
color: $text-secondary;
|
|
}
|
|
}
|
|
|
|
.dbx-input {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
min-height: $control-md;
|
|
padding: 0 $space-3;
|
|
background: $bg-elevated;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
transition: border-color $transition-fast, box-shadow $transition-fast;
|
|
|
|
&:focus-within {
|
|
border-color: $accent-primary;
|
|
box-shadow: $focus-ring;
|
|
}
|
|
|
|
> svg { flex-shrink: 0; color: $text-tertiary; }
|
|
|
|
input {
|
|
flex: 1;
|
|
min-width: 0;
|
|
background: none;
|
|
border: none;
|
|
outline: none;
|
|
color: $text-primary;
|
|
font-size: $text-xs;
|
|
&::placeholder { color: $text-tertiary; }
|
|
}
|
|
}
|
|
|
|
.dbx-inline-link {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
padding: 0;
|
|
background: none;
|
|
border: none;
|
|
color: $accent-primary;
|
|
font-size: $text-xs;
|
|
text-decoration: none;
|
|
cursor: pointer;
|
|
|
|
&:hover:not(:disabled) { text-decoration: underline; }
|
|
&:disabled { opacity: 0.6; cursor: default; }
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
|
|
// ─── Key / value facts ────────────────────────────────────
|
|
// InfoList rows boxed for the drawer; the option list reuses the row look.
|
|
.dbx-kv {
|
|
margin: 0;
|
|
gap: 0;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
overflow: hidden;
|
|
|
|
&__ok { color: $success; }
|
|
}
|
|
|
|
.dbx-kv,
|
|
.dbx-optlist {
|
|
.info-item {
|
|
gap: $space-3;
|
|
padding: $space-2 $space-3;
|
|
border-bottom: none;
|
|
|
|
.info-label {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
flex-shrink: 0;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
svg { color: $text-tertiary; }
|
|
}
|
|
|
|
.info-value {
|
|
min-width: 0;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-normal;
|
|
text-align: right;
|
|
|
|
&.mono {
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
word-break: break-all;
|
|
}
|
|
}
|
|
|
|
.info-value.dbx-kv__ok { color: $success; }
|
|
}
|
|
}
|
|
|
|
.dbx-kv .info-item + .info-item { border-top: 1px solid $border-subtle; }
|
|
|
|
// The password is the one thing on the panel you cannot recover later, so it
|
|
// gets reveal, regenerate and copy in the same row.
|
|
.dbx-secret {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
gap: $space-tight;
|
|
min-width: 0;
|
|
}
|
|
|
|
.dbx-icon-xs {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 24px;
|
|
height: 24px; // geometry: inline icon button inside a 32px compact grid cell
|
|
padding: 0;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: $radius-badge;
|
|
color: $text-tertiary;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
transition: background $transition-fast, color $transition-fast;
|
|
|
|
&:hover:not(:disabled) { background: $bg-tertiary; color: $text-primary; }
|
|
&:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
}
|
|
|
|
// ─── Option rows + the public-port warning ────────────────
|
|
.dbx-optlist {
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
overflow: hidden;
|
|
|
|
> * + * { border-top: 1px solid $border-subtle; }
|
|
}
|
|
|
|
.dbx-opt-row {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: $space-4;
|
|
padding: $space-3 $space-3;
|
|
|
|
&__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
&__title { color: $text-primary; font-size: $text-xs; font-weight: $font-weight-medium; }
|
|
&__sub { color: $text-tertiary; font-size: $text-xs; line-height: 1.45; }
|
|
}
|
|
|
|
// Not decorative. A public database port is the single most consequential thing
|
|
// this drawer can do, so it is called out in warning colour every time.
|
|
.dbx-warn-line {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: $space-2;
|
|
margin: $space-3 0 0;
|
|
padding: $space-3 $space-3;
|
|
background: $warning-bg;
|
|
border: 1px solid $warning-border;
|
|
border-radius: $radius-control;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
line-height: 1.55;
|
|
|
|
svg { flex-shrink: 0; margin-top: 1px; color: $warning; }
|
|
}
|
|
|
|
.dbx-result-lead {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: $space-2;
|
|
margin-bottom: $space-4;
|
|
padding: $space-3 $space-3;
|
|
background: $success-bg;
|
|
border: 1px solid $success-border;
|
|
border-radius: $radius-control;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
line-height: 1.55;
|
|
|
|
svg { flex-shrink: 0; margin-top: 2px; color: $success; }
|
|
}
|
|
|
|
// ─── Catalog: filters, rows, cards ────────────────────────
|
|
.dbx-eng-filters {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: $space-2;
|
|
flex-shrink: 0;
|
|
padding: $space-3 $space-5;
|
|
background: $bg-elevated;
|
|
border-bottom: 1px solid $border-subtle;
|
|
}
|
|
|
|
.dbx-eng-search { flex: 1 1 auto; width: 100%; }
|
|
|
|
.dbx-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
|
|
.dbx-cat-chip {
|
|
padding: $space-1 $space-3;
|
|
background: $bg-tertiary;
|
|
border: 1px solid transparent;
|
|
border-radius: $radius-full;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
cursor: pointer;
|
|
transition: background $transition-fast, color $transition-fast, border-color $transition-fast;
|
|
|
|
&:hover { color: $text-primary; }
|
|
&.is-on {
|
|
background: $accent-glow;
|
|
border-color: $accent-primary;
|
|
color: $accent-primary;
|
|
}
|
|
}
|
|
|
|
.dbx-eng-section { margin-bottom: $space-6; &:last-child { margin-bottom: 0; } }
|
|
|
|
.dbx-eyebrow {
|
|
margin: 0 0 $space-2;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-semibold;
|
|
}
|
|
|
|
.dbx-eng-glyph {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 24px;
|
|
height: 24px; // geometry: engine glyph icon
|
|
flex-shrink: 0;
|
|
color: $text-secondary;
|
|
}
|
|
|
|
.dbx-eng-img { object-fit: contain; border-radius: 3px; }
|
|
|
|
.dbx-eng-rowtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
|
|
|
|
.dbx-eng-name {
|
|
color: $text-primary;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
@include dbx-trunc;
|
|
}
|
|
|
|
.dbx-eng-sub {
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
@include dbx-trunc;
|
|
}
|
|
|
|
.dbx-eng-badge {
|
|
height: 20px; // geometry: badge height (20px badge spec)
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: $space-tight;
|
|
flex-shrink: 0;
|
|
padding: 0 $space-tight;
|
|
border-radius: $radius-badge;
|
|
font-size: $text-xs;
|
|
|
|
&.is-running { color: $success; background: $success-bg; }
|
|
&.is-installing { color: $warning; background: $warning-bg; }
|
|
&.is-failed { color: $danger; background: $danger-bg; }
|
|
&.is-stopped { color: $text-tertiary; background: $bg-tertiary; }
|
|
}
|
|
|
|
.dbx-eng-list {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.dbx-eng-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-3;
|
|
padding: $space-3 $space-3;
|
|
border-top: 1px solid $border-subtle;
|
|
&:first-child { border-top: none; }
|
|
}
|
|
|
|
// ─── Engine picker (create-database modal) ────────────────
|
|
.dbx-eng-pick {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
|
|
gap: $space-2;
|
|
}
|
|
|
|
.dbx-eng-opt {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
min-width: 0;
|
|
padding: $space-2 $space-3;
|
|
background: $bg-elevated;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
transition: border-color $transition-fast, background $transition-fast;
|
|
|
|
&:hover:not(:disabled) { border-color: $border-active; background: $bg-hover; }
|
|
&.is-on { border-color: $accent-primary; background: $accent-glow; }
|
|
&:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
&--ghost { border-style: dashed; color: $text-tertiary; }
|
|
|
|
&__ico {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 22px;
|
|
flex-shrink: 0;
|
|
color: $text-secondary;
|
|
|
|
&.is-mysql { color: $color-mysql; }
|
|
&.is-postgresql { color: $color-postgresql; }
|
|
}
|
|
|
|
&__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
&__name {
|
|
color: $text-primary;
|
|
font-size: $text-xs;
|
|
font-weight: $font-weight-medium;
|
|
@include dbx-trunc;
|
|
}
|
|
&__sub { color: $text-tertiary; font-size: $text-xs; }
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.dbx-spin { animation: none; }
|
|
}
|
|
|
|
// ============================================
|
|
// TABLE BUILDER & DUMP IMPORT (portalled modals)
|
|
//
|
|
// Both live in a Radix portal, like the catalog above — top-level rules only.
|
|
// ============================================
|
|
|
|
// ─── Shared: select, notices, statement preview ───────────
|
|
// Radix select triggers in the builder and import modals.
|
|
.dbx-select.ui-select-trigger {
|
|
width: 100%;
|
|
|
|
&.dbx-select--sm {
|
|
height: auto;
|
|
min-width: 0;
|
|
padding: $space-tight $space-2;
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
}
|
|
}
|
|
|
|
// Compact variant of the shared .dbx-input, for the column grid's cells.
|
|
.dbx-input--sm {
|
|
min-height: $control-sm;
|
|
padding: 0 $space-2;
|
|
input {
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
}
|
|
}
|
|
|
|
// One notice shape, five tones. Every one of them says something the operator
|
|
// has to act on, so none of them are decorative.
|
|
.dbx-notice {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: $space-2;
|
|
margin-bottom: $space-4;
|
|
padding: $space-3 $space-3;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
background: $bg-elevated;
|
|
color: $text-secondary;
|
|
font-size: $text-xs;
|
|
line-height: 1.55;
|
|
|
|
> svg { flex-shrink: 0; margin-top: 2px; color: $text-tertiary; }
|
|
> div { min-width: 0; }
|
|
|
|
strong {
|
|
display: block;
|
|
color: $text-primary;
|
|
font-weight: $font-weight-semibold;
|
|
}
|
|
|
|
p { margin: 2px 0 0; }
|
|
.dbx-inline-link { margin-top: 6px; }
|
|
|
|
&--info {
|
|
background: $info-bg;
|
|
border-color: $info-border;
|
|
> svg { color: $info; }
|
|
}
|
|
|
|
&--warn {
|
|
background: $warning-bg;
|
|
border-color: $warning-border;
|
|
> svg { color: $warning; }
|
|
}
|
|
|
|
&--danger,
|
|
&--error {
|
|
background: $danger-bg;
|
|
border-color: $danger-border;
|
|
> svg { color: $danger; }
|
|
}
|
|
|
|
&--ok {
|
|
background: $success-bg;
|
|
border-color: $success-border;
|
|
> svg { color: $success; }
|
|
}
|
|
|
|
&__detail {
|
|
margin: $space-tight 0 0;
|
|
padding: $space-2 $space-3;
|
|
max-height: 160px;
|
|
overflow: auto;
|
|
background: var(--bg-code);
|
|
border-radius: $radius-badge;
|
|
color: var(--text-code);
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
line-height: 1.5;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
}
|
|
|
|
// The statement, exactly as it will be sent. Terminal surface on purpose: this
|
|
// is the safety story of the whole builder, so it must not read as prose.
|
|
.dbx-sqlprev {
|
|
margin: 0;
|
|
padding: $space-3 $space-3;
|
|
max-height: 220px;
|
|
overflow: auto;
|
|
background: var(--bg-code);
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
color: var(--text-code);
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
line-height: 1.65;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
|
|
// Blocking problems, listed in the order they would be fixed.
|
|
.dbx-issues {
|
|
list-style: none;
|
|
margin: 0 0 $space-4;
|
|
padding: 0;
|
|
|
|
li {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: $space-2;
|
|
padding: $space-1 0;
|
|
color: $danger;
|
|
font-size: $text-xs;
|
|
line-height: 1.5;
|
|
|
|
svg { flex-shrink: 0; margin-top: 2px; }
|
|
}
|
|
}
|
|
|
|
// ─── Table builder ────────────────────────────────────────
|
|
.dbx-builder {
|
|
// The modal body owns the bottom padding; a trailing field margin would
|
|
// double it.
|
|
> *:last-child { margin-bottom: 0; }
|
|
|
|
.dbx-field-row {
|
|
margin-bottom: $space-4;
|
|
.dbx-field { margin-bottom: 0; }
|
|
}
|
|
|
|
&__loading {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
margin: 0;
|
|
padding: $space-6 0;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
}
|
|
|
|
&__target {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
margin: -$space-2 0 $space-4;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
line-height: 1.5;
|
|
|
|
code {
|
|
padding: 1px $space-tight;
|
|
border-radius: $radius-badge;
|
|
background: $bg-tertiary;
|
|
font-family: $font-mono;
|
|
color: $text-secondary;
|
|
}
|
|
}
|
|
|
|
&__target-ico {
|
|
display: inline-flex;
|
|
flex-shrink: 0;
|
|
color: $text-secondary;
|
|
}
|
|
}
|
|
|
|
.dbx-colgrid {
|
|
&__head,
|
|
&__row {
|
|
display: grid;
|
|
grid-template-columns: 1.4fr 1.3fr 34px 52px 1fr 26px;
|
|
gap: $space-2;
|
|
align-items: center;
|
|
}
|
|
|
|
&__head {
|
|
padding: 0 $space-hair $space-tight;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
}
|
|
|
|
&__rows {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: $space-tight;
|
|
}
|
|
|
|
&__add {
|
|
margin-top: $space-2;
|
|
font-size: $text-xs;
|
|
}
|
|
}
|
|
|
|
// Checkbox drawn as a square button, so a whole column of them lines up with
|
|
// the grid's other cells instead of inheriting the browser's checkbox metrics.
|
|
.dbx-cbox {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 22px;
|
|
height: 22px; // geometry: drawn checkbox sized to the compact grid cell
|
|
padding: 0;
|
|
background: transparent;
|
|
border: 1.5px solid $border-active;
|
|
border-radius: $radius-badge;
|
|
color: $white;
|
|
cursor: pointer;
|
|
transition: background $transition-fast, border-color $transition-fast;
|
|
|
|
&:hover { border-color: $accent-primary; }
|
|
&:focus-visible { outline: 2px solid $accent-primary; outline-offset: 2px; }
|
|
&.is-on { background: $accent-primary; border-color: $accent-primary; }
|
|
}
|
|
|
|
// ─── Dump import ──────────────────────────────────────────
|
|
.dbx-import {
|
|
> *:last-child { margin-bottom: 0; }
|
|
}
|
|
|
|
.dbx-choice {
|
|
margin-bottom: $space-3;
|
|
}
|
|
|
|
.dbx-dumps {
|
|
display: flex;
|
|
flex-direction: column;
|
|
max-height: 210px;
|
|
overflow-y: auto;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
|
|
&__empty {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
margin: 0;
|
|
padding: $space-4;
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
line-height: 1.5;
|
|
|
|
svg { flex-shrink: 0; }
|
|
}
|
|
}
|
|
|
|
.dbx-dump {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-3;
|
|
padding: $space-2 $space-3;
|
|
background: transparent;
|
|
border: none;
|
|
border-top: 1px solid $border-subtle;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
transition: background $transition-fast;
|
|
|
|
&:first-child { border-top: none; }
|
|
&:hover { background: $bg-hover; }
|
|
&:focus-visible { outline: 2px solid $accent-primary; outline-offset: -2px; }
|
|
&.is-on { background: $accent-glow; }
|
|
|
|
&__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
|
|
|
|
&__name {
|
|
color: $text-primary;
|
|
font-family: $font-mono;
|
|
font-size: $text-xs;
|
|
@include dbx-trunc;
|
|
}
|
|
|
|
&__meta {
|
|
color: $text-tertiary;
|
|
font-size: $text-xs;
|
|
@include dbx-trunc;
|
|
}
|
|
|
|
&__tag {
|
|
flex-shrink: 0;
|
|
padding: $space-hair $space-2;
|
|
border-radius: $radius-badge;
|
|
font-size: $text-xs;
|
|
background: $bg-tertiary;
|
|
color: $text-tertiary;
|
|
|
|
&.is-mysql { background: fade($color-mysql, 16%); color: $color-mysql; }
|
|
&.is-postgresql { background: fade($color-postgresql, 20%); color: $color-postgresql-secondary; }
|
|
}
|
|
}
|
|
|
|
.dbx-check {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: $space-2;
|
|
margin-bottom: $space-4;
|
|
padding: $space-3 $space-3;
|
|
border: 1px solid $border-default;
|
|
border-radius: $radius-control;
|
|
cursor: pointer;
|
|
|
|
input { margin-top: 2px; flex-shrink: 0; accent-color: $accent-primary; }
|
|
> span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
|
|
&__title { color: $text-primary; font-size: $text-xs; font-weight: $font-weight-medium; }
|
|
&__sub { color: $text-tertiary; font-size: $text-xs; line-height: 1.45; }
|
|
}
|
|
|
|
// A label may name an identifier the operator has to retype — give it the same
|
|
// code treatment the hints get.
|
|
.dbx-field__label code {
|
|
padding: 1px $space-tight;
|
|
border-radius: $radius-badge;
|
|
background: $bg-tertiary;
|
|
font-family: $font-mono;
|
|
color: $text-secondary;
|
|
}
|
|
|
|
// ============================================
|
|
// MANAGED DATABASES (modal panel)
|
|
// ============================================
|
|
.managed-db {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: $spacing-md;
|
|
|
|
&__head {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
justify-content: space-between;
|
|
gap: $spacing-md;
|
|
}
|
|
|
|
&__hint {
|
|
font-size: $text-sm;
|
|
color: var(--text-dim);
|
|
line-height: 1.5;
|
|
margin: 0;
|
|
}
|
|
|
|
&__empty {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $space-2;
|
|
font-size: $text-sm;
|
|
color: var(--text-faint);
|
|
padding: $spacing-lg 0;
|
|
}
|
|
|
|
&__list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
&__item {
|
|
border-top: 1px solid var(--border-soft);
|
|
|
|
&:first-child { border-top: none; }
|
|
}
|
|
|
|
&__row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: $spacing-md;
|
|
padding: $space-3 0;
|
|
border-top: 1px solid var(--border-soft);
|
|
|
|
&:first-child { border-top: none; }
|
|
|
|
// Inside an __item wrapper the item owns the divider.
|
|
.managed-db__item > & { border-top: none; }
|
|
}
|
|
|
|
// Per-database users panel (expanded under a row)
|
|
&__users {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: $spacing-sm;
|
|
padding: 0 0 $space-3 $spacing-md;
|
|
border-left: 2px solid var(--border-soft);
|
|
margin-bottom: $space-3;
|
|
}
|
|
|
|
&__secret {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: $spacing-md;
|
|
padding: $spacing-sm;
|
|
border: 1px dashed var(--border-soft);
|
|
border-radius: $radius-control;
|
|
|
|
.sk-copy-field { flex: 1 1 220px; }
|
|
}
|
|
|
|
&__user-form {
|
|
display: flex;
|
|
gap: $space-tight;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
|
|
input {
|
|
flex: 1;
|
|
min-width: 160px;
|
|
padding: $space-tight $space-3;
|
|
font-size: $text-sm;
|
|
background: var(--bg-input, transparent);
|
|
border: 1px solid var(--border-soft);
|
|
border-radius: $radius-control;
|
|
color: var(--text);
|
|
}
|
|
}
|
|
|
|
&__info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: $space-hair;
|
|
min-width: 0;
|
|
flex: 1;
|
|
}
|
|
|
|
&__meta {
|
|
font-size: $text-xs;
|
|
color: var(--text-faint);
|
|
word-break: break-all;
|
|
}
|
|
|
|
&__actions {
|
|
display: flex;
|
|
gap: $space-tight;
|
|
flex-wrap: wrap;
|
|
justify-content: flex-end;
|
|
}
|
|
}
|
|
|
|
// "select a database" hint inside the New menu. The menu is portaled out of
|
|
// `.db-explorer`, so this rule lives at the top level.
|
|
.dbx-menu-hint {
|
|
margin-left: auto;
|
|
font-size: $text-xs;
|
|
color: $text-tertiary;
|
|
}
|
|
|
|
// Created-credentials result in the explorer's create modals: one CopyField
|
|
// per credential.
|
|
.dbx-credentials {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: $space-3;
|
|
|
|
> p { margin: 0; }
|
|
}
|