@scalio-cloud/ui 0.49.0 → 0.50.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.
package/README.md CHANGED
@@ -439,6 +439,19 @@ Test IDs: `confirm-dialog`, `confirm-dialog-ok`, `confirm-dialog-cancel`, `confi
439
439
  with `askConfirm` and then shows `UpdateProgress` (`saas-update-progress`): it polls `/version.json` (props
440
440
  `versionUrl`, `checkVersion`, `pollMs` 5 s, `timeoutMs` 20 min) and reloads the page once the new version runs.
441
441
 
442
+ ## Keyboard: rows and focus ring (from 0.50.0)
443
+
444
+ ADR 0095 `kbd/K4`: a row that opens with a click is reachable with Tab and opens with Enter or Space. Spread
445
+ `rowOpenProps` on the row; a click or Enter on a button, link or field inside the row stays with that control:
446
+
447
+ ```js
448
+ import { rowOpenProps } from "@scalio-cloud/ui/react";
449
+ <tr key={t.id} {...rowOpenProps(() => navigate(`/tickets/${t.key}`), { label: `${t.key} öffnen` })}>…</tr>
450
+ ```
451
+
452
+ `kbd/K5`: `base.css` draws a focus ring (`--ring`, 2px) on every link, button, field, `summary` and element with
453
+ `tabindex` that has no focus style of its own. The rule uses `:where()` (no specificity), so any own style wins.
454
+
442
455
  ## Two-factor card and license panel (React)
443
456
 
444
457
  The same backend routes in every app, so the apps pass only their axios instance and a few helpers.
package/base.css CHANGED
@@ -10,3 +10,12 @@ h1, h2, h3, h4, .font-display {
10
10
  code, pre, kbd, .font-mono {
11
11
  font-family: 'JetBrains Mono', ui-monospace, monospace;
12
12
  }
13
+
14
+ /* Keyboard (ADR 0095 kbd/K5): every control shows where the focus is. :where() has no specificity, so a component's
15
+ own focus style wins; this is the fallback for controls without one. Never remove it without a replacement. */
16
+ :where(a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
17
+ outline: 2px solid hsl(var(--ring));
18
+ outline-offset: 2px;
19
+ }
20
+ .scalio-row-open { cursor: pointer; }
21
+ .scalio-row-open:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.49.0",
3
+ "version": "0.50.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/index.js CHANGED
@@ -378,6 +378,6 @@ module.exports = {
378
378
  TEST_IDS,
379
379
  initials,
380
380
  };
381
- Object.assign(module.exports, Nav, Blocks, require("./settings"), require("./support"), require("./beacon"), require("./security"), require("./license"), require("./palette"), require("./unify"), require("./profile"), require("./actions"), require("./selftest"), require("./users"), require("./customers"), require("./roles"), require("./wizard"), require("./maintenance"), require("./backup"), require("./audit"), require("./mail"), require("./saas_updates"), require("./pages"), require("./tenant"), require("./fields"), require("./dialog"));
381
+ Object.assign(module.exports, Nav, Blocks, require("./settings"), require("./support"), require("./beacon"), require("./security"), require("./license"), require("./palette"), require("./unify"), require("./profile"), require("./actions"), require("./selftest"), require("./users"), require("./customers"), require("./roles"), require("./wizard"), require("./maintenance"), require("./backup"), require("./audit"), require("./mail"), require("./saas_updates"), require("./pages"), require("./tenant"), require("./fields"), require("./dialog"), require("./keyboard"));
382
382
  // After the exports above: auth.js uses LanguageToggle and ThemeToggle from this module.
383
383
  Object.assign(module.exports, require("./auth"), require("./session"), require("./setup"), require("./clientErrors"));
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // Keyboard standard of ADR 0095. kbd/K4: a row (table row, list entry, card) that opens with a click is reachable
3
+ // with Tab and opens with Enter or Space. Use it as <tr {...rowOpenProps(() => open(t), { label })}>.
4
+
5
+ const INTERACTIVE = "a,button,input,select,textarea,summary,label,[role=button],[role=link],[contenteditable]";
6
+
7
+ // Whether the event comes from a control inside the row (that control handles it itself).
8
+ function fromInner(e) {
9
+ const t = e.target;
10
+ if (!t || t === e.currentTarget || typeof t.closest !== "function") return false;
11
+ const hit = t.closest(INTERACTIVE);
12
+ return !!hit && hit !== e.currentTarget && e.currentTarget.contains(hit);
13
+ }
14
+
15
+ function rowOpenProps(onOpen, opts) {
16
+ if (typeof onOpen !== "function") return {};
17
+ const o = opts || {};
18
+ const props = {
19
+ tabIndex: 0,
20
+ onClick(e) {
21
+ if (fromInner(e)) return;
22
+ onOpen(e);
23
+ },
24
+ onKeyDown(e) {
25
+ if (e.key !== "Enter" && e.key !== " ") return;
26
+ if (e.target !== e.currentTarget || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey) return;
27
+ e.preventDefault();
28
+ onOpen(e);
29
+ },
30
+ className: o.className ? `scalio-row-open ${o.className}` : "scalio-row-open",
31
+ };
32
+ if (o.label) props["aria-label"] = o.label;
33
+ return props;
34
+ }
35
+
36
+ module.exports = { rowOpenProps };
@@ -62,6 +62,7 @@ const LABELS = {
62
62
  lastDone: "{version} installiert am {at}",
63
63
  lastError: "{version} fehlgeschlagen am {at}, zurück auf der alten Version",
64
64
  unreachable: "Compass ist gerade nicht erreichbar. Updates laufen trotzdem wie geplant.",
65
+ notConnected: "Die Verbindung dieser Instanz zu Scalio wird gerade eingerichtet. Danach sehen Sie hier die Updates. Bleibt diese Meldung länger als eine Stunde, melden Sie sich bitte beim Support.",
65
66
  saved: "Gespeichert.",
66
67
  weekdays: ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
67
68
  },
@@ -115,6 +116,7 @@ const LABELS = {
115
116
  lastDone: "{version} installed on {at}",
116
117
  lastError: "{version} failed on {at}, back on the old version",
117
118
  unreachable: "Compass cannot be reached right now. Updates still run as planned.",
119
+ notConnected: "Scalio is still setting up the connection of this instance. The updates show here once it is ready. If this message stays for more than an hour, please contact support.",
118
120
  saved: "Saved.",
119
121
  weekdays: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
120
122
  },
@@ -306,6 +308,13 @@ function SaasUpdatesPanel(props) {
306
308
  error ? h("div", { className: "scalio-notice is-error", role: "alert" }, error) : null);
307
309
  if (st.saas === false) return null;
308
310
 
311
+ // No active support connection: nothing to show or change until Compass has paired the instance (in SaaS
312
+ // Compass pairs it, never the customer). Older scalio-connect only sends the error text.
313
+ if (st.connected === false || (st.connected === undefined && st.error === "Keine Verbindung zu Compass")) {
314
+ return h(SettingsSection, { id: "updates", title: L.title, description: L.hint, testId: "saas-updates" },
315
+ h("div", { className: "scalio-notice is-warn", "data-testid": "saas-updates-not-connected" }, L.notConnected));
316
+ }
317
+
309
318
  const offer = st.offer;
310
319
  const rows = [];
311
320
  if (st.reachable === false) rows.push(h("div", { key: "u", className: "scalio-notice is-warn", "data-testid": "saas-updates-unreachable" }, L.unreachable));