reifyui 0.7.3 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -0
- package/dist/chart.cjs +170 -0
- package/dist/chart.cjs.map +1 -0
- package/dist/chart.d.ts +57 -0
- package/dist/chart.js +138 -0
- package/dist/chart.js.map +1 -0
- package/dist/index.cjs +315 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +89 -0
- package/dist/index.js +315 -9
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
- package/src/chart/Chart.jsx +90 -0
- package/src/chart/index.d.ts +57 -0
- package/src/chart/index.js +10 -0
- package/src/chart/tokens.js +52 -0
- package/src/chart/useChartTokens.js +33 -0
- package/src/components/FilePreview.jsx +24 -16
- package/src/components/Panel.jsx +82 -0
- package/src/grid/PanelGrid.jsx +232 -0
- package/src/grid/layout.js +122 -0
- package/src/index.d.ts +89 -0
- package/src/index.js +8 -0
- package/styles/chat.css +19 -2
- package/styles/panels.css +162 -0
- package/styles/themes/dark.css +16 -0
- package/styles/themes/light.css +17 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// Grid layout math for PanelGrid — pure functions over an array of {i, x, y, w, h}.
|
|
2
|
+
//
|
|
3
|
+
// Kept separate from the component because this is the part that is easy to get wrong and easy
|
|
4
|
+
// to test: nothing here touches the DOM, React, or pixels. Coordinates are CELLS, not pixels —
|
|
5
|
+
// x/w are columns, y/h are rows. The component owns the one conversion to pixels.
|
|
6
|
+
//
|
|
7
|
+
// Gravity is up and always on. A dashboard with holes punched in it looks broken rather than
|
|
8
|
+
// deliberate, and "the panel you dropped is where you dropped it, everything else flows around
|
|
9
|
+
// it" is the only rule a person has to learn.
|
|
10
|
+
|
|
11
|
+
/** Sorted top-to-bottom, then left-to-right — the order gravity resolves in. */
|
|
12
|
+
export function sortLayout(layout) {
|
|
13
|
+
return [...layout].sort((a, b) => (a.y - b.y) || (a.x - b.x));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function overlaps(a, b) {
|
|
17
|
+
return a.i !== b.i
|
|
18
|
+
&& a.x < b.x + b.w && a.x + a.w > b.x
|
|
19
|
+
&& a.y < b.y + b.h && a.y + a.h > b.y;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function firstOverlap(placed, item) {
|
|
23
|
+
for (const p of placed) if (overlaps(p, item)) return p;
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Cell bounds an item may occupy. min defaults to 1 cell; max defaults to the whole grid. */
|
|
28
|
+
export function clampItem(item, cols) {
|
|
29
|
+
const minW = Math.max(1, item.minW || 1);
|
|
30
|
+
const minH = Math.max(1, item.minH || 1);
|
|
31
|
+
const w = Math.min(Math.max(item.w ?? minW, minW), Math.min(item.maxW || cols, cols));
|
|
32
|
+
const h = Math.max(Math.min(item.h ?? minH, item.maxH || Infinity), minH);
|
|
33
|
+
const x = Math.min(Math.max(item.x ?? 0, 0), cols - w);
|
|
34
|
+
return { ...item, x, y: Math.max(0, item.y ?? 0), w, h };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Float everything up, resolving overlaps on the way.
|
|
39
|
+
*
|
|
40
|
+
* `pinned` is the id being dragged, and it wins TIES: dropped onto the cell of a panel already
|
|
41
|
+
* there, it keeps the cell and the other one moves, instead of the panel squirting out from under
|
|
42
|
+
* the pointer because its neighbour happened to sort first. Only ties — a pin that always went
|
|
43
|
+
* first would float above the panel it was just dragged below, so nudging a panel DOWN one row
|
|
44
|
+
* could send it to the top of the board.
|
|
45
|
+
*/
|
|
46
|
+
export function compact(layout, cols, pinned) {
|
|
47
|
+
const sorted = layout.map((it) => clampItem(it, cols))
|
|
48
|
+
.sort((a, b) => (a.y - b.y) || (Number(b.i === pinned) - Number(a.i === pinned)) || (a.x - b.x));
|
|
49
|
+
const statics = sorted.filter((it) => it.static);
|
|
50
|
+
const rest = sorted.filter((it) => !it.static);
|
|
51
|
+
const placed = [...statics];
|
|
52
|
+
for (const item of rest) {
|
|
53
|
+
let y = item.y;
|
|
54
|
+
// Rise until something is in the way…
|
|
55
|
+
while (y > 0 && !firstOverlap(placed, { ...item, y: y - 1 })) y--;
|
|
56
|
+
// …and sink out of anything it is already inside (a drop, or a resize that grew downward).
|
|
57
|
+
let hit;
|
|
58
|
+
while ((hit = firstOverlap(placed, { ...item, y }))) y = hit.y + hit.h;
|
|
59
|
+
placed.push({ ...item, y });
|
|
60
|
+
}
|
|
61
|
+
// Back into the caller's order: a layout array whose order shuffles every drag makes React
|
|
62
|
+
// remount panels, and a remounted chart loses its animation and its tooltip.
|
|
63
|
+
const byId = new Map(placed.map((it) => [it.i, it]));
|
|
64
|
+
return layout.map((it) => byId.get(it.i) || it);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Move one item to a cell, then let gravity settle the rest around it. */
|
|
68
|
+
export function moveItem(layout, id, x, y, cols) {
|
|
69
|
+
const next = layout.map((it) => (it.i === id && !it.static
|
|
70
|
+
? clampItem({ ...it, x, y: Math.max(0, y) }, cols)
|
|
71
|
+
: it));
|
|
72
|
+
return compact(next, cols, id);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Move one item by one step, the way a keyboard means it.
|
|
77
|
+
*
|
|
78
|
+
* Sideways is literal. Vertically it is a SWAP with the neighbour above or below, because under
|
|
79
|
+
* gravity "down one row" is not a thing that can happen: the row it vacates closes behind it and
|
|
80
|
+
* it lands exactly where it started. A key that provably cannot move anything is a dead key, so
|
|
81
|
+
* up/down step past the panel that is blocking, and do nothing only when there is genuinely
|
|
82
|
+
* nothing to step past.
|
|
83
|
+
*/
|
|
84
|
+
export function nudgeItem(layout, id, dx, dy, cols) {
|
|
85
|
+
const item = layout.find((it) => it.i === id);
|
|
86
|
+
if (!item || item.static) return layout;
|
|
87
|
+
if (dx) return moveItem(layout, id, item.x + dx, item.y, cols);
|
|
88
|
+
const sameCols = layout.filter((o) => o.i !== id && o.x < item.x + item.w && o.x + o.w > item.x);
|
|
89
|
+
if (dy < 0) {
|
|
90
|
+
const above = sameCols.filter((o) => o.y + o.h <= item.y);
|
|
91
|
+
if (!above.length) return layout;
|
|
92
|
+
const near = above.reduce((a, b) => (a.y + a.h > b.y + b.h ? a : b));
|
|
93
|
+
return moveItem(layout, id, item.x, near.y, cols); // takes its row; it is pushed down
|
|
94
|
+
}
|
|
95
|
+
const below = sameCols.filter((o) => o.y >= item.y + item.h);
|
|
96
|
+
if (!below.length) return layout;
|
|
97
|
+
const near = below.reduce((a, b) => (a.y < b.y ? a : b));
|
|
98
|
+
return moveItem(layout, id, item.x, near.y + near.h, cols); // it floats up into the gap left
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Resize one item from its top-left corner, then settle. */
|
|
102
|
+
export function resizeItem(layout, id, w, h, cols) {
|
|
103
|
+
const next = layout.map((it) => (it.i === id && !it.static
|
|
104
|
+
? clampItem({ ...it, w, h }, cols)
|
|
105
|
+
: it));
|
|
106
|
+
return compact(next, cols, id);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Rows the layout occupies — the grid's height, which is knowable before any measurement. */
|
|
110
|
+
export function layoutRows(layout) {
|
|
111
|
+
return layout.reduce((n, it) => Math.max(n, (it.y || 0) + (it.h || 1)), 0);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** True when two layouts place every item identically — used to skip no-op commits. */
|
|
115
|
+
export function sameLayout(a, b) {
|
|
116
|
+
if (a.length !== b.length) return false;
|
|
117
|
+
const byId = new Map(b.map((it) => [it.i, it]));
|
|
118
|
+
return a.every((it) => {
|
|
119
|
+
const o = byId.get(it.i);
|
|
120
|
+
return o && o.x === it.x && o.y === it.y && o.w === it.w && o.h === it.h;
|
|
121
|
+
});
|
|
122
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -575,3 +575,92 @@ export interface SheetExportOptions {
|
|
|
575
575
|
}
|
|
576
576
|
export function sheetToDelimited(sheet: Sheet, delimiter?: string, options?: SheetExportOptions): string;
|
|
577
577
|
export function sheetToAoA(sheet: Sheet, options?: SheetExportOptions): unknown[][];
|
|
578
|
+
|
|
579
|
+
// ── boards: panels and the grid they sit in ──────────────────────────────────
|
|
580
|
+
export interface PanelProps {
|
|
581
|
+
title?: ReactNode;
|
|
582
|
+
/** Heading level, so a board fits YOUR document outline. Default 'h3'. */
|
|
583
|
+
titleAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div';
|
|
584
|
+
/** Quiet second line under the title — when it last refreshed, what it counts. */
|
|
585
|
+
meta?: ReactNode;
|
|
586
|
+
/** Controls in the header, after the title. A press on one never drags the panel. */
|
|
587
|
+
actions?: ReactNode;
|
|
588
|
+
footer?: ReactNode;
|
|
589
|
+
|
|
590
|
+
/** No content yet: the body becomes a placeholder of the same size, so a board of four
|
|
591
|
+
* requests does not reflow four times as they land. */
|
|
592
|
+
loading?: boolean;
|
|
593
|
+
/** The name a screen reader is given while loading. Default 'Loading'. */
|
|
594
|
+
loadingLabel?: string;
|
|
595
|
+
/** Content is up and being refreshed: the header shows it and the body stays readable. */
|
|
596
|
+
busy?: boolean;
|
|
597
|
+
busyLabel?: string;
|
|
598
|
+
|
|
599
|
+
/** What went wrong, verbatim — shown monospace, selectable and scrollable, because the error
|
|
600
|
+
* is the thing that lets someone fix what produced it. Wins over `children`, loses to
|
|
601
|
+
* `loading` (a retry in flight should not still show the failure it is retrying). */
|
|
602
|
+
error?: ReactNode;
|
|
603
|
+
/** The line above the message. Default 'This panel could not load'. */
|
|
604
|
+
errorTitle?: ReactNode;
|
|
605
|
+
/** Extra context under the message, folded away — e.g. the statement that failed. */
|
|
606
|
+
errorDetail?: ReactNode;
|
|
607
|
+
detailLabel?: ReactNode;
|
|
608
|
+
/** Absent → no retry control is drawn, rather than one that does nothing. */
|
|
609
|
+
onRetry?: () => void;
|
|
610
|
+
retryLabel?: ReactNode;
|
|
611
|
+
|
|
612
|
+
className?: string;
|
|
613
|
+
classNames?: { root?: string; head?: string; body?: string };
|
|
614
|
+
children?: ReactNode;
|
|
615
|
+
}
|
|
616
|
+
/** The frame around one thing on a board. Fills the cell it is given: put it in a box with a
|
|
617
|
+
* height. Its header carries `.uic-panel-head`, which is what PanelGrid drags by. */
|
|
618
|
+
export const Panel: ComponentType<PanelProps>;
|
|
619
|
+
|
|
620
|
+
/** One panel's cell. x/w are COLUMNS and y/h are ROWS — never pixels. */
|
|
621
|
+
export interface PanelLayoutItem {
|
|
622
|
+
/** Matches the child's React `key`. */
|
|
623
|
+
i: string;
|
|
624
|
+
x: number;
|
|
625
|
+
y: number;
|
|
626
|
+
w: number;
|
|
627
|
+
h: number;
|
|
628
|
+
minW?: number;
|
|
629
|
+
minH?: number;
|
|
630
|
+
maxW?: number;
|
|
631
|
+
maxH?: number;
|
|
632
|
+
/** Neither moves nor resizes, and other panels flow around it. */
|
|
633
|
+
static?: boolean;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export interface PanelGridProps {
|
|
637
|
+
layout: PanelLayoutItem[];
|
|
638
|
+
/** One element per layout entry, matched by `key`. A child with no entry is not rendered. */
|
|
639
|
+
children?: ReactNode;
|
|
640
|
+
cols?: number;
|
|
641
|
+
/** px per row. Default 40. */
|
|
642
|
+
rowHeight?: number;
|
|
643
|
+
/** px between cells. Default 12. */
|
|
644
|
+
gap?: number;
|
|
645
|
+
/** Default false: nothing drags, nothing resizes, and no handle is drawn. */
|
|
646
|
+
editable?: boolean;
|
|
647
|
+
/** Selector a press must land inside to start a move. Default '.uic-panel-head' — Panel's own
|
|
648
|
+
* header. Point it at your own element and give that element `touch-action: none`. */
|
|
649
|
+
dragHandle?: string;
|
|
650
|
+
/** Below this container width the grid becomes ONE column in layout order and stops being
|
|
651
|
+
* arrangeable. Default 640. */
|
|
652
|
+
stackAt?: number;
|
|
653
|
+
/** The resize handle's accessible name. Name the panel in it. */
|
|
654
|
+
resizeLabel?: (id: string) => string;
|
|
655
|
+
/** Fires ONCE per interaction, on release — not per pixel. The layout stays yours: nothing
|
|
656
|
+
* moves until you apply what this hands you. */
|
|
657
|
+
onLayoutChange?: (layout: PanelLayoutItem[]) => void;
|
|
658
|
+
className?: string;
|
|
659
|
+
}
|
|
660
|
+
/** A grid of panels you can drag and resize, whose read-only mode is the default. Gravity is up
|
|
661
|
+
* and always on: the panel you drop keeps the cell you dropped it in, the rest flow around it. */
|
|
662
|
+
export const PanelGrid: ComponentType<PanelGridProps>;
|
|
663
|
+
|
|
664
|
+
/** Gravity applied to a layout you built yourself. Add a panel with `y: Infinity` to put it at
|
|
665
|
+
* the bottom, then pass the array through this to turn that into a real row. */
|
|
666
|
+
export function packLayout(layout: PanelLayoutItem[], cols?: number): PanelLayoutItem[];
|
package/src/index.js
CHANGED
|
@@ -67,3 +67,11 @@ export { Popover } from './components/Popover.jsx';
|
|
|
67
67
|
// dialog host's Escape ordering and overlay layer. Needs styles/preview.css.
|
|
68
68
|
export { Modal } from './components/Modal.jsx';
|
|
69
69
|
export { useTypewriter } from './hooks/useTypewriter.js';
|
|
70
|
+
// ── boards: a grid of panels ─────────────────────────────────────────────────
|
|
71
|
+
// The frame around one thing on a board (and, crucially, the two states that thing spends most
|
|
72
|
+
// of its life in: loading, and failed-with-a-message), plus the grid that arranges them.
|
|
73
|
+
// Read-only is the default; nothing here depends on a charting library — the chart that usually
|
|
74
|
+
// goes INSIDE a panel is at reifyui/chart, so a board of tables costs nothing extra.
|
|
75
|
+
// Needs styles/panels.css (+ form.css when a panel offers a retry).
|
|
76
|
+
export { Panel } from './components/Panel.jsx';
|
|
77
|
+
export { PanelGrid, packLayout } from './grid/PanelGrid.jsx';
|
package/styles/chat.css
CHANGED
|
@@ -187,8 +187,18 @@ body.uic-resizing iframe { pointer-events: none; }
|
|
|
187
187
|
/* The panel is dense by design (13px, no turn gutter, wider bubbles) — the same three overrides
|
|
188
188
|
all four apps wrote into their :root, where they also changed every OTHER chat surface in the
|
|
189
189
|
app. Scoped to the panel, they stop leaking. */
|
|
190
|
+
/* `min-width: 0` is what makes the drag-to-resize actually resize.
|
|
191
|
+
*
|
|
192
|
+
* A flex item defaults to `min-width: auto`, which means it can never be narrower than its
|
|
193
|
+
* content's min-content width. One unbreakable string in the transcript — an agent reporting
|
|
194
|
+
* `/data/workspaces/hsess<32 hex chars>/dashboard.json` is 60 monospace characters with no break
|
|
195
|
+
* opportunity — sets a floor of ~550px on the whole pane. The width the drag computes is applied
|
|
196
|
+
* to flex-basis, the basis is then ignored, and the pane stops moving at that floor while the
|
|
197
|
+
* handle keeps following the pointer. It reads as "the drag broke", and it appears only in
|
|
198
|
+
* conversations that happen to contain a long path. */
|
|
190
199
|
.uic-chat { --uic-font-md: 13px; --uic-turn-pad-x: 0px; --uic-bubble-max-w: 88%;
|
|
191
|
-
flex: 0 0 340px; height: 100vh; display: flex; flex-direction: column;
|
|
200
|
+
flex: 0 0 340px; height: 100vh; display: flex; flex-direction: column;
|
|
201
|
+
min-height: 0; min-width: 0;
|
|
192
202
|
background: var(--uic-surface, #FFFFFF); border-left: 1px solid var(--uic-line, #DDDFE6); }
|
|
193
203
|
@media (max-width: 1180px) { .uic-chat { flex: 0 0 300px; } }
|
|
194
204
|
.uic-chat.is-collapsed { flex: 0 0 44px; }
|
|
@@ -269,7 +279,14 @@ body.uic-resizing iframe { pointer-events: none; }
|
|
|
269
279
|
.uic-chat-msg-files { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
|
|
270
280
|
|
|
271
281
|
/* ── density inside the panel: the 13px conversation ── */
|
|
272
|
-
|
|
282
|
+
/* `anywhere`, not `break-word`, and the difference is the whole bug above.
|
|
283
|
+
*
|
|
284
|
+
* Both let an unbreakable word break rather than overflow, so both LOOK like they fixed it. Only
|
|
285
|
+
* `anywhere` also reduces the element's min-content width — `break-word` leaves it reporting the
|
|
286
|
+
* full width of the longest word. That reported width is what a flex item's `min-width: auto`
|
|
287
|
+
* floors the pane at, so with `break-word` the text wrapped and the pane still would not shrink.
|
|
288
|
+
* Which is exactly what shipped: the rule was here, and the drag was stuck anyway. */
|
|
289
|
+
.uic-chat .wbx-md { overflow-wrap: anywhere; }
|
|
273
290
|
.uic-chat .wbx-md h1 { font-size: 16px; }
|
|
274
291
|
.uic-chat .wbx-md h2 { font-size: 14.5px; }
|
|
275
292
|
.uic-chat .wbx-md h3 { font-size: 13.5px; }
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/* Panels and the grid they sit in — the surface a board is made of.
|
|
2
|
+
|
|
3
|
+
Token contract: the same --uic-* set every other stylesheet here reads (styles/themes/light.css
|
|
4
|
+
or dark.css, or your own layer). New in this file: --uic-cat-1…8 (the categorical series
|
|
5
|
+
colours, also read from JS by chartTokens) and --uic-skeleton / --uic-skeleton-hi (the two
|
|
6
|
+
stops of a loading placeholder).
|
|
7
|
+
|
|
8
|
+
The last three blocks — the stat tile, the result table, the empty note — have no component and
|
|
9
|
+
should not have one: they are markup plus these rules, and a component around them would be an
|
|
10
|
+
`as` prop wrapping one div. Compose them directly, the same way styles/library.css expects its
|
|
11
|
+
shell and hero to be composed. */
|
|
12
|
+
|
|
13
|
+
/* ── the grid ───────────────────────────────────────────────────────────────
|
|
14
|
+
Positions arrive as inline left/top/width/height from PanelGrid, which owns the one conversion
|
|
15
|
+
from cells to pixels. Everything here is paint. */
|
|
16
|
+
.uic-pg { position: relative; width: 100%; }
|
|
17
|
+
.uic-pg-item { position: absolute; box-sizing: border-box;
|
|
18
|
+
transition: left .16s ease, top .16s ease, width .16s ease, height .16s ease; }
|
|
19
|
+
/* The panel under the pointer must not lag it, and must float over its neighbours as it passes. */
|
|
20
|
+
.uic-pg-item.is-moving { transition: none; z-index: 3; cursor: grabbing; }
|
|
21
|
+
.uic-pg-item.is-moving .uic-panel { box-shadow: var(--uic-shadow-2, 0 8px 24px -12px rgba(17, 24, 39, .12)); }
|
|
22
|
+
/* Where it would land. Brand-tinted rather than a colour of its own: it is a preview of a real
|
|
23
|
+
placement, not a warning. */
|
|
24
|
+
.uic-pg-ghost { position: absolute; z-index: 1; pointer-events: none;
|
|
25
|
+
border-radius: var(--uic-r-card, 12px);
|
|
26
|
+
background: var(--uic-brand-faint, #EFF3FF);
|
|
27
|
+
border: 1.5px dashed var(--uic-brand-soft, #E1E9FF); }
|
|
28
|
+
.uic-pg.is-editable .uic-panel-head { cursor: grab; touch-action: none; }
|
|
29
|
+
.uic-pg.is-editable .uic-panel-head:active { cursor: grabbing; }
|
|
30
|
+
|
|
31
|
+
.uic-pg-handle { position: absolute; right: 2px; bottom: 2px; z-index: 2;
|
|
32
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
33
|
+
width: 20px; height: 20px; padding: 0; border: none; border-radius: 5px;
|
|
34
|
+
background: transparent; color: var(--uic-mute-2, #8E9199);
|
|
35
|
+
cursor: nwse-resize; touch-action: none; opacity: 0; transition: opacity .12s ease; }
|
|
36
|
+
.uic-pg-item:hover .uic-pg-handle,
|
|
37
|
+
.uic-pg-handle:focus-visible { opacity: 1; }
|
|
38
|
+
.uic-pg-handle:focus-visible { outline: 2px solid var(--uic-brand, #285AFF); outline-offset: 1px; }
|
|
39
|
+
/* Where there is no hover there is no way to reveal it, so it is simply always there. */
|
|
40
|
+
@media (hover: none) {
|
|
41
|
+
.uic-pg-handle { opacity: 1; }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ── the panel ──────────────────────────────────────────────────────────────
|
|
45
|
+
Height comes from the grid cell, so the body is the only part that flexes and the header keeps
|
|
46
|
+
its size whatever is inside it. */
|
|
47
|
+
.uic-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden;
|
|
48
|
+
box-sizing: border-box; border-radius: var(--uic-r-card, 12px);
|
|
49
|
+
background: var(--uic-surface, #FFFFFF);
|
|
50
|
+
border: 1px solid var(--uic-line, #DDDFE6);
|
|
51
|
+
box-shadow: var(--uic-shadow-1, 0 1px 2px rgba(17, 24, 39, .04)); }
|
|
52
|
+
.uic-panel-head { flex-shrink: 0; display: flex; align-items: flex-start; gap: 10px;
|
|
53
|
+
padding: 10px 12px 8px; min-height: 0; }
|
|
54
|
+
.uic-panel-titles { flex: 1; min-width: 0; }
|
|
55
|
+
/* Truncates rather than wrapping to a second line: a panel's height is a layout decision, and a
|
|
56
|
+
long title must not quietly take a row of the chart. */
|
|
57
|
+
.uic-panel-title { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35;
|
|
58
|
+
color: var(--uic-ink, #111317);
|
|
59
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
60
|
+
.uic-panel-meta { margin: 2px 0 0; font-size: 11.5px; line-height: 1.35;
|
|
61
|
+
color: var(--uic-mute, #5B5D66);
|
|
62
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
63
|
+
.uic-panel-acts { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
|
|
64
|
+
.uic-panel-body { flex: 1; min-height: 0; padding: 0 12px 12px; overflow: hidden; }
|
|
65
|
+
.uic-panel-foot { flex-shrink: 0; padding: 8px 12px; font-size: 11.5px;
|
|
66
|
+
color: var(--uic-mute, #5B5D66); border-top: 1px solid var(--uic-line-soft, #EFF1F4); }
|
|
67
|
+
|
|
68
|
+
/* A refresh in progress. One indeterminate line — nothing here knows how far along it is. */
|
|
69
|
+
.uic-panel-busy { flex-shrink: 0; height: 2px; overflow: hidden;
|
|
70
|
+
background: var(--uic-line-soft, #EFF1F4); }
|
|
71
|
+
.uic-panel-busy::after { content: ''; display: block; width: 40%; height: 100%;
|
|
72
|
+
background: var(--uic-brand, #285AFF); animation: uic-panel-slide 1.1s ease-in-out infinite; }
|
|
73
|
+
@keyframes uic-panel-slide {
|
|
74
|
+
0% { transform: translateX(-100%); }
|
|
75
|
+
100% { transform: translateX(350%); }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ── loading: hold the box, promise nothing ─────────────────────────────────
|
|
79
|
+
Grey bars, not a spinner and not a number: the shape says "content is coming", and there is no
|
|
80
|
+
honest way to say how much or how soon. */
|
|
81
|
+
.uic-panel-load { display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
|
|
82
|
+
height: 100%; padding: 12px 0 4px; }
|
|
83
|
+
.uic-panel-load-bar { display: block; border-radius: 4px;
|
|
84
|
+
background: linear-gradient(90deg,
|
|
85
|
+
var(--uic-skeleton, rgba(17, 24, 39, .06)) 25%,
|
|
86
|
+
var(--uic-skeleton-hi, rgba(17, 24, 39, .11)) 37%,
|
|
87
|
+
var(--uic-skeleton, rgba(17, 24, 39, .06)) 63%);
|
|
88
|
+
background-size: 400% 100%; animation: uic-panel-shimmer 1.4s ease infinite; }
|
|
89
|
+
.uic-panel-load-bar:nth-child(1) { height: 34%; }
|
|
90
|
+
.uic-panel-load-bar:nth-child(2) { height: 58%; }
|
|
91
|
+
.uic-panel-load-bar:nth-child(3) { height: 24%; }
|
|
92
|
+
@keyframes uic-panel-shimmer {
|
|
93
|
+
0% { background-position: 100% 50%; }
|
|
94
|
+
100% { background-position: 0 50%; }
|
|
95
|
+
}
|
|
96
|
+
@media (prefers-reduced-motion: reduce) {
|
|
97
|
+
.uic-panel-load-bar { animation: none; }
|
|
98
|
+
.uic-panel-busy::after { animation: none; width: 100%; opacity: .5; }
|
|
99
|
+
.uic-pg-item { transition: none; }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ── failed: show the error, verbatim ───────────────────────────────────────
|
|
103
|
+
The message is monospace, selectable and scrollable in both directions, because the whole point
|
|
104
|
+
of showing it is that someone can read it precisely and copy it into the thing that broke. */
|
|
105
|
+
.uic-panel-fail { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0;
|
|
106
|
+
padding-top: 4px; }
|
|
107
|
+
.uic-panel-fail-t { margin: 0; flex-shrink: 0; font-size: 12.5px; font-weight: 600;
|
|
108
|
+
color: var(--uic-fail-ink, #B91C1C); }
|
|
109
|
+
.uic-panel-fail-m { margin: 0; flex: 1; min-height: 0; overflow: auto;
|
|
110
|
+
padding: 8px 10px; border-radius: var(--uic-r-input, 8px);
|
|
111
|
+
font-family: var(--uic-mono, ui-monospace, Menlo, monospace); font-size: 11.5px; line-height: 1.5;
|
|
112
|
+
white-space: pre-wrap; overflow-wrap: anywhere; user-select: text;
|
|
113
|
+
color: var(--uic-ink-2, #3A3D45);
|
|
114
|
+
background: var(--uic-fail-bg, #FEF2F2);
|
|
115
|
+
border: 1px solid var(--uic-fail-line, #FECACA); }
|
|
116
|
+
.uic-panel-fail-d { flex-shrink: 0; font-size: 11.5px; color: var(--uic-mute, #5B5D66); }
|
|
117
|
+
.uic-panel-fail-d > summary { cursor: pointer; }
|
|
118
|
+
.uic-panel-fail-dd { margin-top: 6px; max-height: 40vh; overflow: auto;
|
|
119
|
+
font-family: var(--uic-mono, ui-monospace, Menlo, monospace); font-size: 11.5px;
|
|
120
|
+
white-space: pre-wrap; overflow-wrap: anywhere; color: var(--uic-ink-2, #3A3D45); }
|
|
121
|
+
.uic-panel-fail-act { flex-shrink: 0; }
|
|
122
|
+
|
|
123
|
+
/* ── chart box ──────────────────────────────────────────────────────────────
|
|
124
|
+
The chart fills whatever it is given; the panel decides how big that is. */
|
|
125
|
+
.uic-chart { width: 100%; height: 100%; min-height: 0; }
|
|
126
|
+
.uic-chart.is-unavailable { display: flex; align-items: center; justify-content: center;
|
|
127
|
+
text-align: center; font-size: 12px; color: var(--uic-mute, #5B5D66); }
|
|
128
|
+
|
|
129
|
+
/* ── stat tile (no component: markup + these rules) ─────────────────────────
|
|
130
|
+
<div class="uic-stat"><p class="uic-stat-v">…</p><p class="uic-stat-sub">…</p></div>
|
|
131
|
+
The value is sized in cqh so one number fills a tall tile and a short one without a second
|
|
132
|
+
font-size decision at every call site. */
|
|
133
|
+
.uic-stat { container-type: size; display: flex; flex-direction: column; align-items: flex-start;
|
|
134
|
+
justify-content: center; height: 100%; gap: 4px; }
|
|
135
|
+
.uic-stat-v { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.05;
|
|
136
|
+
font-variant-numeric: tabular-nums;
|
|
137
|
+
font-size: clamp(22px, 34cqh, 54px); color: var(--uic-ink, #111317); }
|
|
138
|
+
.uic-stat-sub { margin: 0; font-size: 12px; color: var(--uic-mute, #5B5D66); }
|
|
139
|
+
|
|
140
|
+
/* ── result table (no component) ────────────────────────────────────────────
|
|
141
|
+
Scrolls inside its own box, in both axes: a wide result must never widen the page.
|
|
142
|
+
<div class="uic-dtable"><table>…</table></div> */
|
|
143
|
+
.uic-dtable { height: 100%; min-height: 0; overflow: auto; }
|
|
144
|
+
.uic-dtable > table { border-collapse: collapse; width: 100%; min-width: max-content;
|
|
145
|
+
font-size: 12px; color: var(--uic-ink-2, #3A3D45); }
|
|
146
|
+
.uic-dtable th, .uic-dtable td { padding: 6px 10px; text-align: left; white-space: nowrap;
|
|
147
|
+
border-bottom: 1px solid var(--uic-line-soft, #EFF1F4); }
|
|
148
|
+
.uic-dtable th { position: sticky; top: 0; z-index: 1; font-weight: 600;
|
|
149
|
+
color: var(--uic-mute, #5B5D66);
|
|
150
|
+
background: var(--uic-surface, #FFFFFF);
|
|
151
|
+
border-bottom: 1px solid var(--uic-line, #DDDFE6); }
|
|
152
|
+
/* Numbers line up under each other or they cannot be compared at a glance. */
|
|
153
|
+
.uic-dtable td.is-num, .uic-dtable th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
|
|
154
|
+
.uic-dtable tbody tr:hover td { background: var(--uic-hover-wash, rgba(0, 0, 0, .05)); }
|
|
155
|
+
|
|
156
|
+
/* A panel that ran and has nothing to show. Distinct from failed, which has a message. */
|
|
157
|
+
.uic-note { display: flex; align-items: center; justify-content: center; height: 100%;
|
|
158
|
+
font-size: 12.5px; color: var(--uic-mute-2, #8E9199); }
|
|
159
|
+
|
|
160
|
+
/* Named for a screen reader, drawn for nobody. */
|
|
161
|
+
.uic-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
|
|
162
|
+
overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
package/styles/themes/dark.css
CHANGED
|
@@ -46,4 +46,20 @@
|
|
|
46
46
|
--uic-r-pill: 999px;
|
|
47
47
|
--uic-z-overlay: 9000;
|
|
48
48
|
--uic-scrim: rgba(0, 0, 0, .58);
|
|
49
|
+
|
|
50
|
+
/* ── boards: series colours + the loading placeholder (panels.css) ──
|
|
51
|
+
The same eight hues as the light theme, re-stepped for a dark surface — not the light values
|
|
52
|
+
reused, and not an automatic inversion. Every adjacent pair clears ΔE 8 under simulated
|
|
53
|
+
protan/deutan/tritan vision and ΔE 15 under normal vision, and all eight clear 3:1 against
|
|
54
|
+
this surface. Assign IN ORDER and never cycle: the order is what makes the scale safe. */
|
|
55
|
+
--uic-cat-1: #3987e5;
|
|
56
|
+
--uic-cat-2: #d95926;
|
|
57
|
+
--uic-cat-3: #199e70;
|
|
58
|
+
--uic-cat-4: #c98500;
|
|
59
|
+
--uic-cat-5: #d55181;
|
|
60
|
+
--uic-cat-6: #008300;
|
|
61
|
+
--uic-cat-7: #9085e9;
|
|
62
|
+
--uic-cat-8: #e66767;
|
|
63
|
+
--uic-skeleton: rgba(255, 255, 255, .07);
|
|
64
|
+
--uic-skeleton-hi: rgba(255, 255, 255, .13);
|
|
49
65
|
}
|
package/styles/themes/light.css
CHANGED
|
@@ -49,4 +49,21 @@
|
|
|
49
49
|
their order is the order they opened in rather than a race between two stylesheets. */
|
|
50
50
|
--uic-z-overlay: 9000;
|
|
51
51
|
--uic-scrim: rgba(17, 24, 39, .42);
|
|
52
|
+
|
|
53
|
+
/* ── boards: series colours + the loading placeholder (panels.css) ──
|
|
54
|
+
A categorical scale, assigned IN ORDER and never cycled. The order is the colour-blind
|
|
55
|
+
safety mechanism, not a taste: every adjacent pair clears ΔE 8 under simulated protan/
|
|
56
|
+
deutan/tritan vision and ΔE 15 under normal vision, and re-ordering the slots breaks that.
|
|
57
|
+
Three of them sit below 3:1 against this surface (aqua, yellow, magenta), so identity must
|
|
58
|
+
never rest on colour alone here — keep the legend, or label the series directly. */
|
|
59
|
+
--uic-cat-1: #2a78d6;
|
|
60
|
+
--uic-cat-2: #eb6834;
|
|
61
|
+
--uic-cat-3: #1baf7a;
|
|
62
|
+
--uic-cat-4: #eda100;
|
|
63
|
+
--uic-cat-5: #e87ba4;
|
|
64
|
+
--uic-cat-6: #008300;
|
|
65
|
+
--uic-cat-7: #4a3aa7;
|
|
66
|
+
--uic-cat-8: #e34948;
|
|
67
|
+
--uic-skeleton: rgba(17, 24, 39, .06);
|
|
68
|
+
--uic-skeleton-hi: rgba(17, 24, 39, .11);
|
|
52
69
|
}
|