anentrypoint-design 0.0.235 → 0.0.237
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/app-shell.css +119 -0
- package/dist/247420.css +119 -0
- package/dist/247420.js +11 -11
- package/package.json +1 -1
- package/src/components/data-density.js +161 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.237",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Data-density components: dense observability/dashboard primitives ported
|
|
2
|
+
// from the gmsniff GUI (phase-walk, tree timeline, bar charts, KPI tiles,
|
|
3
|
+
// sub-nav grid, session rows, deviation callouts, live log stream). Pure
|
|
4
|
+
// factories — props in, webjsx vnode out. Theme-aware: every color rides a
|
|
5
|
+
// semantic var(--token) from colors_and_type.css, never a raw hex literal.
|
|
6
|
+
// CSS lives in app-shell.css under the "data density" section (ds- prefix
|
|
7
|
+
// keeps scripts/lint-classes.mjs passing without a PREFIXES change).
|
|
8
|
+
|
|
9
|
+
import * as webjsx from '../../vendor/webjsx/index.js';
|
|
10
|
+
const h = webjsx.createElement;
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// PhaseWalk — compact horizontal phase-progress indicator.
|
|
14
|
+
// phases : ordered phase names (default the 5-stage gm chain).
|
|
15
|
+
// reached : bool[] parallel to phases — true once that phase has been hit.
|
|
16
|
+
// gapKinds: phase names that are a known gap (red), overrides reached.
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
export const DEFAULT_PHASES = ['PLAN', 'EXECUTE', 'EMIT', 'VERIFY', 'COMPLETE'];
|
|
19
|
+
|
|
20
|
+
export function PhaseWalk({ phases = DEFAULT_PHASES, reached = [], gapKinds = [] } = {}) {
|
|
21
|
+
const gaps = new Set(gapKinds || []);
|
|
22
|
+
return h('div', { class: 'ds-phasewalk', role: 'group', 'aria-label': 'phase progress' },
|
|
23
|
+
...phases.map((p, i) => {
|
|
24
|
+
const isGap = gaps.has(p);
|
|
25
|
+
const isReached = Boolean(reached[i]);
|
|
26
|
+
const cls = 'ds-phasewalk-seg' + (isGap ? ' is-gap' : (isReached ? ' is-reached' : ''));
|
|
27
|
+
const title = p + (isGap ? ' (gap)' : (isReached ? ' (reached)' : ' (not reached)'));
|
|
28
|
+
return h('span', { key: p, class: cls, title },
|
|
29
|
+
h('span', { class: 'ds-phasewalk-lbl', 'aria-hidden': 'true' }, p.charAt(0)));
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// TreeNode — indented timeline/tree entry with left-border variant coloring.
|
|
35
|
+
// variant: '' | 'phase' | 'deviation' | 'mutable-resolve' | 'prd-add'
|
|
36
|
+
// residuals: array of strings, joined with ", " when present.
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
export function TreeNode({ ts, kind, variant = '', phase, id, keyLabel, reason, deviationLabel, residuals } = {}) {
|
|
39
|
+
const cls = 'ds-tree-node' + (variant ? ' is-' + variant : '');
|
|
40
|
+
const pills = [
|
|
41
|
+
phase ? h('span', { key: 'phase', class: 'ds-pill' }, phase) : null,
|
|
42
|
+
id ? h('span', { key: 'id', class: 'ds-pill' }, id) : null,
|
|
43
|
+
keyLabel ? h('span', { key: 'key', class: 'ds-pill' }, keyLabel) : null,
|
|
44
|
+
].filter(Boolean);
|
|
45
|
+
return h('div', { class: cls },
|
|
46
|
+
ts != null ? h('span', { class: 'ds-tree-node-ts' }, ts) : null,
|
|
47
|
+
h('strong', {}, kind),
|
|
48
|
+
pills.length ? h('span', { class: 'ds-tree-node-pills' }, ...pills) : null,
|
|
49
|
+
reason ? h('div', { class: 'ds-tree-node-reason' }, reason) : null,
|
|
50
|
+
deviationLabel ? h('div', { class: 'ds-tree-node-deviation' }, h('strong', {}, deviationLabel)) : null,
|
|
51
|
+
(residuals && residuals.length) ? h('div', { class: 'ds-tree-node-residuals' }, residuals.join(', ')) : null);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// BarRow — inline horizontal bar-chart row (label + track + value).
|
|
56
|
+
// tone: a CSS color value (var(--token) or color-mix expression) — never a
|
|
57
|
+
// bare hex string should be passed by a caller; the component itself never
|
|
58
|
+
// hardcodes one.
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
export function BarRow({ label, value, pct = 0, tone } = {}) {
|
|
61
|
+
const clamped = Math.max(0, Math.min(100, pct));
|
|
62
|
+
return h('div', { class: 'ds-bar-row' },
|
|
63
|
+
h('span', { class: 'ds-bar-row-label', style: tone ? `color:${tone}` : null }, label),
|
|
64
|
+
h('div', { class: 'ds-bar-bg' },
|
|
65
|
+
h('div', { class: 'ds-bar-fill', style: `width:${clamped}%` + (tone ? `;background:${tone}` : '') })),
|
|
66
|
+
h('span', { class: 'ds-bar-row-value' }, value));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// StatTile / StatsGrid — compact KPI tiles, denser than the existing .kpi.
|
|
71
|
+
// cls on StatTile selects an accent variant: '' | 'rate-big' | 'err-rate'.
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
export function StatTile({ val, lbl, cls = '' } = {}) {
|
|
74
|
+
return h('div', { class: 'ds-stat' },
|
|
75
|
+
h('div', { class: 'ds-stat-val' + (cls ? ' ' + cls : '') }, val),
|
|
76
|
+
h('div', { class: 'ds-stat-lbl' }, lbl));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function StatsGrid({ items = [] } = {}) {
|
|
80
|
+
if (!items.length) return h('div', { class: 'ds-stats-grid ds-stats-grid-empty' },
|
|
81
|
+
h('span', { class: 'ds-stat-lbl' }, 'no stats'));
|
|
82
|
+
return h('div', { class: 'ds-stats-grid' },
|
|
83
|
+
...items.map((it, i) => h('div', { key: it.key || i }, StatTile(it))));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// SubGrid — small button grid: big number + label, for category navigation.
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
export function SubGrid({ items = [] } = {}) {
|
|
90
|
+
if (!items.length) return h('div', { class: 'ds-sub-grid ds-sub-grid-empty' },
|
|
91
|
+
h('span', { class: 'ds-stat-lbl' }, 'no items'));
|
|
92
|
+
return h('div', { class: 'ds-sub-grid' },
|
|
93
|
+
...items.map((it, i) => h('button', {
|
|
94
|
+
key: it.key || i, type: 'button', class: 'ds-sub-btn',
|
|
95
|
+
onclick: it.onClick || null,
|
|
96
|
+
}, h('span', {}, String(it.count)), it.label)));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// SessionRow — compact single-line session summary row.
|
|
101
|
+
// phaseWalkProps: props forwarded to PhaseWalk for the inline phase strip.
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
export function SessionRow({ sessId, phaseWalkProps, events, verbs, prd, muts, resid, deviations, firstTs, lastTs, onClick } = {}) {
|
|
104
|
+
const counts = [
|
|
105
|
+
events != null ? events + ' ev' : null,
|
|
106
|
+
verbs != null ? verbs + ' verb' : null,
|
|
107
|
+
prd != null ? prd + ' prd' : null,
|
|
108
|
+
muts != null ? muts + ' mut' : null,
|
|
109
|
+
resid != null ? resid + ' resid' : null,
|
|
110
|
+
].filter(Boolean).join(' · ');
|
|
111
|
+
return h('div', { class: 'ds-session-row', onclick: onClick || null, role: onClick ? 'button' : null, tabindex: onClick ? '0' : null },
|
|
112
|
+
h('span', { class: 'ds-session-row-id' }, sessId),
|
|
113
|
+
h('span', { class: 'ds-session-row-counts' }, counts),
|
|
114
|
+
(deviations != null && deviations !== 0) ? h('span', { class: 'ds-session-row-devcnt' }, String(deviations) + ' dev') : null,
|
|
115
|
+
phaseWalkProps ? PhaseWalk(phaseWalkProps) : null,
|
|
116
|
+
(firstTs || lastTs) ? h('span', { class: 'ds-session-row-span' }, [firstTs, lastTs].filter(Boolean).join(' -> ')) : null);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
// DevRow — deviation/error callout row. Uses the danger-surface token, never
|
|
121
|
+
// a bare hex background.
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
export function DevRow({ ts, event, sess, operation, residuals } = {}) {
|
|
124
|
+
const pills = [
|
|
125
|
+
sess ? h('span', { key: 'sess', class: 'ds-pill' }, sess) : null,
|
|
126
|
+
operation ? h('span', { key: 'op', class: 'ds-pill' }, operation) : null,
|
|
127
|
+
].filter(Boolean);
|
|
128
|
+
return h('div', { class: 'ds-dev-row' },
|
|
129
|
+
ts != null ? h('span', { class: 'ds-tree-node-ts' }, ts) : null,
|
|
130
|
+
h('strong', {}, event),
|
|
131
|
+
pills.length ? h('span', { class: 'ds-tree-node-pills' }, ...pills) : null,
|
|
132
|
+
(residuals && residuals.length) ? h('div', { class: 'ds-tree-node-residuals' }, residuals.join(', ')) : null);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
// LiveLog / LiveLogEntry — scrollable dense log stream with a colored
|
|
137
|
+
// subsystem tag + bold event name + muted payload preview.
|
|
138
|
+
// entries[i].tone is a CSS color value; the background derives from it via
|
|
139
|
+
// color-mix at render time (no raw "#hex22" alpha-suffix hack).
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
export function LiveLogEntry({ ts, sub, tone, event, preview } = {}) {
|
|
142
|
+
const tagStyle = tone
|
|
143
|
+
? `background:color-mix(in oklab, ${tone} 18%, transparent);color:${tone}`
|
|
144
|
+
: null;
|
|
145
|
+
return h('div', { class: 'ds-live-log-entry' },
|
|
146
|
+
h('span', { class: 'ds-live-log-ts' }, ts),
|
|
147
|
+
sub ? h('span', { class: 'ds-live-log-subtag', style: tagStyle }, sub) : null,
|
|
148
|
+
h('strong', {}, event),
|
|
149
|
+
preview ? h('span', { class: 'ds-live-log-preview' }, preview) : null);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function LiveLog({ entries = [], autoScroll = true } = {}) {
|
|
153
|
+
const seedScroll = (el) => {
|
|
154
|
+
if (!el || !autoScroll) return;
|
|
155
|
+
el.scrollTop = el.scrollHeight;
|
|
156
|
+
};
|
|
157
|
+
if (!entries.length) return h('div', { class: 'ds-live-log ds-live-log-empty' },
|
|
158
|
+
h('span', { class: 'ds-stat-lbl' }, 'no log entries'));
|
|
159
|
+
return h('div', { class: 'ds-live-log', ref: seedScroll },
|
|
160
|
+
...entries.map((e, i) => h('div', { key: e.key || i }, LiveLogEntry(e))));
|
|
161
|
+
}
|