@birdycom/omniaui 0.13.0 → 0.14.0

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.
@@ -1,5 +1,5 @@
1
1
  // File: packages/ui/src/form-extras.d.ts
2
- // Types for the date field (ISO week), name card (rename), avatar picker (preview) and quantity (step) helpers.
2
+ // Types for the date field (ISO week), name card (rename), avatar picker (preview), quantity (step) and language code helpers.
3
3
 
4
4
  export function isoWeek(date: Date): { week: number; year: number };
5
5
  export function bindDateField(root: HTMLElement): void;
@@ -8,4 +8,6 @@ export function acceptsFile(file: { type?: string; name?: string } | null | unde
8
8
  export function bindAvatarPicker(root: HTMLElement): void;
9
9
  export function stepQuantity(value: number, direction: -1 | 1, limits?: { min?: number; max?: number; step?: number }): number;
10
10
  export function bindQuantity(root: HTMLElement): void;
11
+ export function languageCode(select: HTMLSelectElement): string;
12
+ export function bindLanguageCode(root: HTMLElement): void;
11
13
  export function initFormExtras(scope?: ParentNode): void;
@@ -1,7 +1,8 @@
1
1
  // File: packages/ui/src/form-extras.js
2
2
  // Map: ISO week -> date field (week label) -> name card (rename) -> avatar picker (preview, drop, remove) -> quantity
3
- // (step buttons) -> init -> boot
4
- // Small behaviour for four CSS components; each works without it (native date input, <details>, file input, number input).
3
+ // (step buttons) -> language code (the closed code select) -> init -> boot
4
+ // Small behaviour for five CSS components; each works without it (native date input, <details>, file input, number input,
5
+ // native select).
5
6
  // Events on the component root: oc-namecard-rename { name }, oc-avatar-change { file } (null when removed),
6
7
  // oc-avatar-invalid { file, reason } (wrong type or too large).
7
8
 
@@ -191,12 +192,29 @@ export function bindQuantity(root) {
191
192
  sync();
192
193
  }
193
194
 
194
- /** Wire every date field, name card, avatar picker and quantity field under scope. */
195
+ /** The code shown by a closed .oc-language-select--code: the chosen option's data-code, else its value, upper case. */
196
+ export function languageCode(select) {
197
+ const option = select.selectedOptions?.[0] ?? select.options?.[select.selectedIndex];
198
+ return String(option?.dataset.code || select.value || "").toUpperCase();
199
+ }
200
+
201
+ /** .oc-language-select--code: keep data-code on the wrapper in step with the select. */
202
+ export function bindLanguageCode(root) {
203
+ const select = root.querySelector("select");
204
+ if (!select || root.dataset.ocBound) return;
205
+ root.dataset.ocBound = "";
206
+ const sync = () => { root.dataset.code = languageCode(select); };
207
+ select.addEventListener("change", sync);
208
+ sync();
209
+ }
210
+
211
+ /** Wire every date field, name card, avatar picker, quantity field and code language select under scope. */
195
212
  export function initFormExtras(scope = document) {
196
213
  scope.querySelectorAll(".oc-date-field").forEach(bindDateField);
197
214
  scope.querySelectorAll(".oc-name-card").forEach(bindNameCard);
198
215
  scope.querySelectorAll(".oc-avatar-picker").forEach(bindAvatarPicker);
199
216
  scope.querySelectorAll(".oc-quantity").forEach(bindQuantity);
217
+ scope.querySelectorAll(".oc-language-select--code").forEach(bindLanguageCode);
200
218
  }
201
219
 
202
220
  // Starts on its own as /js/oc-form-extras.js (`npx omniaui copy-js`), with ?auto in the URL or data-oc-auto on the tag.
package/dist/oc-theme.css CHANGED
@@ -1,4 +1,4 @@
1
- /* File: oc-theme.css — generated from tokens/semantic.json by @birdycom/omniacss 0.13.0. Do not edit. */
1
+ /* File: oc-theme.css — generated from tokens/semantic.json by @birdycom/omniacss 0.14.0. Do not edit. */
2
2
  /* Semantic theme tokens: every color is light-dark() of an Omnia palette token (oc-colors.css). */
3
3
  /* Same source as the desktop export: npx omniacss tokens --format json|dtcg|python */
4
4
  :root {
@@ -0,0 +1,14 @@
1
+ // File: packages/ui/src/particles.d.ts
2
+ // Types for the particle field script (canvas.oc-particles).
3
+
4
+ export interface ParticleOptions {
5
+ /** Number of points (110). */
6
+ count?: number;
7
+ /** Speed of the drift (0.35). */
8
+ speed?: number;
9
+ /** Distance in px under which two points get a line (115). */
10
+ link?: number;
11
+ }
12
+ export function particleOptions(canvas: HTMLCanvasElement): Required<ParticleOptions>;
13
+ export function initParticles(canvas: HTMLCanvasElement, options?: ParticleOptions): () => void;
14
+ export function initParticleFields(scope?: ParentNode): () => void;
@@ -0,0 +1,133 @@
1
+ // File: packages/ui/src/particles.js
2
+ // Map: options (data attributes) -> colors from CSS (re-read on a theme change) -> size (the canvas box x device pixels)
3
+ // -> particles -> frame (move, dot, lines to close neighbours) -> pause when hidden -> boot
4
+ // Particle field (canvas.oc-particles): slowly drifting points with thin lines between points that are close together.
5
+ // Colors come from the canvas's CSS: color (points and lines) and border-color (a second point color), so a theme
6
+ // switch (data-theme or a class on <html>, or the OS setting) recolors it. With "reduce motion" it draws one still frame.
7
+ // Options (data attributes on the canvas): data-count (110), data-speed (0.35), data-link (115, the line distance in px).
8
+
9
+ /** Numbers from the canvas's data attributes, with the defaults. */
10
+ export function particleOptions(canvas) {
11
+ const num = (name, fallback) => {
12
+ const n = parseFloat(canvas.dataset?.[name] ?? "");
13
+ return Number.isFinite(n) && n >= 0 ? n : fallback;
14
+ };
15
+ return { count: Math.round(num("count", 110)), speed: num("speed", 0.35), link: num("link", 115) };
16
+ }
17
+
18
+ /** Start the field on one canvas (once). Returns a function that stops it. */
19
+ export function initParticles(canvas, options = {}) {
20
+ if (!canvas || canvas.dataset.ocBound !== undefined) return () => {};
21
+ const ctx = canvas.getContext?.("2d");
22
+ const win = canvas.ownerDocument?.defaultView;
23
+ if (!ctx || !win) return () => {};
24
+ canvas.dataset.ocBound = "";
25
+ const { count, speed, link } = { ...particleOptions(canvas), ...options };
26
+ const still = win.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
27
+
28
+ let width = 0, height = 0;
29
+ const resize = () => {
30
+ const ratio = win.devicePixelRatio || 1;
31
+ width = canvas.clientWidth || win.innerWidth;
32
+ height = canvas.clientHeight || win.innerHeight;
33
+ canvas.width = Math.round(width * ratio);
34
+ canvas.height = Math.round(height * ratio);
35
+ ctx.setTransform(ratio, 0, 0, ratio, 0, 0);
36
+ };
37
+ resize();
38
+
39
+ let lineColor = "", colors = [];
40
+ const readColors = () => {
41
+ const cs = win.getComputedStyle(canvas);
42
+ lineColor = cs.color;
43
+ colors = [cs.color, cs.borderTopColor, cs.color];
44
+ };
45
+ readColors();
46
+
47
+ const particles = Array.from({ length: count }, (_, i) => ({
48
+ x: Math.random() * width,
49
+ y: Math.random() * height,
50
+ vx: (Math.random() - 0.5) * speed,
51
+ vy: (Math.random() - 0.5) * speed,
52
+ r: Math.random() * 1.8 + 0.4,
53
+ alpha: Math.random() * 0.55 + 0.1,
54
+ tone: i % 3,
55
+ }));
56
+
57
+ const frame = (move) => {
58
+ ctx.clearRect(0, 0, width, height);
59
+ particles.forEach((p, i) => {
60
+ if (move) {
61
+ p.x += p.vx; p.y += p.vy;
62
+ if (p.x < 0 || p.x > width) p.vx *= -1;
63
+ if (p.y < 0 || p.y > height) p.vy *= -1;
64
+ }
65
+ ctx.beginPath();
66
+ ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2);
67
+ ctx.fillStyle = colors[p.tone];
68
+ ctx.globalAlpha = p.alpha;
69
+ ctx.fill();
70
+ // Lines only to the next few points: cheap, and enough to look like a network.
71
+ for (let j = i + 1; j < Math.min(i + 5, particles.length); j++) {
72
+ const q = particles[j];
73
+ const d = Math.hypot(p.x - q.x, p.y - q.y);
74
+ if (d >= link) continue;
75
+ ctx.beginPath();
76
+ ctx.moveTo(p.x, p.y);
77
+ ctx.lineTo(q.x, q.y);
78
+ ctx.strokeStyle = lineColor;
79
+ ctx.globalAlpha = (1 - d / link) * 0.1;
80
+ ctx.lineWidth = 0.5;
81
+ ctx.stroke();
82
+ }
83
+ });
84
+ ctx.globalAlpha = 1;
85
+ };
86
+
87
+ let raf = 0;
88
+ const loop = () => { frame(true); raf = win.requestAnimationFrame(loop); };
89
+ const start = () => { if (!still && !raf) raf = win.requestAnimationFrame(loop); };
90
+ const pause = () => { win.cancelAnimationFrame(raf); raf = 0; };
91
+ const onVisibility = () => (canvas.ownerDocument.hidden ? pause() : start());
92
+ const onResize = () => { resize(); if (still) frame(false); };
93
+ const recolor = () => { readColors(); if (still) frame(false); };
94
+
95
+ const themeObserver = new win.MutationObserver(recolor);
96
+ themeObserver.observe(canvas.ownerDocument.documentElement, { attributes: true, attributeFilter: ["data-theme", "class", "style"] });
97
+ const scheme = win.matchMedia?.("(prefers-color-scheme: dark)");
98
+ scheme?.addEventListener?.("change", recolor);
99
+ const sizeObserver = typeof win.ResizeObserver === "function" ? new win.ResizeObserver(onResize) : null;
100
+ if (sizeObserver) sizeObserver.observe(canvas); else win.addEventListener("resize", onResize);
101
+ canvas.ownerDocument.addEventListener("visibilitychange", onVisibility);
102
+
103
+ if (still) frame(false); else start();
104
+ return () => {
105
+ pause();
106
+ themeObserver.disconnect();
107
+ scheme?.removeEventListener?.("change", recolor);
108
+ sizeObserver?.disconnect();
109
+ win.removeEventListener("resize", onResize);
110
+ canvas.ownerDocument.removeEventListener("visibilitychange", onVisibility);
111
+ delete canvas.dataset.ocBound;
112
+ };
113
+ }
114
+
115
+ /** Start every canvas.oc-particles under scope. Returns a function that stops them all. */
116
+ export function initParticleFields(scope = document) {
117
+ const stops = [...scope.querySelectorAll("canvas.oc-particles")].map((c) => initParticles(c));
118
+ return () => stops.forEach((stop) => stop());
119
+ }
120
+
121
+ // Starts on its own as /js/oc-particles.js (`npx omniaui copy-js`), with ?auto in the URL or data-oc-auto on the tag.
122
+ function autoStart() {
123
+ if (typeof document === "undefined") return false;
124
+ const url = String(import.meta.url);
125
+ if (url.includes("oc-particles") || /[?&]auto(=|&|$)/.test(url)) return true;
126
+ const file = url.split(/[?#]/)[0];
127
+ return [...document.querySelectorAll("script[data-oc-auto][src]")].some((s) => s.src.split(/[?#]/)[0] === file);
128
+ }
129
+ if (autoStart()) {
130
+ const boot = () => initParticleFields(document);
131
+ if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", boot);
132
+ else boot();
133
+ }
@@ -1,4 +1,4 @@
1
- /* File: packages/ui/src/parts/app-accordion-accent.css | Map: accent accordion (separate cards) -> item card + left accent -> trigger -> open state -> color modifiers (presets) -> flush combination */
1
+ /* File: packages/ui/src/parts/app-accordion-accent.css | Map: accent accordion (separate cards) -> item card + left accent -> trigger -> open state -> color modifiers (presets) -> status (data-status) -> status dot -> flush combination */
2
2
  /* Accordion accent: every item becomes its own card with a colored accent on the start edge.
3
3
  Add .oc-accordion--accent to an .oc-accordion. The color comes from --oc-accordion-accent:
4
4
  primary by default, or an existing .oc-accent--* preset (blue, cyan, green, orange, red, violet, yellow)
@@ -52,6 +52,23 @@
52
52
  .oc-accordion--accent .oc-accordion-item--danger,
53
53
  .oc-accordion--accent.oc-accordion--danger .oc-accordion-item { --oc-accordion-accent: var(--oc-destructive); }
54
54
 
55
+ /* Info and muted (not checked, skipped). */
56
+ .oc-accordion--accent .oc-accordion-item--info { --oc-accordion-accent: var(--oc-info, light-dark(var(--color-deepskyblue-70), var(--color-skyblue-50))); }
57
+ .oc-accordion--accent .oc-accordion-item--muted { --oc-accordion-accent: var(--oc-muted-foreground); }
58
+
59
+ /* Status of a check (one row per check): data-status="ok|warn|error|skip|pending" on the item. Pending is primary. */
60
+ .oc-accordion--accent .oc-accordion-item[data-status="ok"] { --oc-accordion-accent: var(--oc-success); }
61
+ .oc-accordion--accent .oc-accordion-item[data-status="warn"] { --oc-accordion-accent: var(--oc-warning); }
62
+ .oc-accordion--accent .oc-accordion-item[data-status="error"] { --oc-accordion-accent: var(--oc-destructive); }
63
+ .oc-accordion--accent .oc-accordion-item[data-status="skip"] { --oc-accordion-accent: var(--oc-muted-foreground); }
64
+ .oc-accordion--accent .oc-accordion-item[data-status="pending"] { --oc-accordion-accent: var(--oc-primary); }
65
+ .oc-accordion--accent .oc-accordion-item[data-status="skip"] > .oc-accordion-trigger { color: var(--oc-muted-foreground); }
66
+
67
+ /* A dot in the status color at the start of the trigger (hollow while pending). */
68
+ .oc-accordion-accent-dot { flex-shrink: 0; inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: var(--oc-accordion-accent); }
69
+ .oc-accordion-trigger:has(> .oc-accordion-accent-dot) { justify-content: flex-start; gap: 0.6rem; }
70
+ .oc-accordion-item[data-status="pending"] .oc-accordion-accent-dot { background: transparent; border: 1.5px solid var(--oc-accordion-accent); }
71
+
55
72
  /* Accent + flush: no frame around each card except the accent edge. */
56
73
  .oc-accordion--accent.oc-accordion--flush .oc-accordion-item { border-block: 0; border-inline-end: 0; border-radius: 0; }
57
74
 
@@ -0,0 +1,20 @@
1
+ /* File: packages/ui/src/parts/app-callout.css | Map: card row (text + action) -> text -> action -> narrow: action under the text */
2
+ /* Callout: a small card with a text on the left and one action on the right ("Like the app? Support it" + a button).
3
+ Centred vertically; when the card is narrower than about 300px the action moves under the text. */
4
+
5
+ .oc-callout {
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ align-items: center;
9
+ gap: 0.5rem 0.75rem;
10
+ padding: 11px 13px;
11
+ color: var(--oc-card-foreground, var(--oc-foreground));
12
+ background: var(--oc-card-background, var(--oc-card));
13
+ border: 1px solid var(--oc-card-border, var(--oc-border));
14
+ border-radius: var(--oc-radius);
15
+ }
16
+ /* 12rem basis: next to a button the text wraps under it at about 300px. */
17
+ .oc-callout__text { flex: 1 1 12rem; min-inline-size: 0; margin: 0; font-size: 0.85rem; line-height: 1.45; }
18
+ .oc-callout__text strong { display: block; color: var(--oc-foreground); }
19
+ .oc-callout__text > :is(p, span):not(:first-child) { color: var(--oc-muted-foreground); }
20
+ .oc-callout__action { flex-shrink: 0; display: flex; gap: 0.5rem; }
@@ -0,0 +1,36 @@
1
+ /* File: packages/ui/src/parts/app-group.css | Map: group -> head (title + aside) -> meta line -> hairline between groups */
2
+ /* Group: one section inside a panel or widget (a service, an account), with a title, a short status on the right
3
+ ("2 busy") and a muted line under it. Consecutive groups get a hairline between them.
4
+ <section class="oc-group"><header class="oc-group__head"><h2 class="oc-group__title">…</h2><span class="oc-group__aside">…</span></header>
5
+ <p class="oc-group__meta">…</p> … </section> The aside takes a color from data-tone="busy|ok|warn|error". */
6
+
7
+ .oc-group { padding: 14px 0 6px; }
8
+ .oc-group + .oc-group { border-block-start: 1px solid var(--oc-group-line, var(--oc-glass-hairline, var(--oc-border))); }
9
+ .oc-group__head {
10
+ display: flex;
11
+ align-items: baseline;
12
+ justify-content: space-between;
13
+ gap: 0.75rem;
14
+ margin-block-end: 0.25rem;
15
+ }
16
+ .oc-group__title {
17
+ min-inline-size: 0;
18
+ margin: 0;
19
+ overflow: hidden;
20
+ font-size: 0.875rem;
21
+ font-weight: 600;
22
+ text-overflow: ellipsis;
23
+ white-space: nowrap;
24
+ }
25
+ .oc-group__aside {
26
+ flex-shrink: 0;
27
+ font-size: 0.75rem;
28
+ font-weight: 600;
29
+ font-variant-numeric: tabular-nums;
30
+ color: var(--oc-group-tone, var(--oc-muted-foreground));
31
+ }
32
+ .oc-group__aside[data-tone="busy"] { --oc-group-tone: var(--oc-primary); }
33
+ .oc-group__aside[data-tone="ok"] { --oc-group-tone: var(--oc-success); }
34
+ .oc-group__aside[data-tone="warn"] { --oc-group-tone: var(--oc-warning); }
35
+ .oc-group__aside[data-tone="error"] { --oc-group-tone: var(--oc-destructive); }
36
+ .oc-group__meta { margin: 0 0 0.625rem; font-size: 0.75rem; color: var(--oc-muted-foreground); }
@@ -0,0 +1,132 @@
1
+ /* File: packages/ui/src/parts/data-graph.css
2
+ Map: frame -> edges (moving dashes) -> nodes (halo, dot, mark, label) -> levels -> center node + pulse -> focus
3
+ (one node lit, the rest dimmed) -> tooltip -> reduced motion
4
+ Graph: the look of a small network graph in SVG, a center (a person, an account, a server) with linked nodes
5
+ around it. Draw it yourself (by hand, d3 or any code) with these classes, or let OmniaUI Pro's network graph
6
+ lay it out. Node colors follow the severity tokens: data-level="low|medium|high|critical" on .oc-graph__node.
7
+ <div class="oc-graph"><svg class="oc-graph__svg" viewBox="…">
8
+ <line class="oc-graph__edge" …/>
9
+ <g class="oc-graph__node" data-level="high" transform="translate(…)"><circle class="oc-graph__halo" r="21"/>
10
+ <circle class="oc-graph__dot" r="14"/><text class="oc-graph__mark">▲</text><text class="oc-graph__label" y="27">…</text></g>
11
+ </svg></div> */
12
+
13
+ .oc-graph {
14
+ --oc-graph-accent: var(--oc-accent-from, var(--oc-primary));
15
+ position: relative;
16
+ inline-size: 100%;
17
+ color: var(--oc-foreground);
18
+ }
19
+ .oc-graph__svg { display: block; inline-size: 100%; block-size: auto; overflow: visible; }
20
+
21
+ /* Edges: thin dashed lines in the accent color that flow from the center outwards. */
22
+ .oc-graph__edge {
23
+ fill: none;
24
+ stroke: var(--oc-graph-accent);
25
+ stroke-opacity: 0.35;
26
+ stroke-width: 1.5;
27
+ stroke-dasharray: 6 4;
28
+ animation: oc-graph-flow 1.5s linear infinite;
29
+ transition: stroke-opacity 0.3s, stroke-width 0.3s;
30
+ }
31
+ @keyframes oc-graph-flow { to { stroke-dashoffset: -20; } }
32
+
33
+ /* Nodes: a soft halo, a dot in the level color, a mark inside and a label under it. */
34
+ .oc-graph__node {
35
+ --oc-graph-color: var(--oc-muted-foreground);
36
+ cursor: default;
37
+ outline: none;
38
+ transition: opacity 0.3s;
39
+ }
40
+ .oc-graph__node[role="button"] { cursor: pointer; }
41
+ .oc-graph__halo {
42
+ fill: none;
43
+ stroke: var(--oc-graph-color);
44
+ stroke-opacity: 0.25;
45
+ stroke-width: 9;
46
+ filter: blur(3px);
47
+ transition: stroke-opacity 0.3s, stroke-width 0.3s;
48
+ }
49
+ .oc-graph__dot {
50
+ fill: var(--oc-graph-color);
51
+ fill-opacity: 0.88;
52
+ transition: fill-opacity 0.3s, scale 0.3s;
53
+ transform-box: fill-box;
54
+ transform-origin: center;
55
+ }
56
+ .oc-graph__mark {
57
+ fill: var(--color-white-50);
58
+ font-size: 10px;
59
+ text-anchor: middle;
60
+ dominant-baseline: central;
61
+ pointer-events: none;
62
+ }
63
+ .oc-graph__label {
64
+ fill: var(--oc-muted-foreground);
65
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
66
+ font-size: 8.5px;
67
+ text-anchor: middle;
68
+ pointer-events: none;
69
+ }
70
+ .oc-graph__node:focus-visible .oc-graph__dot { stroke: var(--oc-ring); stroke-width: 2.5; }
71
+
72
+ /* Levels (the same tokens as the severity card); the tooltip takes the level of its node. */
73
+ .oc-graph__node[data-level="low"],
74
+ .oc-graph__tip[data-level="low"] { --oc-graph-color: var(--oc-success); }
75
+ .oc-graph__node[data-level="medium"],
76
+ .oc-graph__tip[data-level="medium"] { --oc-graph-color: var(--oc-warning); }
77
+ .oc-graph__node[data-level="high"],
78
+ .oc-graph__tip[data-level="high"] { --oc-graph-color: var(--oc-destructive); }
79
+ .oc-graph__node[data-level="critical"],
80
+ .oc-graph__tip[data-level="critical"] { --oc-graph-color: light-dark(var(--color-red-95), var(--color-red-30)); }
81
+
82
+ /* Center: the accent color, a thin white ring and a pulse that grows and fades. */
83
+ .oc-graph__node--center { --oc-graph-color: var(--oc-graph-accent); }
84
+ .oc-graph__node--center .oc-graph__dot { stroke: var(--color-white-50); stroke-opacity: 0.3; stroke-width: 1.5; }
85
+ .oc-graph__node--center .oc-graph__mark { font-size: 13px; }
86
+ .oc-graph__node--center .oc-graph__label { fill: var(--oc-graph-accent); }
87
+ .oc-graph__pulse {
88
+ fill: none;
89
+ stroke: var(--oc-graph-accent);
90
+ stroke-width: 2;
91
+ transform-box: fill-box;
92
+ transform-origin: center;
93
+ animation: oc-graph-pulse 2.2s ease-out infinite;
94
+ }
95
+ @keyframes oc-graph-pulse {
96
+ from { scale: 1; opacity: 0.6; }
97
+ to { scale: 2; opacity: 0; }
98
+ }
99
+
100
+ /* Focus: .is-focused on the graph and .is-active on one node light that node and its edge; the rest dims. */
101
+ .oc-graph.is-focused .oc-graph__node:not(.is-active, .oc-graph__node--center) { opacity: 0.15; }
102
+ .oc-graph.is-focused .oc-graph__edge { stroke-opacity: 0.08; stroke-width: 1; }
103
+ .oc-graph.is-focused .oc-graph__edge.is-active { stroke-opacity: 0.8; stroke-width: 3; }
104
+ .oc-graph__node.is-active .oc-graph__dot { fill-opacity: 1; scale: 1.55; }
105
+ .oc-graph__node.is-active .oc-graph__halo { stroke-opacity: 0.6; stroke-width: 14; }
106
+ .oc-graph__node.is-active .oc-graph__label { fill: var(--oc-graph-accent); }
107
+
108
+ /* Tooltip: level, title and meta lines of the node under the pointer. */
109
+ .oc-graph__tip {
110
+ position: absolute;
111
+ z-index: 5;
112
+ min-inline-size: 10rem;
113
+ max-inline-size: 14rem;
114
+ padding: 0.75rem;
115
+ pointer-events: none;
116
+ opacity: 0;
117
+ background: var(--oc-popover);
118
+ color: var(--oc-popover-foreground);
119
+ border: 1px solid var(--oc-border);
120
+ border-radius: 0.75rem;
121
+ box-shadow: 0 8px 24px oklch(from var(--color-black-60) l c h / 0.15);
122
+ transition: opacity 0.15s;
123
+ }
124
+ .oc-graph__tip.is-visible { opacity: 1; }
125
+ .oc-graph__tip-level { margin-block-end: 0.25rem; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--oc-graph-color, var(--oc-muted-foreground)); }
126
+ .oc-graph__tip-title { margin-block-end: 0.375rem; font-size: 0.75rem; font-weight: 700; }
127
+ .oc-graph__tip-meta { font-size: 0.6875rem; line-height: 1.6; color: var(--oc-muted-foreground); }
128
+
129
+ @media (prefers-reduced-motion: reduce) {
130
+ .oc-graph__edge, .oc-graph__pulse { animation: none; }
131
+ .oc-graph__pulse { opacity: 0; }
132
+ }
@@ -1,6 +1,8 @@
1
- /* File: packages/ui/src/parts/data-meter-row.css | Map: row grid -> label and value -> bar and fill -> levels -> reset line -> list */
1
+ /* File: packages/ui/src/parts/data-meter-row.css | Map: row grid -> label and value -> bar and fill (or a fill element) -> levels -> reset line -> sub-line -> list (compact, dense) */
2
2
  /* Usage meter row: a label, the usage as text, a bar and when it resets. The fill comes from
3
- --oc-meter (0–100%); data-level="warn" or "critical" changes the color. */
3
+ --oc-meter (0–100%); data-level="warn" or "critical" changes the color.
4
+ A live meter can also carry its own fill element (<span class="oc-meter-row__fill" style="inline-size: 42%">):
5
+ patch its inline width in place; the bar then draws no fill of its own. */
4
6
 
5
7
  .oc-meter-row {
6
8
  display: grid;
@@ -27,14 +29,65 @@
27
29
  border-radius: inherit;
28
30
  transition: inline-size 0.4s ease;
29
31
  }
32
+ .oc-meter-row__bar:has(> .oc-meter-row__fill)::before { content: none; }
33
+ .oc-meter-row__fill {
34
+ display: block;
35
+ max-inline-size: 100%;
36
+ block-size: 100%;
37
+ background: var(--oc-meter-color, var(--oc-success));
38
+ border-radius: inherit;
39
+ transition: inline-size 0.4s ease;
40
+ }
30
41
  .oc-meter-row[data-level="warn"] { --oc-meter-color: var(--oc-warning); }
31
42
  .oc-meter-row[data-level="critical"] { --oc-meter-color: var(--oc-destructive); }
32
43
  .oc-meter-row[data-level="critical"] .oc-meter-row__value strong { color: var(--oc-destructive); }
33
44
  .oc-meter-row__reset { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--oc-muted-foreground); }
45
+ /* Sub-line: a muted second reading under the bar ("VRAM 2.7 / 8.0 GB") with an optional thin bar of its own.
46
+ The thin bar takes --oc-meter on itself (or an .oc-meter-row__fill child) and its own data-level. */
47
+ .oc-meter-row__sub {
48
+ grid-column: 1 / -1;
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 0.5rem;
52
+ font-size: 0.75rem;
53
+ font-variant-numeric: tabular-nums;
54
+ color: var(--oc-muted-foreground);
55
+ white-space: nowrap;
56
+ }
57
+ .oc-meter-row__subbar {
58
+ --oc-meter-color: var(--oc-muted-foreground);
59
+ flex: 1;
60
+ min-inline-size: 2rem;
61
+ block-size: 3px;
62
+ overflow: hidden;
63
+ background: var(--oc-muted);
64
+ border-radius: 999px;
65
+ }
66
+ .oc-meter-row__subbar::before {
67
+ content: "";
68
+ display: block;
69
+ inline-size: clamp(0%, var(--oc-meter, 0%), 100%);
70
+ block-size: 100%;
71
+ background: var(--oc-meter-color);
72
+ border-radius: inherit;
73
+ transition: inline-size 0.4s ease;
74
+ }
75
+ .oc-meter-row__subbar:has(> .oc-meter-row__fill)::before { content: none; }
76
+ .oc-meter-row__subbar[data-level="warn"] { --oc-meter-color: var(--oc-warning); }
77
+ .oc-meter-row__subbar[data-level="critical"] { --oc-meter-color: var(--oc-destructive); }
78
+
34
79
  .oc-meter-list { display: grid; gap: 1rem; }
35
80
  .oc-meter-list--compact { gap: 0.625rem; }
36
81
  .oc-meter-list--compact .oc-meter-row__bar { block-size: 0.375rem; }
82
+ /* Dense: for a small widget or tray window (5px bar, smaller label). */
83
+ .oc-meter-list--dense { gap: 0.5rem; }
84
+ .oc-meter-list--dense .oc-meter-row { gap: 0.25rem 0.625rem; }
85
+ .oc-meter-list--dense .oc-meter-row__label { font-size: 0.8rem; }
86
+ .oc-meter-list--dense .oc-meter-row__value { font-size: 0.75rem; }
87
+ .oc-meter-list--dense .oc-meter-row__bar { block-size: 5px; }
37
88
 
38
89
  @media (prefers-reduced-motion: reduce) {
39
- .oc-meter-row__bar::before { transition: none; }
90
+ .oc-meter-row__bar::before,
91
+ .oc-meter-row__subbar::before,
92
+ .oc-meter-row__fill { transition: none; }
40
93
  }
@@ -0,0 +1,26 @@
1
+ /* File: packages/ui/src/parts/data-reading.css | Map: reading -> levels (cool, warm, hot) -> inside a meter row */
2
+ /* Reading: a small measured value next to another value ("57 °C", "1.2 GHz"), in tabular numbers.
3
+ Levels: --cool (muted, the default look), --warm (warning) and --hot (destructive). The app picks the level,
4
+ for example warm from 70 °C and hot from 85 °C. */
5
+
6
+ .oc-reading {
7
+ display: inline-flex;
8
+ align-items: center;
9
+ gap: 0.25rem;
10
+ padding: 0.0625rem 0.375rem;
11
+ font-size: 0.75rem;
12
+ font-weight: 600;
13
+ font-variant-numeric: tabular-nums;
14
+ line-height: 1.4;
15
+ color: var(--oc-reading-color, var(--oc-muted-foreground));
16
+ white-space: nowrap;
17
+ background: oklch(from var(--oc-reading-color, var(--oc-muted-foreground)) l c h / 0.1);
18
+ border: 1px solid oklch(from var(--oc-reading-color, var(--oc-muted-foreground)) l c h / 0.25);
19
+ border-radius: 999px;
20
+ }
21
+ .oc-reading--cool { --oc-reading-color: var(--oc-muted-foreground); }
22
+ .oc-reading--warm { --oc-reading-color: var(--oc-warning); }
23
+ .oc-reading--hot { --oc-reading-color: var(--oc-destructive); }
24
+
25
+ /* In the value of a meter row: a little room before it. */
26
+ .oc-meter-row__value .oc-reading { margin-inline-start: 0.375rem; }
@@ -87,3 +87,21 @@ button.oc-language-select {
87
87
  outline: none;
88
88
  }
89
89
  button.oc-language-select:hover { background: var(--oc-surface); }
90
+
91
+ /* Code: closed it shows only the language code ("NL"), open it shows the native list with the full names.
92
+ 34 × 30px, for the actions of a title bar. The code comes from data-code on the wrapper; form-extras.js (and the
93
+ React, Vue and Blade components) keep it in step with the chosen option (its data-code, else its value). */
94
+ .oc-language-select--code {
95
+ justify-content: center;
96
+ inline-size: 34px;
97
+ block-size: 30px;
98
+ padding: 0;
99
+ border-radius: calc(var(--oc-radius) - 2px);
100
+ font-size: 0.75rem;
101
+ font-weight: 700;
102
+ letter-spacing: 0.04em;
103
+ }
104
+ .oc-language-select--code::before { content: attr(data-code); text-transform: uppercase; pointer-events: none; }
105
+ .oc-language-select--code::after,
106
+ .oc-language-select--code .oc-language-select-icon { display: none; }
107
+ .oc-language-select--code .oc-language-select-control { position: absolute; inset: 0; padding: 0; opacity: 0; }
@@ -0,0 +1,50 @@
1
+ /* File: packages/ui/src/parts/nav-menu-static.css | Map: static menu (no popover, fills its box) -> check column -> hint -> group title */
2
+ /* Static menu: the dropdown menu as a whole surface of its own, for a tray menu in its own small window or a menu
3
+ inside a panel. .oc-dropdown-menu--static drops the popover position and fills its container.
4
+ Items can carry a check column (.oc-dropdown-check, 20px, shows ✓ when the item has aria-checked="true") and a
5
+ muted hint on the right (.oc-dropdown-hint). Group titles: .oc-dropdown-label; red item: .oc-dropdown-item--destructive. */
6
+
7
+ .oc-dropdown-menu.oc-dropdown-menu--static,
8
+ .oc-dropdown-menu.oc-dropdown-menu--static[popover] {
9
+ position: static;
10
+ display: block;
11
+ inline-size: 100%;
12
+ min-inline-size: 0;
13
+ margin: 0;
14
+ animation: none;
15
+ }
16
+ /* In a transparent desktop window the window is the frame: --flat drops the border and shadow. */
17
+ .oc-dropdown-menu--static.oc-dropdown-menu--flat { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
18
+
19
+ .oc-dropdown-check {
20
+ display: inline-flex;
21
+ flex: none;
22
+ justify-content: center;
23
+ inline-size: 20px;
24
+ margin-inline-start: -4px;
25
+ color: var(--oc-primary);
26
+ }
27
+ .oc-dropdown-check::before {
28
+ content: "";
29
+ inline-size: 0.35rem;
30
+ block-size: 0.65rem;
31
+ border-inline-end: 2px solid currentColor;
32
+ border-block-end: 2px solid currentColor;
33
+ rotate: 45deg;
34
+ translate: 0 -10%;
35
+ opacity: 0;
36
+ }
37
+ .oc-dropdown-item[aria-checked="true"] > .oc-dropdown-check::before { opacity: 1; }
38
+ /* With its own check column, the role-based check mark is not drawn a second time. */
39
+ .oc-dropdown-item:has(> .oc-dropdown-check) { padding-inline-start: 10px; }
40
+ .oc-dropdown-item:has(> .oc-dropdown-check)::before { content: none; }
41
+
42
+ .oc-dropdown-hint {
43
+ margin-inline-start: auto;
44
+ padding-inline-start: 1rem;
45
+ font-size: 0.75rem;
46
+ font-variant-numeric: tabular-nums;
47
+ color: var(--oc-muted-foreground);
48
+ white-space: nowrap;
49
+ }
50
+ .oc-dropdown-menu--static .oc-dropdown-label { font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; }