@birdycom/omniaui 0.16.0 → 0.16.2
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/bin/lib/webicons-builtin.json +1 -0
- package/bin/lib/webicons.mjs +124 -0
- package/bin/omniaui.mjs +10 -1
- package/dist/components.css +71 -16
- package/dist/components.min.css +1 -1
- package/dist/oc-theme.css +1 -1
- package/dist/parts/app-mode-badge.css +5 -0
- package/dist/parts/app-top-progress.css +3 -0
- package/dist/parts/media-live-frame.css +35 -5
- package/dist/parts/site-base.css +14 -7
- package/manifest.json +8 -0
- package/package.json +2 -2
- package/snippets/webicon.html +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mdi:check":{"body":"<path fill=\"currentColor\" d=\"M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z\"/>","width":24,"height":24},"mdi:check-all":{"body":"<path fill=\"currentColor\" d=\"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z\"/>","width":24,"height":24},"mdi:close":{"body":"<path fill=\"currentColor\" d=\"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z\"/>","width":24,"height":24},"mdi:menu":{"body":"<path fill=\"currentColor\" d=\"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z\"/>","width":24,"height":24},"mdi:magnify":{"body":"<path fill=\"currentColor\" d=\"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5\"/>","width":24,"height":24},"mdi:dots-vertical":{"body":"<path fill=\"currentColor\" d=\"M12 16a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2\"/>","width":24,"height":24},"mdi:content-copy":{"body":"<path fill=\"currentColor\" d=\"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12z\"/>","width":24,"height":24},"mdi:chevron-down":{"body":"<path fill=\"currentColor\" d=\"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z\"/>","width":24,"height":24},"mdi:chevron-up":{"body":"<path fill=\"currentColor\" d=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z\"/>","width":24,"height":24},"mdi:chevron-left":{"body":"<path fill=\"currentColor\" d=\"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z\"/>","width":24,"height":24},"mdi:chevron-right":{"body":"<path fill=\"currentColor\" d=\"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z\"/>","width":24,"height":24},"mdi:arrow-up":{"body":"<path fill=\"currentColor\" d=\"M13 20h-2V8l-5.5 5.5l-1.42-1.42L12 4.16l7.92 7.92l-1.42 1.42L13 8z\"/>","width":24,"height":24},"mdi:arrow-down":{"body":"<path fill=\"currentColor\" d=\"M11 4h2v12l5.5-5.5l1.42 1.42L12 19.84l-7.92-7.92L5.5 10.5L11 16z\"/>","width":24,"height":24},"mdi:arrow-left":{"body":"<path fill=\"currentColor\" d=\"M20 11v2H8l5.5 5.5l-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5L8 11z\"/>","width":24,"height":24},"mdi:arrow-right":{"body":"<path fill=\"currentColor\" d=\"M4 11v2h12l-5.5 5.5l1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5L16 11z\"/>","width":24,"height":24},"mdi:trash-can-outline":{"body":"<path fill=\"currentColor\" d=\"M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3zM7 6h10v13H7zm2 2v9h2V8zm4 0v9h2V8z\"/>","width":24,"height":24},"mdi:walk":{"body":"<path fill=\"currentColor\" d=\"M14.12 10H19V8.2h-3.62l-2-3.33c-.3-.5-.84-.84-1.46-.84c-.18 0-.34.03-.5.08L6 5.8V11h1.8V7.33l2.11-.66L6 22h1.8l2.87-8.11L13 17v5h1.8v-6.41l-2.49-4.54l.73-2.87M14 3.8c1 0 1.8-.8 1.8-1.8S15 .2 14 .2S12.2 1 12.2 2S13 3.8 14 3.8\"/>","width":24,"height":24},"mdi:flag-checkered":{"body":"<path fill=\"currentColor\" d=\"M14.4 6H20v10h-7l-.4-2H7v7H5V4h9zm-.4 8h2v-2h2v-2h-2V8h-2v2l-1-2V6h-2v2H9V6H7v2h2v2H7v2h2v-2h2v2h2v-2l1 2zm-3-4V8h2v2zm3 0h2v2h-2z\"/>","width":24,"height":24},"mdi:map-marker-outline":{"body":"<path fill=\"currentColor\" d=\"M12 6.5A2.5 2.5 0 0 1 14.5 9a2.5 2.5 0 0 1-2.5 2.5A2.5 2.5 0 0 1 9.5 9A2.5 2.5 0 0 1 12 6.5M12 2a7 7 0 0 1 7 7c0 5.25-7 13-7 13S5 14.25 5 9a7 7 0 0 1 7-7m0 2a5 5 0 0 0-5 5c0 1 0 3 5 9.71C17 12 17 10 17 9a5 5 0 0 0-5-5\"/>","width":24,"height":24},"mdi:target":{"body":"<path fill=\"currentColor\" d=\"M11 2v2.07A8 8 0 0 0 4.07 11H2v2h2.07A8 8 0 0 0 11 19.93V22h2v-2.07A8 8 0 0 0 19.93 13H22v-2h-2.07A8 8 0 0 0 13 4.07V2m-2 4.08V8h2V6.09c2.5.41 4.5 2.41 4.92 4.91H16v2h1.91c-.41 2.5-2.41 4.5-4.91 4.92V16h-2v1.91C8.5 17.5 6.5 15.5 6.08 13H8v-2H6.09C6.5 8.5 8.5 6.5 11 6.08M12 11a1 1 0 0 0-1 1a1 1 0 0 0 1 1a1 1 0 0 0 1-1a1 1 0 0 0-1-1\"/>","width":24,"height":24},"mdi:text":{"body":"<path fill=\"currentColor\" d=\"M21 6v2H3V6zM3 18h9v-2H3zm0-5h18v-2H3z\"/>","width":24,"height":24},"mdi:web":{"body":"<path fill=\"currentColor\" d=\"M16.36 14c.08-.66.14-1.32.14-2s-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2m-5.15 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95a8.03 8.03 0 0 1-4.33 3.56M14.34 14H9.66c-.1-.66-.16-1.32-.16-2s.06-1.35.16-2h4.68c.09.65.16 1.32.16 2s-.07 1.34-.16 2M12 19.96c-.83-1.2-1.5-2.53-1.91-3.96h3.82c-.41 1.43-1.08 2.76-1.91 3.96M8 8H5.08A7.92 7.92 0 0 1 9.4 4.44C8.8 5.55 8.35 6.75 8 8m-2.92 8H8c.35 1.25.8 2.45 1.4 3.56A8 8 0 0 1 5.08 16m-.82-2C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2s.06 1.34.14 2M12 4.03c.83 1.2 1.5 2.54 1.91 3.97h-3.82c.41-1.43 1.08-2.77 1.91-3.97M18.92 8h-2.95a15.7 15.7 0 0 0-1.38-3.56c1.84.63 3.37 1.9 4.33 3.56M12 2C6.47 2 2 6.5 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2\"/>","width":24,"height":24},"mdi:monitor":{"body":"<path fill=\"currentColor\" d=\"M21 16H3V4h18m0-2H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h7v2H8v2h8v-2h-2v-2h7a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2\"/>","width":24,"height":24},"mdi:white-balance-sunny":{"body":"<path fill=\"currentColor\" d=\"m3.55 19.09l1.41 1.41l1.8-1.79l-1.42-1.42M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6s6-2.69 6-6c0-3.32-2.69-6-6-6m8 7h3v-2h-3m-2.76 7.71l1.8 1.79l1.41-1.41l-1.79-1.8M20.45 5l-1.41-1.4l-1.8 1.79l1.42 1.42M13 1h-2v3h2M6.76 5.39L4.96 3.6L3.55 5l1.79 1.81zM1 13h3v-2H1m12 9h-2v3h2\"/>","width":24,"height":24},"mdi:weather-night":{"body":"<path fill=\"currentColor\" d=\"m17.75 4.09l-2.53 1.94l.91 3.06l-2.63-1.81l-2.63 1.81l.91-3.06l-2.53-1.94L12.44 4l1.06-3l1.06 3zm3.5 6.91l-1.64 1.25l.59 1.98l-1.7-1.17l-1.7 1.17l.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95zm-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85c-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14c.4-.4.82-.76 1.27-1.08c.75-.53 1.93.36 1.85 1.19c-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82c-2.81 3.14-2.7 7.96.31 10.98c3.02 3.01 7.84 3.12 10.98.31\"/>","width":24,"height":24},"material-symbols:arrow-outward-rounded":{"body":"<path fill=\"currentColor\" d=\"m16 8.4l-8.9 8.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7L14.6 7H7q-.425 0-.712-.288T6 6t.288-.712T7 5h10q.425 0 .713.288T18 6v10q0 .425-.288.713T17 17t-.712-.288T16 16z\"/>","width":24,"height":24},"flag:nl-4x3":{"body":"<path fill=\"#ae1c28\" d=\"M0 0h640v160H0z\"/><path fill=\"#fff\" d=\"M0 160h640v160H0z\"/><path fill=\"#21468b\" d=\"M0 320h640v160H0z\"/>","width":640,"height":480},"flag:be-4x3":{"body":"<g fill-rule=\"evenodd\" stroke-width=\"1pt\"><path fill=\"#000001\" d=\"M0 0h213.3v480H0z\"/><path fill=\"#ffd90c\" d=\"M213.3 0h213.4v480H213.3z\"/><path fill=\"#f31830\" d=\"M426.7 0H640v480H426.7z\"/></g>","width":640,"height":480},"flag:fr-4x3":{"body":"<path fill=\"#000091\" d=\"M0 0h213.3v480H0z\"/><path fill=\"#fff\" d=\"M213.3 0h213.4v480H213.3z\"/><path fill=\"#e1000f\" d=\"M426.7 0H640v480H426.7z\"/>","width":640,"height":480},"flag:de-4x3":{"body":"<path fill=\"#fc0\" d=\"M0 320h640v160H0z\"/><path fill=\"#000001\" d=\"M0 0h640v160H0z\"/><path fill=\"red\" d=\"M0 160h640v160H0z\"/>","width":640,"height":480},"flag:gb-4x3":{"body":"<path fill=\"#012169\" d=\"M0 0h640v480H0z\"/><path fill=\"#fff\" d=\"m75 0l244 181L562 0h78v62L400 241l240 178v61h-80L320 301L81 480H0v-60l239-178L0 64V0z\"/><path fill=\"#c8102e\" d=\"m424 281l216 159v40L369 281zm-184 20l6 35L54 480H0zM640 0v3L391 191l2-44L590 0zM0 0l239 176h-60L0 42z\"/><path fill=\"#fff\" d=\"M241 0v480h160V0zM0 160v160h640V160z\"/><path fill=\"#c8102e\" d=\"M0 193v96h640v-96zM273 0v480h96V0z\"/>","width":640,"height":480},"flag:it-4x3":{"body":"<g fill-rule=\"evenodd\" stroke-width=\"1pt\"><path fill=\"#fff\" d=\"M0 0h640v480H0z\"/><path fill=\"#009246\" d=\"M0 0h213.3v480H0z\"/><path fill=\"#ce2b37\" d=\"M426.7 0H640v480H426.7z\"/></g>","width":640,"height":480},"flag:us-4x3":{"body":"<path fill=\"#bd3d44\" d=\"M0 0h640v480H0\"/><path stroke=\"#fff\" stroke-width=\"37\" d=\"M0 55.3h640M0 129h640M0 203h640M0 277h640M0 351h640M0 425h640\"/><path fill=\"#192f5d\" d=\"M0 0h364.8v258.5H0\"/><marker id=\"SVGEq3dreKJ\" markerHeight=\"30\" markerWidth=\"30\"><path fill=\"#fff\" d=\"m14 0l9 27L0 10h28L5 27z\"/></marker><path fill=\"none\" marker-mid=\"url(#SVGEq3dreKJ)\" d=\"m0 0l16 11h61h61h61h61h60L47 37h61h61h60h61L16 63h61h61h61h61h60L47 89h61h61h60h61L16 115h61h61h61h61h60L47 141h61h61h60h61L16 166h61h61h61h61h60L47 192h61h61h60h61L16 218h61h61h61h61h60z\"/>","width":640,"height":480}}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// File: packages/ui/bin/lib/webicons.mjs
|
|
2
|
+
// `omniaui webicons`: a small JSON file with only the webicons an app uses, read from the Iconify sets installed in
|
|
3
|
+
// node_modules (@iconify-json/<set>/icons.json). Nothing is fetched. The app imports the file and passes it to
|
|
4
|
+
// addWebicons() (React / Vue); Blade reads it through config('omniacss.webicons.files').
|
|
5
|
+
// Map: names (arguments and/or --scan of the source) -> resolve per set (aliases) -> write --out (or print) -> report
|
|
6
|
+
|
|
7
|
+
import fs from "node:fs/promises";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { createRequire } from "node:module";
|
|
10
|
+
import { cwd } from "./project.mjs";
|
|
11
|
+
|
|
12
|
+
/** The icons OmniaUI ships built in (scripts/build-webicons.mjs): used when their set is not installed in the app. */
|
|
13
|
+
const BUILTIN = JSON.parse(await fs.readFile(new URL("./webicons-builtin.json", import.meta.url), "utf8"));
|
|
14
|
+
|
|
15
|
+
/** The webicon sets (Iconify prefixes). */
|
|
16
|
+
export const WEBICON_SETS = ["mdi", "mdi-light", "material-symbols", "svg-spinners", "flag", "vscode-icons"];
|
|
17
|
+
const NAME = new RegExp(`(?<![\\w-])(${WEBICON_SETS.join("|")}):([a-z0-9]+(?:-[a-z0-9]+)*)`, "g");
|
|
18
|
+
const SCAN_EXT = new Set([".js", ".jsx", ".ts", ".tsx", ".vue", ".svelte", ".astro", ".php", ".html", ".md", ".mdx", ".json"]);
|
|
19
|
+
const SKIP_DIR = new Set(["node_modules", "vendor", "dist", "build", ".git", ".next", ".nuxt", "storage", "coverage"]);
|
|
20
|
+
|
|
21
|
+
/** Every webicon name in the files under `dir`. */
|
|
22
|
+
export async function scanNames(dir, skip = new Set()) {
|
|
23
|
+
const found = new Set();
|
|
24
|
+
async function walk(d) {
|
|
25
|
+
for (const entry of await fs.readdir(d, { withFileTypes: true })) {
|
|
26
|
+
const full = path.join(d, entry.name);
|
|
27
|
+
if (entry.isDirectory()) {
|
|
28
|
+
if (!SKIP_DIR.has(entry.name) && !entry.name.startsWith(".")) await walk(full);
|
|
29
|
+
} else if (SCAN_EXT.has(path.extname(entry.name)) && !skip.has(path.resolve(full))) {
|
|
30
|
+
for (const m of (await fs.readFile(full, "utf8")).matchAll(NAME)) found.add(`${m[1]}:${m[2]}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
await walk(dir);
|
|
35
|
+
return [...found].sort();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** One icon of an Iconify JSON set with its aliases resolved, or null. */
|
|
39
|
+
export function resolveIcon(set, name) {
|
|
40
|
+
let extra = {};
|
|
41
|
+
let rotate = 0;
|
|
42
|
+
let hFlip = false;
|
|
43
|
+
let vFlip = false;
|
|
44
|
+
for (let n = name, depth = 0; depth < 6; depth++) {
|
|
45
|
+
const icon = set.icons[n];
|
|
46
|
+
if (icon) {
|
|
47
|
+
const out = { ...icon, ...extra, body: icon.body };
|
|
48
|
+
out.width ??= set.width ?? 16;
|
|
49
|
+
out.height ??= set.height ?? 16;
|
|
50
|
+
if (set.left && out.left == null) out.left = set.left;
|
|
51
|
+
if (set.top && out.top == null) out.top = set.top;
|
|
52
|
+
const r = ((icon.rotate ?? 0) + rotate) % 4;
|
|
53
|
+
const h = !!icon.hFlip !== hFlip;
|
|
54
|
+
const v = !!icon.vFlip !== vFlip;
|
|
55
|
+
delete out.rotate; delete out.hFlip; delete out.vFlip;
|
|
56
|
+
if (r) out.rotate = r;
|
|
57
|
+
if (h) out.hFlip = true;
|
|
58
|
+
if (v) out.vFlip = true;
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
const alias = set.aliases?.[n];
|
|
62
|
+
if (!alias) return null;
|
|
63
|
+
const { parent, rotate: ar = 0, hFlip: ah = false, vFlip: av = false, ...rest } = alias;
|
|
64
|
+
extra = { ...rest, ...extra };
|
|
65
|
+
rotate += ar;
|
|
66
|
+
hFlip = hFlip !== ah;
|
|
67
|
+
vFlip = vFlip !== av;
|
|
68
|
+
n = parent;
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** { icons: { "mdi:home": {...} }, missing: [names], noSet: [prefixes] } for the given names. */
|
|
74
|
+
export async function buildSubset(names, from = cwd) {
|
|
75
|
+
const require = createRequire(path.join(from, "package.json"));
|
|
76
|
+
const sets = new Map();
|
|
77
|
+
const icons = {};
|
|
78
|
+
const missing = [];
|
|
79
|
+
const noSet = new Set();
|
|
80
|
+
for (const full of [...new Set(names)].sort()) {
|
|
81
|
+
const i = full.indexOf(":");
|
|
82
|
+
const prefix = full.slice(0, i);
|
|
83
|
+
if (i < 1) { missing.push(full); continue; }
|
|
84
|
+
if (!sets.has(prefix)) {
|
|
85
|
+
try {
|
|
86
|
+
sets.set(prefix, JSON.parse(await fs.readFile(require.resolve(`@iconify-json/${prefix}/icons.json`), "utf8")));
|
|
87
|
+
} catch {
|
|
88
|
+
sets.set(prefix, null);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const set = sets.get(prefix);
|
|
92
|
+
if (!set && BUILTIN[full]) { icons[full] = BUILTIN[full]; continue; }
|
|
93
|
+
if (!set) { noSet.add(prefix); missing.push(full); continue; }
|
|
94
|
+
const icon = resolveIcon(set, full.slice(i + 1));
|
|
95
|
+
if (icon) icons[full] = icon;
|
|
96
|
+
else missing.push(full);
|
|
97
|
+
}
|
|
98
|
+
return { icons, missing, noSet: [...noSet] };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** `omniaui webicons [name...] [--scan <dir>] [--out <file>]` */
|
|
102
|
+
export async function cmdWebicons(names, values) {
|
|
103
|
+
const out = values.out ?? values.to;
|
|
104
|
+
const list = [...names];
|
|
105
|
+
if (values.scan) {
|
|
106
|
+
const skip = new Set(out ? [path.resolve(cwd, out)] : []);
|
|
107
|
+
list.push(...(await scanNames(path.resolve(cwd, values.scan), skip)));
|
|
108
|
+
}
|
|
109
|
+
if (!list.length) throw new Error('name the icons ("mdi:home flag:nl-4x3") or scan the source with --scan src');
|
|
110
|
+
const { icons, missing, noSet } = await buildSubset(list);
|
|
111
|
+
const json = JSON.stringify(icons, null, 1) + "\n";
|
|
112
|
+
if (out && !values["dry-run"]) {
|
|
113
|
+
await fs.mkdir(path.dirname(path.resolve(cwd, out)), { recursive: true });
|
|
114
|
+
await fs.writeFile(path.resolve(cwd, out), json);
|
|
115
|
+
} else if (!out) {
|
|
116
|
+
process.stdout.write(json);
|
|
117
|
+
}
|
|
118
|
+
const log = out ? console.log : console.error;
|
|
119
|
+
if (out) log(`omniaui: ${Object.keys(icons).length} webicons -> ${out} (${(json.length / 1024).toFixed(1)} KB)`);
|
|
120
|
+
for (const p of noSet) log(WEBICON_SETS.includes(p) ? ` set ${p} is not installed: npm i -D @iconify-json/${p}` : ` ${p}: not a webicon set (${WEBICON_SETS.join(", ")})`);
|
|
121
|
+
const unknown = missing.filter((m) => !noSet.includes(m.slice(0, m.indexOf(":"))));
|
|
122
|
+
if (unknown.length) log(` not found: ${unknown.join(", ")}`);
|
|
123
|
+
if (out) log(` React/Vue: import icons from "./${path.basename(out)}"; addWebicons(icons)`);
|
|
124
|
+
}
|
package/bin/omniaui.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// File: packages/ui/bin/omniaui.mjs
|
|
3
3
|
// OmniaUI CLI — copy components and blocks into your project (css | vue | react | blade), list the registry.
|
|
4
|
-
// Map: args -> commands (add | list | copy-js | help | version) -> lib/add.mjs (lib/catalog.mjs, lib/project.mjs),
|
|
4
|
+
// Map: args -> commands (add | list | copy-js | webicons | help | version) -> lib/add.mjs (lib/catalog.mjs, lib/project.mjs),
|
|
5
|
+
// lib/copy-js.mjs, lib/webicons.mjs
|
|
5
6
|
// Author: Serge Cools | Framework: OmniaUI (on OmniaCSS)
|
|
6
7
|
//
|
|
7
8
|
// These commands used to be "omniacss add/list" (moved here in October 2026). The CSS build stays in
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
import { parseArgs } from "node:util";
|
|
11
12
|
import { cmdAdd, cmdList } from "./lib/add.mjs";
|
|
12
13
|
import { cmdCopyJs } from "./lib/copy-js.mjs";
|
|
14
|
+
import { cmdWebicons } from "./lib/webicons.mjs";
|
|
13
15
|
import { readJson } from "./lib/project.mjs";
|
|
14
16
|
|
|
15
17
|
const HELP = `
|
|
@@ -21,6 +23,10 @@ OmniaUI CLI
|
|
|
21
23
|
omniaui list [blocks|components] [-f vue] show what can be added in a flavour
|
|
22
24
|
omniaui copy-js [name...] [--to public/js] copy the scripts (data table, carousel, barcode; Pro: spotlight, ecosystem map,
|
|
23
25
|
infinite carousel, barcode maker …) as oc-<name>.js, which start on their own from a script tag
|
|
26
|
+
omniaui webicons [name...] [--scan src] [--out src/webicons.json]
|
|
27
|
+
a small JSON file with only the webicons you use (mdi:, mdi-light:, material-symbols:,
|
|
28
|
+
svg-spinners:, flag:, vscode-icons:), read from @iconify-json/<set> in node_modules;
|
|
29
|
+
no network. React/Vue: addWebicons(json). Blade: config omniacss.webicons.files
|
|
24
30
|
|
|
25
31
|
Options:
|
|
26
32
|
-f, --framework <fw> css | vue | react | blade (default: "framework" in omnia.config.json, else detected
|
|
@@ -44,6 +50,8 @@ async function main() {
|
|
|
44
50
|
allowPositionals: true,
|
|
45
51
|
options: {
|
|
46
52
|
to: { type: "string" },
|
|
53
|
+
out: { type: "string", short: "o" },
|
|
54
|
+
scan: { type: "string" },
|
|
47
55
|
dir: { type: "string" },
|
|
48
56
|
framework: { type: "string", short: "f" },
|
|
49
57
|
kind: { type: "string", short: "k" },
|
|
@@ -64,6 +72,7 @@ async function main() {
|
|
|
64
72
|
case "add": return cmdAdd(rest, values);
|
|
65
73
|
case "list": return cmdList(rest[0], values);
|
|
66
74
|
case "copy-js": return cmdCopyJs(rest, values);
|
|
75
|
+
case "webicons": return cmdWebicons(rest, values);
|
|
67
76
|
default: console.log(HELP);
|
|
68
77
|
}
|
|
69
78
|
}
|
package/dist/components.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* File: oc-theme.css — generated from tokens/semantic.json by @birdycom/omniacss 0.16.
|
|
1
|
+
/* File: oc-theme.css — generated from tokens/semantic.json by @birdycom/omniacss 0.16.2. 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 {
|
|
@@ -1568,15 +1568,25 @@ input.oc-radio:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
|
1568
1568
|
/* Rich content only: no empty ::after bubble. */
|
|
1569
1569
|
.oc-tooltip:not([data-tooltip])::after { content: none; }
|
|
1570
1570
|
|
|
1571
|
-
/* Also on keyboard focus of the element inside (Tab), not only on mouse hover.
|
|
1571
|
+
/* Also on keyboard focus of the element inside (Tab), not only on mouse hover. :focus-visible, not :focus-within:
|
|
1572
|
+
after a mouse click the button keeps focus, and the tooltip must not stay on once the pointer has left. */
|
|
1572
1573
|
.oc-tooltip:hover::after,
|
|
1573
|
-
.oc-tooltip:focus-
|
|
1574
|
+
.oc-tooltip:focus-visible::after,
|
|
1575
|
+
.oc-tooltip:has(:focus-visible)::after,
|
|
1574
1576
|
.oc-tooltip:hover > .oc-tooltip__content,
|
|
1575
|
-
.oc-tooltip:focus-
|
|
1577
|
+
.oc-tooltip:focus-visible > .oc-tooltip__content,
|
|
1578
|
+
.oc-tooltip:has(:focus-visible) > .oc-tooltip__content {
|
|
1576
1579
|
opacity: 1;
|
|
1577
1580
|
scale: 1;
|
|
1578
1581
|
}
|
|
1579
1582
|
|
|
1583
|
+
/* A menu, popover or dialog opened from inside the tooltip goes first: the bubble would cover it. */
|
|
1584
|
+
.oc-tooltip:has(:popover-open, [aria-expanded="true"], details[open], dialog[open])::after,
|
|
1585
|
+
.oc-tooltip:has(:popover-open, [aria-expanded="true"], details[open], dialog[open]) > .oc-tooltip__content {
|
|
1586
|
+
opacity: 0;
|
|
1587
|
+
scale: 0.96;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1580
1590
|
@media (prefers-reduced-motion: reduce) {
|
|
1581
1591
|
.oc-tooltip::after,
|
|
1582
1592
|
.oc-tooltip > .oc-tooltip__content { transition: opacity var(--oc-transition-fast); scale: 1; }
|
|
@@ -6779,6 +6789,7 @@ input.oc-input[type="month"] { inline-size: auto; min-inline-size: 11rem; }
|
|
|
6779
6789
|
.oc-card.oc-card--accent {
|
|
6780
6790
|
--oc-card-tone: var(--oc-primary);
|
|
6781
6791
|
overflow: clip;
|
|
6792
|
+
padding: 0; /* the band runs to the border; the content keeps its own padding (.oc-card-content) */
|
|
6782
6793
|
border: 2px solid var(--oc-card-tone);
|
|
6783
6794
|
box-shadow: none;
|
|
6784
6795
|
}
|
|
@@ -6789,11 +6800,15 @@ input.oc-input[type="month"] { inline-size: auto; min-inline-size: 11rem; }
|
|
|
6789
6800
|
.oc-card--accent[data-tone="destructive"] { --oc-card-tone: var(--oc-destructive); }
|
|
6790
6801
|
.oc-card--accent[data-tone="test"] { --oc-card-tone: var(--oc-mode-test); }
|
|
6791
6802
|
.oc-card--accent[data-tone="live"] { --oc-card-tone: var(--oc-mode-live); }
|
|
6803
|
+
/* A fixed minimum height (--oc-card-band-min-h), so the band of two cards side by side is equally high with or without a
|
|
6804
|
+
status, and does not jump when the status comes or goes. */
|
|
6792
6805
|
.oc-card-band {
|
|
6793
6806
|
display: flex;
|
|
6794
6807
|
flex-wrap: wrap;
|
|
6795
6808
|
align-items: center;
|
|
6809
|
+
align-content: center;
|
|
6796
6810
|
gap: 0.5rem 0.75rem;
|
|
6811
|
+
min-block-size: var(--oc-card-band-min-h, 4.25rem);
|
|
6797
6812
|
padding: 0.75rem 1rem;
|
|
6798
6813
|
background: color-mix(in oklab, var(--oc-card-tone, var(--oc-primary)) 14%, var(--oc-card));
|
|
6799
6814
|
border-block-end: 1px solid color-mix(in oklab, var(--oc-card-tone, var(--oc-primary)) 50%, transparent);
|
|
@@ -7704,6 +7719,9 @@ button.oc-stat-card:focus-visible { outline: 2px solid var(--oc-ring); outline-o
|
|
|
7704
7719
|
padding: 0;
|
|
7705
7720
|
border: 0;
|
|
7706
7721
|
appearance: none;
|
|
7722
|
+
/* Firefox clips a progress element (overflow: clip in its own style sheet): the glow at the end of the bar would be
|
|
7723
|
+
cut off there. */
|
|
7724
|
+
overflow: visible;
|
|
7707
7725
|
color: var(--oc-top-progress-color);
|
|
7708
7726
|
background: transparent;
|
|
7709
7727
|
pointer-events: none;
|
|
@@ -11855,10 +11873,11 @@ a.oc-attachment-image:hover > :is(img, .oc-media-art) { filter: brightness(1.05)
|
|
|
11855
11873
|
(a preview; give the box an aria-label or a caption so the preview still has a name). */
|
|
11856
11874
|
.oc-live-frame > [inert] { pointer-events: none; user-select: none; }
|
|
11857
11875
|
|
|
11858
|
-
/* Device: the page in a phone or a
|
|
11859
|
-
the border of a content-box frame, so the page keeps its exact ratio, and overflow: hidden gives the screen
|
|
11860
|
-
inner corners. Phone: 390 x 844 by default in the wrappers, at most --oc-live-phone-max wide.
|
|
11861
|
-
.
|
|
11876
|
+
/* Device: the page in a phone, a television or a laptop: a dark bezel with rounded corners around the scaled page. The
|
|
11877
|
+
bezel is the border of a content-box frame, so the page keeps its exact ratio, and overflow: hidden gives the screen
|
|
11878
|
+
its inner corners. Phone: 390 x 844 by default in the wrappers, at most --oc-live-phone-max wide. Laptop: 1440 x 900
|
|
11879
|
+
by default, see below. Color: --oc-live-bezel. */
|
|
11880
|
+
.oc-live-frame:is(.oc-live-frame--phone, .oc-live-frame--tv, .oc-live-frame--laptop) {
|
|
11862
11881
|
--oc-live-bezel: var(--color-duskblue-90);
|
|
11863
11882
|
box-sizing: content-box;
|
|
11864
11883
|
border: var(--oc-live-bezel-size) solid var(--oc-live-bezel);
|
|
@@ -11876,8 +11895,37 @@ a.oc-attachment-image:hover > :is(img, .oc-media-art) { filter: brightness(1.05)
|
|
|
11876
11895
|
inline-size: calc(100% - 2 * var(--oc-live-bezel-size));
|
|
11877
11896
|
border-radius: 0.625rem;
|
|
11878
11897
|
}
|
|
11898
|
+
/* Laptop: a thin bezel, square inner corners, and a base under the screen that is a little wider than it (with the notch
|
|
11899
|
+
to open the lid). The base is the ::after of the frame, drawn below it, so this frame does not clip (overflow:
|
|
11900
|
+
visible); the page clips itself. The frame leaves room at both sides and under it for the base, so it never overflows
|
|
11901
|
+
its column. Tokens: --oc-live-base (color), --oc-live-base-h (height), --oc-live-base-over (how far it sticks out). */
|
|
11902
|
+
.oc-live-frame--laptop {
|
|
11903
|
+
--oc-live-bezel-size: 0.375rem;
|
|
11904
|
+
--oc-live-base: var(--color-gray-30);
|
|
11905
|
+
--oc-live-base-h: 0.75rem;
|
|
11906
|
+
--oc-live-base-over: 4%;
|
|
11907
|
+
inline-size: calc(100% - 2 * var(--oc-live-bezel-size) - 2 * var(--oc-live-base-over));
|
|
11908
|
+
margin-inline: auto;
|
|
11909
|
+
margin-block-end: var(--oc-live-base-h);
|
|
11910
|
+
overflow: visible;
|
|
11911
|
+
border-radius: var(--oc-live-bezel-size) var(--oc-live-bezel-size) 0 0;
|
|
11912
|
+
}
|
|
11913
|
+
.oc-live-frame--laptop > :is(iframe, video, img, object, .oc-live-frame__content) { overflow: hidden; }
|
|
11914
|
+
.oc-live-frame--laptop::after {
|
|
11915
|
+
content: "";
|
|
11916
|
+
position: absolute;
|
|
11917
|
+
inset-inline: calc(-1 * (var(--oc-live-bezel-size) + var(--oc-live-base-over)));
|
|
11918
|
+
inset-block-start: calc(100% + var(--oc-live-bezel-size));
|
|
11919
|
+
block-size: var(--oc-live-base-h);
|
|
11920
|
+
border-radius: 0 0 50% 50% / 0 0 100% 100%;
|
|
11921
|
+
background:
|
|
11922
|
+
linear-gradient(to right, transparent 42%, oklch(from var(--oc-live-base) calc(l - 0.14) c h) 42% 58%, transparent 58%) top / 100% 40% no-repeat,
|
|
11923
|
+
linear-gradient(oklch(from var(--oc-live-base) calc(l + 0.08) c h), oklch(from var(--oc-live-base) calc(l - 0.12) c h));
|
|
11924
|
+
box-shadow: 0 6px 14px -4px oklch(from var(--color-black-60) l c h / 0.3);
|
|
11925
|
+
}
|
|
11879
11926
|
@media (forced-colors: active) {
|
|
11880
|
-
.oc-live-frame:is(.oc-live-frame--phone, .oc-live-frame--tv) { border-color: CanvasText; }
|
|
11927
|
+
.oc-live-frame:is(.oc-live-frame--phone, .oc-live-frame--tv, .oc-live-frame--laptop) { border-color: CanvasText; }
|
|
11928
|
+
.oc-live-frame--laptop::after { background: CanvasText; }
|
|
11881
11929
|
}
|
|
11882
11930
|
|
|
11883
11931
|
/* parts/media-logo.css */
|
|
@@ -12888,16 +12936,23 @@ a.oc-message__quote:focus-visible { outline: 2px solid var(--oc-ring); outline-o
|
|
|
12888
12936
|
}
|
|
12889
12937
|
.oc-skip-link:focus { translate: none; }
|
|
12890
12938
|
|
|
12891
|
-
/* Inline icon: 1.25em (1.1em in a button), never squeezed in a flex row.
|
|
12939
|
+
/* Inline icon: 1.25em (1.1em in a button), never squeezed in a flex row. Sizes --xs … --xl are fixed (0.875, 1, 1.25,
|
|
12940
|
+
1.5, 2rem). --oc-icon-ratio (width / height, set by Webicon for a 4:3 flag) keeps a wide icon in its own ratio. */
|
|
12892
12941
|
.oc-icon {
|
|
12893
|
-
|
|
12894
|
-
|
|
12942
|
+
--oc-icon-size: 1.25em;
|
|
12943
|
+
inline-size: calc(var(--oc-icon-size) * var(--oc-icon-ratio, 1));
|
|
12944
|
+
block-size: var(--oc-icon-size);
|
|
12895
12945
|
flex-shrink: 0;
|
|
12896
12946
|
}
|
|
12897
|
-
.oc-btn > .oc-icon {
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
}
|
|
12947
|
+
:where(.oc-btn) > .oc-icon { --oc-icon-size: 1.1em; }
|
|
12948
|
+
.oc-icon--xs { --oc-icon-size: 0.875rem; }
|
|
12949
|
+
.oc-icon--sm { --oc-icon-size: 1rem; }
|
|
12950
|
+
.oc-icon--md { --oc-icon-size: 1.25rem; }
|
|
12951
|
+
.oc-icon--lg { --oc-icon-size: 1.5rem; }
|
|
12952
|
+
.oc-icon--xl { --oc-icon-size: 2rem; }
|
|
12953
|
+
/* A webicon drawn as inline SVG (Webicon / OcWebicon / <x-oc::webicon>: svg[data-webicon]) sits in a line of text like
|
|
12954
|
+
the Iconify element did, also where a reset makes every svg a block. Any component rule still wins (no specificity). */
|
|
12955
|
+
:where(svg[data-webicon]) { display: inline-block; vertical-align: -0.125em; }
|
|
12901
12956
|
|
|
12902
12957
|
/* parts/site-brand-mark.css */
|
|
12903
12958
|
/* File: packages/ui/src/parts/site-brand-mark.css */
|