113 lines
3.4 KiB
CSS
113 lines
3.4 KiB
CSS
/* part: panel — the bordered box with an uppercase header and a status dot.
|
|
*
|
|
* USE WHEN: the page puts anything in a titled box, or needs a status light.
|
|
* NEEDS: nothing
|
|
*
|
|
* ADD: paste this into the page, then run `make theme bake`.
|
|
* <div class="panel">
|
|
* <div class="panel-header">
|
|
* <span class="panel-title">Title</span>
|
|
* <span class="panel-actions"></span>
|
|
* <span class="panel-status idle"></span>
|
|
* </div>
|
|
* <div class="panel-body">…</div>
|
|
* </div>
|
|
*
|
|
* Derived from common/ui/src/components/Panel.vue. It is the single most-reused
|
|
* thing in the framework: every consumer uses it, and nothing else is used by
|
|
* all of them.
|
|
*
|
|
* mpr/ui/detection-app 13 instantiations
|
|
* mts (meetus + doocus) 7
|
|
* unt/ui/app 4
|
|
* nvi/ui/app yes
|
|
*
|
|
* TOKENS: --surface-1 --surface-2 --panel-border --panel-radius
|
|
* --panel-header-height --font-ui --font-size-sm --text-secondary
|
|
* --space-2 --space-3 --status-idle --status-live --status-processing
|
|
* --status-error
|
|
*
|
|
* Class names are the SFC's own, unchanged. That is deliberate: mpr's React
|
|
* side already spells `.panel-header` + `<h2>` by hand
|
|
* (chunker/src/components/{ErrorLog,StatsPanel,QueueGauge}.tsx), so this part
|
|
* is adoptable there as-is. A third spelling of the same box is the disease,
|
|
* not the cure.
|
|
*
|
|
* MARKUP
|
|
* <div class="panel">
|
|
* <div class="panel-header">
|
|
* <span class="panel-title">Routes</span>
|
|
* <span class="panel-actions"><button>reload</button></span>
|
|
* <span class="panel-status live"></span>
|
|
* </div>
|
|
* <div class="panel-body">…</div>
|
|
* </div>
|
|
*
|
|
* `panel-actions` and `panel-status` are both optional. Measured before
|
|
* copying: the `actions` slot is filled in 6 of mts's 7 panels and 0 of mpr's
|
|
* 13 — so it is load-bearing and stays. The `overlay` slot is filled by NOBODY
|
|
* in any consumer, so it is not in this part. It comes back if something needs
|
|
* it, from the SFC that still has it.
|
|
*
|
|
* ONE DELIBERATE CHANGE: `.panel-body` scrolls (`overflow: auto`) where the SFC
|
|
* hides (`overflow: hidden`). In a Vue app the slotted child fills the body and
|
|
* does its own scrolling; on a plain page the body IS the content, and hidden
|
|
* silently truncates it.
|
|
*/
|
|
|
|
.panel {
|
|
position: relative;
|
|
background: var(--surface-1);
|
|
border: var(--panel-border);
|
|
border-radius: var(--panel-radius);
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.panel-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
height: var(--panel-header-height);
|
|
padding: 0 var(--space-3);
|
|
background: var(--surface-2);
|
|
border-bottom: var(--panel-border);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.panel-title {
|
|
font-family: var(--font-ui);
|
|
font-size: var(--font-size-sm);
|
|
font-weight: 600;
|
|
color: var(--text-secondary);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
}
|
|
|
|
.panel-actions {
|
|
margin-left: auto;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
}
|
|
|
|
.panel-status {
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
background: var(--status-idle);
|
|
}
|
|
.panel-status.idle { background: var(--status-idle); }
|
|
.panel-status.live { background: var(--status-live); }
|
|
.panel-status.processing { background: var(--status-processing); }
|
|
.panel-status.error { background: var(--status-error); }
|
|
|
|
.panel-body {
|
|
flex: 1;
|
|
overflow: auto;
|
|
padding: var(--space-2);
|
|
min-height: 0;
|
|
}
|