@birdycom/omniaui 0.13.0 → 0.14.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.
Files changed (55) hide show
  1. package/bin/lib/copy-js.mjs +5 -1
  2. package/dist/components.css +975 -20
  3. package/dist/components.min.css +1 -1
  4. package/dist/docs-ui.css +12 -1
  5. package/dist/form-extras.d.ts +3 -1
  6. package/dist/form-extras.js +21 -3
  7. package/dist/language-select.d.ts +7 -0
  8. package/dist/language-select.js +48 -0
  9. package/dist/oc-theme.css +1 -1
  10. package/dist/particles.d.ts +14 -0
  11. package/dist/particles.js +133 -0
  12. package/dist/parts/app-accordion-accent.css +18 -1
  13. package/dist/parts/app-callout.css +20 -0
  14. package/dist/parts/app-group.css +36 -0
  15. package/dist/parts/app-page-header.css +1 -1
  16. package/dist/parts/app-status-dot.css +19 -4
  17. package/dist/parts/app-version-banner.css +18 -1
  18. package/dist/parts/data-dl-glossary.css +11 -0
  19. package/dist/parts/data-graph.css +132 -0
  20. package/dist/parts/data-meter-row.css +63 -3
  21. package/dist/parts/data-reading.css +26 -0
  22. package/dist/parts/data-step-list.css +42 -0
  23. package/dist/parts/forms-language-select.css +80 -0
  24. package/dist/parts/nav-menu-static.css +50 -0
  25. package/dist/parts/site-backgrounds.css +68 -0
  26. package/dist/parts/site-cards.css +2 -1
  27. package/dist/parts/site-doc-layout.css +39 -0
  28. package/dist/parts/site-layout.css +15 -1
  29. package/dist/parts/site-neon.css +47 -0
  30. package/dist/parts/site-prose.css +4 -1
  31. package/dist/parts/site-tint-card.css +223 -0
  32. package/dist/showcase.css +22 -5
  33. package/dist/toc.d.ts +9 -0
  34. package/dist/toc.js +96 -0
  35. package/manifest.json +88 -0
  36. package/package.json +5 -2
  37. package/snippets/accordion-accent.html +22 -0
  38. package/snippets/backgrounds.html +18 -0
  39. package/snippets/callout.html +17 -0
  40. package/snippets/definition-list.html +1 -0
  41. package/snippets/doc-layout.html +39 -0
  42. package/snippets/graph.html +41 -0
  43. package/snippets/group.html +34 -0
  44. package/snippets/language-select.html +11 -0
  45. package/snippets/menu-static.html +36 -0
  46. package/snippets/meter-row.html +23 -0
  47. package/snippets/neon.html +18 -0
  48. package/snippets/page-sections.html +1 -1
  49. package/snippets/particle-field.html +14 -0
  50. package/snippets/progress.html +1 -1
  51. package/snippets/reading.html +25 -0
  52. package/snippets/status-dot.html +1 -0
  53. package/snippets/step-list.html +28 -0
  54. package/snippets/tint-card.html +66 -0
  55. package/snippets/toc.html +1 -1
package/dist/docs-ui.css CHANGED
@@ -57,9 +57,17 @@
57
57
  .oc-sidebar--docs.oc-sidebar--collapsed { inline-size: auto; }
58
58
 
59
59
  /* ---- On this page: .oc-toc ---------------------------------------------------------------------- */
60
- .oc-toc { position: sticky; inset-block-start: 0; max-block-size: 100%; overflow: auto; padding-block-start: 2px; padding-inline-end: 0.5rem; }
60
+ /* Sticky only from 64rem: stacked above the text on a phone it would stay over the text. It stops under a sticky site
61
+ header (--oc-sticky-offset, see parts/site-doc-layout.css). */
62
+ .oc-toc { max-block-size: 100%; overflow: auto; padding-block-start: 2px; padding-inline-end: 0.5rem; }
63
+ @media (min-width: 64rem) {
64
+ .oc-toc { position: sticky; inset-block-start: var(--oc-sticky-offset, 0px); }
65
+ }
61
66
  .oc-toc-title { margin: 1rem 0 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--oc-muted-foreground); }
62
67
  .oc-toc-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
68
+ /* Label above a group of links (Articles, Annexes): a <p> between two lists, or an <li> inside one list. */
69
+ .oc-toc-group-label { margin: 1.25rem 0 0.4rem; padding-inline: 0.5rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--oc-subtle-foreground, var(--oc-muted-foreground)); }
70
+ .oc-toc-group-label:first-child { margin-block-start: 0; }
63
71
  .oc-toc-link {
64
72
  display: block;
65
73
  padding: 0.375rem 0.5rem;
@@ -76,6 +84,9 @@
76
84
  .oc-toc-link.is-active { color: var(--oc-foreground); border-color: var(--oc-primary); background: oklch(from var(--oc-primary) l c h / 0.1); }
77
85
  /* Scroll-spy without JavaScript: the link of the heading you are reading is highlighted (native :target-current). */
78
86
  .oc-toc-list { scroll-target-group: auto; }
87
+ /* One group for the whole table of contents, so with several lists (one per group) only one link lights up. */
88
+ .oc-toc { scroll-target-group: auto; }
89
+ .oc-toc .oc-toc-list { scroll-target-group: none; }
79
90
  .oc-toc-link:target-current { color: var(--oc-foreground); border-color: var(--oc-primary); background: oklch(from var(--oc-primary) l c h / 0.1); }
80
91
  .oc-toc-item--sub { margin-inline-start: 0.75rem; }
81
92
  .oc-toc-item--sub .oc-toc-link { font-size: 0.8125rem; }
@@ -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.
@@ -0,0 +1,7 @@
1
+ // File: packages/ui/src/language-select.d.ts
2
+ // Types for the language select that switches the page.
3
+
4
+ /** Address for a chosen option value: the value, plus the current #hash when it has none of its own. */
5
+ export function languageTarget(value: string, hash?: string, keepHash?: boolean): string;
6
+ /** On change of a [data-oc-language-select], go to the address in the chosen option's value. */
7
+ export function initLanguageSelect(scope?: ParentNode): () => void;
@@ -0,0 +1,48 @@
1
+ // File: packages/ui/src/language-select.js
2
+ // Map: target of an option (its value, + the current #hash) -> on change go there -> boot on [data-oc-language-select]
3
+ // Language select that switches the page: put data-oc-language-select on the .oc-language-select (or on the <select>)
4
+ // and give every <option> the address of the same page in that language as its value. On change the browser goes
5
+ // there, keeping the #section you were reading (data-oc-keep-hash="false" turns that off).
6
+ // Without JavaScript a select cannot switch pages: add the links in a <noscript>, or use the dropdown variant
7
+ // (button.oc-language-select + .oc-dropdown-menu with links), which needs no script at all.
8
+
9
+ /** Address to go to for a chosen option value: the value itself, plus the hash when it has none of its own. */
10
+ export function languageTarget(value, hash = "", keepHash = true) {
11
+ const v = String(value || "").trim();
12
+ if (!v) return "";
13
+ if (!keepHash || !hash || v.includes("#")) return v;
14
+ return v + hash;
15
+ }
16
+
17
+ /** Starts every [data-oc-language-select] in scope. Returns a function that stops it. */
18
+ export function initLanguageSelect(scope = document) {
19
+ const doc = scope.ownerDocument || scope;
20
+ const win = doc.defaultView;
21
+ const selects = [...scope.querySelectorAll("[data-oc-language-select]")]
22
+ .map((el) => (el.matches("select") ? el : el.querySelector("select")))
23
+ .filter(Boolean);
24
+ const onChange = (e) => {
25
+ const select = e.currentTarget;
26
+ const host = select.closest("[data-oc-language-select]");
27
+ const keep = (host?.dataset.ocKeepHash ?? select.dataset.ocKeepHash) !== "false";
28
+ const target = languageTarget(select.value, win?.location.hash, keep);
29
+ if (target && win) win.location.assign(target);
30
+ };
31
+ selects.forEach((s) => s.addEventListener("change", onChange));
32
+ return () => selects.forEach((s) => s.removeEventListener("change", onChange));
33
+ }
34
+
35
+ // Starts on its own as /js/oc-language-select.js (`npx omniaui copy-js language-select`), with ?auto in the URL or
36
+ // data-oc-auto on the tag.
37
+ function autoStart() {
38
+ if (typeof document === "undefined") return false;
39
+ const url = String(import.meta.url);
40
+ if (url.includes("oc-language-select") || /[?&]auto(=|&|$)/.test(url)) return true;
41
+ const file = url.split(/[?#]/)[0];
42
+ return [...document.querySelectorAll("script[data-oc-auto][src]")].some((s) => s.src.split(/[?#]/)[0] === file);
43
+ }
44
+ if (autoStart()) {
45
+ const boot = () => initLanguageSelect(document);
46
+ if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", boot);
47
+ else boot();
48
+ }
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.1. 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); }
@@ -47,7 +47,7 @@
47
47
  .oc-page-header--bordered { margin-block-end: 1rem; border-block-end: 1px solid var(--oc-border); }
48
48
 
49
49
  /* Sticky: stays on top while the page scrolls (needs a background). */
50
- .oc-page-header--sticky { position: sticky; inset-block-start: 0; z-index: 10; background: var(--oc-background); }
50
+ .oc-page-header--sticky { position: sticky; inset-block-start: var(--oc-sticky-offset, 0px); z-index: 10; background: var(--oc-background); }
51
51
 
52
52
  /* Small: for sub pages and dialogs. */
53
53
  .oc-page-header--sm { padding-block: 0.5rem 0.75rem; }
@@ -16,17 +16,32 @@
16
16
  vertical-align: middle;
17
17
  }
18
18
 
19
- /* Tones. --working pulses a ring outwards. */
19
+ /* Tones. --working pulses a ring outwards: a ::after that only scales and fades (transform + opacity), so the GPU
20
+ draws it and the page does no style or paint work per frame, also in a window that is always open.
21
+ --oc-status-dot-pulses: how many times (default infinite; 3 = pulse three times and then stay a steady dot).
22
+ --still: working without the pulse. */
23
+ :where(.oc-status-dot--working) { position: relative; }
20
24
  .oc-status-dot--working {
21
25
  --oc-status-dot-color: var(--oc-primary);
22
- animation: oc-status-dot-pulse 1.8s ease-in-out infinite;
23
26
  }
27
+ .oc-status-dot--working::after {
28
+ content: "";
29
+ position: absolute;
30
+ inset: 0;
31
+ border-radius: inherit;
32
+ background: var(--oc-status-dot-color);
33
+ opacity: 0;
34
+ pointer-events: none;
35
+ animation: oc-status-dot-pulse 1.8s ease-out var(--oc-status-dot-pulses, infinite);
36
+ }
37
+ .oc-status-dot--still::after { content: none; }
24
38
  .oc-status-dot--waiting { --oc-status-dot-color: var(--oc-warning); }
25
39
  .oc-status-dot--done { --oc-status-dot-color: var(--oc-success); }
26
40
  .oc-status-dot--error { --oc-status-dot-color: var(--oc-destructive); }
27
41
  .oc-status-dot--idle { --oc-status-dot-color: var(--oc-muted-foreground); box-shadow: none; opacity: 0.7; }
28
42
  @keyframes oc-status-dot-pulse {
29
- 50% { box-shadow: 0 0 0 5px oklch(from var(--oc-status-dot-color) l c h / 0.08); }
43
+ 0% { transform: scale(1); opacity: 0.35; }
44
+ 100% { transform: scale(2.25); opacity: 0; }
30
45
  }
31
46
 
32
47
  /* Sizes */
@@ -46,5 +61,5 @@
46
61
  .oc-status__meta { flex: none; margin-inline-start: auto; color: var(--oc-muted-foreground); font-variant-numeric: tabular-nums; }
47
62
 
48
63
  @media (prefers-reduced-motion: reduce) {
49
- .oc-status-dot--working { animation: none; }
64
+ .oc-status-dot--working::after { animation: none; }
50
65
  }
@@ -29,9 +29,26 @@
29
29
  block-size: 0.5rem;
30
30
  border-radius: 50%;
31
31
  background: var(--oc-version-banner-color);
32
+ position: relative;
33
+ }
34
+ /* The pulse is a ::after that scales and fades (transform + opacity): drawn by the GPU, no work per frame. */
35
+ .oc-version-banner-dot::after {
36
+ content: "";
37
+ position: absolute;
38
+ inset: 0;
39
+ border-radius: inherit;
40
+ background: var(--oc-version-banner-color);
41
+ opacity: 0;
42
+ pointer-events: none;
32
43
  animation: oc-version-banner-pulse 2s ease-in-out infinite;
33
44
  }
34
- @keyframes oc-version-banner-pulse { 50% { box-shadow: 0 0 0 4px oklch(from var(--oc-version-banner-color) l c h / 0.2); } }
45
+ @keyframes oc-version-banner-pulse {
46
+ 0%, 100% { transform: scale(1); opacity: 0; }
47
+ 50% { transform: scale(2); opacity: 0.2; }
48
+ }
49
+ @media (prefers-reduced-motion: reduce) {
50
+ .oc-version-banner-dot::after { animation: none; }
51
+ }
35
52
 
36
53
  /* Text: the long text hides on small screens, the short one shows instead. */
37
54
  .oc-version-banner-text { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@@ -0,0 +1,11 @@
1
+ /* File: packages/ui/src/parts/data-dl-glossary.css | Map: glossary rows (term bold, explanation normal, same top line) */
2
+ /* Glossary: the definition list (.oc-dl) as term + explanation instead of label + value. The term is bold in the
3
+ foreground, the explanation normal text; both use the same line height, so their first lines sit on one line. */
4
+
5
+ .oc-dl--glossary .oc-dl-row { align-items: baseline; }
6
+ .oc-dl--glossary :is(.oc-dl-term, .oc-dl-detail) { line-height: 1.55; }
7
+ .oc-dl--glossary .oc-dl-term { color: var(--oc-foreground); font-weight: 600; }
8
+ .oc-dl--glossary .oc-dl-detail { color: var(--oc-muted-foreground); font-weight: 400; overflow-wrap: break-word; }
9
+ @media (min-width: 40rem) {
10
+ .oc-dl--glossary .oc-dl-row { grid-template-columns: minmax(8rem, var(--oc-dl-term-width, 30%)) minmax(0, 1fr); }
11
+ }
@@ -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
+ }