@scalio-cloud/ui 0.67.0 → 0.68.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.
Files changed (3) hide show
  1. package/nav.css +1 -0
  2. package/package.json +1 -1
  3. package/react/nav.js +40 -11
package/nav.css CHANGED
@@ -139,6 +139,7 @@
139
139
  .scalio-switcher-item.is-active { background: #002FA7; color: #fff; }
140
140
  .scalio-switcher-item.is-off, .scalio-switcher-item.is-soon { cursor: not-allowed; }
141
141
  .scalio-switcher-item.is-soon { color: #52525b; }
142
+ .scalio-switcher-sep { width: 1px; height: 14px; margin: 0 0.375rem; background: #3f3f46; flex: none; }
142
143
  .scalio-switcher-icon { width: 0.75rem; height: 0.75rem; }
143
144
  .scalio-switcher-soon { margin-left: 0.125rem; padding: 0 0.25rem; border: 1px solid #3f3f46; border-radius: 2px; font-size: 9px; line-height: 14px; text-transform: none; letter-spacing: normal; color: #71717a; }
144
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.67.0",
3
+ "version": "0.68.0",
4
4
  "description": "Scalio Control Room design tokens, Tailwind preset, self-hosted fonts, the shared app header, sign-in layout, sidebar and page blocks",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "private": false,
package/react/nav.js CHANGED
@@ -304,18 +304,36 @@ function ContextSelect({ label, value, options, onChange, hint, after, testId, i
304
304
  }
305
305
 
306
306
  // --- Product switcher -------------------------------------------------------------------------
307
- // Display order of the app group. Compass is not part of it (decided 2026-10-26).
307
+ // Display order of the app group, in groups (Markus 2026-11-12): identity | M365 governance | devices and
308
+ // desktops | work. A thin divider separates the groups. Compass is not part of it (decided 2026-10-26).
308
309
  const PRODUCTS = [
309
- { key: "nexus", name: "Nexus", icon: Icons.Fingerprint },
310
- { key: "rosetta", name: "Rosetta", icon: Icons.FileStack },
311
- { key: "foundry", name: "Foundry", icon: Icons.Hammer },
312
- { key: "citadel", name: "Citadel", icon: Icons.ShieldCheck },
313
- { key: "beacon", name: "Beacon", icon: Icons.RadioTower },
314
- { key: "pulse", name: "Pulse", icon: Icons.Activity },
315
- { key: "folio", name: "Folio", icon: Icons.Library },
316
- { key: "atrium", name: "Atrium", icon: Icons.Monitor },
310
+ { key: "nexus", name: "Nexus", icon: Icons.Fingerprint, group: "identity" },
311
+ { key: "rosetta", name: "Rosetta", icon: Icons.FileStack, group: "governance" },
312
+ { key: "foundry", name: "Foundry", icon: Icons.Hammer, group: "governance" },
313
+ { key: "citadel", name: "Citadel", icon: Icons.ShieldCheck, group: "governance" },
314
+ { key: "pulse", name: "Pulse", icon: Icons.Activity, group: "devices" },
315
+ { key: "atrium", name: "Atrium", icon: Icons.Monitor, group: "devices" },
316
+ { key: "beacon", name: "Beacon", icon: Icons.RadioTower, group: "work" },
317
+ { key: "folio", name: "Folio", icon: Icons.Library, group: "work" },
317
318
  ];
318
319
 
320
+ // Each app opens in its own tab, named after the app: a second click finds that tab again instead of opening
321
+ // another one. The current tab takes the name of its app, so a tab opened from the switcher is found as well.
322
+ // Browsers only find tabs that are related (opened from one another); a tab the person opened by hand opens anew.
323
+ function switcherTarget(key) {
324
+ return `scalio-${key}`;
325
+ }
326
+
327
+ function nameCurrentTab(current) {
328
+ if (typeof window === "undefined" || !current) return;
329
+ try {
330
+ const name = window.name || "";
331
+ if (!name || name.startsWith("scalio-")) window.name = switcherTarget(current);
332
+ } catch (e) {
333
+ /* window.name is not writable in some sandboxes */
334
+ }
335
+ }
336
+
319
337
  function productStatus(product, current) {
320
338
  if (product.key === current) return "active";
321
339
  return product.soon ? "soon" : "available";
@@ -352,6 +370,16 @@ function scalioFeatures(answer) {
352
370
  function ProductSwitcher({ current, links, stage, sso, lang, labels, products, testId }) {
353
371
  const L = labelsFor(lang, labels);
354
372
  const badge = stageBadge(stage);
373
+ React.useEffect(() => nameCurrentTab(current), [current]);
374
+ const list = products || PRODUCTS;
375
+ const items = [];
376
+ list.forEach((product, i) => {
377
+ const prev = list[i - 1];
378
+ if (prev && product.group && prev.group && product.group !== prev.group) {
379
+ items.push(h("span", { key: `sep-${product.key}`, className: "scalio-switcher-sep", "aria-hidden": "true", "data-testid": "switcher-separator" }));
380
+ }
381
+ items.push(product);
382
+ });
355
383
  return h(
356
384
  "div",
357
385
  { className: "scalio-switcher", "data-testid": testId || "scalio-product-switcher" },
@@ -359,7 +387,8 @@ function ProductSwitcher({ current, links, stage, sso, lang, labels, products, t
359
387
  badge
360
388
  ? h("span", { className: `scalio-stage scalio-stage-${stage}`, title: L.stageHint, "data-testid": "scalio-stage-badge", "data-stage": stage }, badge)
361
389
  : null,
362
- (products || PRODUCTS).map((product) => {
390
+ items.map((product) => {
391
+ if (React.isValidElement(product)) return product;
363
392
  const status = productStatus(product, current);
364
393
  const Icon = product.icon;
365
394
  const href = switcherHref(product, links, sso, current);
@@ -370,7 +399,7 @@ function ProductSwitcher({ current, links, stage, sso, lang, labels, products, t
370
399
  status === "soon" ? h("span", { key: "s", className: "scalio-switcher-soon", "data-testid": `product-soon-${product.key}` }, L.soon) : null,
371
400
  ];
372
401
  if (href) {
373
- return h("a", Object.assign({ href, title: L.switchTo, className: "scalio-switcher-item is-link" }, common), content);
402
+ return h("a", Object.assign({ href, target: switcherTarget(product.key), title: L.switchTo, className: "scalio-switcher-item is-link" }, common), content);
374
403
  }
375
404
  const title = status === "active" ? L.activeApp : status === "soon" ? L.comingSoon : L.notSetUp;
376
405
  return h(