@scalio-cloud/ui 0.53.0 → 0.54.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
@@ -208,9 +208,12 @@ scalio-connect 0.8.0 `peers.web.admin_router`.
208
208
  `<TenantConnectStep client={...} app="Citadel" lang={lang} />` is the shared step «Microsoft-Tenant» for the setup
209
209
  wizards and the settings (ADR 0092 setup/S2): exactly one tenant, «Mit Microsoft verbinden» through «Scalio Setup»,
210
210
  the setup script as the way out, and the code that comes back as `#scalio_connect=<code>` is redeemed by itself. The
211
- app passes its own routes as `client`: `status()` (`{connected, organization, azure_tenant_id, missing, last_error}`),
211
+ app passes its own routes as `client`: `status()` (`{connected, organization, domain, azure_tenant_id, missing, last_error}`; `domain` optional),
212
212
  `link()` (`{url}`), `script()` (`{script}`), `redeem(code)` and optionally `check()`. An app with a tenant list
213
213
  creates its default tenant itself in these calls. `onChange(status)` runs after every action.
214
+ Layout (0.54.0, wizard sketch of 2026-11-10): one large blue «Mit Microsoft verbinden» with the Microsoft logo, the
215
+ script and the code folded away under «Ohne Browser-Anmeldung: Einrichtungsskript», no inner scrollbar; connected it
216
+ shows the green badge, tenant name and domain, and «Rechte prüfen» folded away (open when permissions are missing).
214
217
  Several views can show the tenant at once (back from «Scalio Setup» the wizard opens over the settings page, and
215
218
  only one of them takes the code). After a connect, check or removal a view calls `announceTenantChange()`, and
216
219
  every view that uses `useTenantChange(reload)` reads its state again; `TenantConnectStep` does both by itself. An
@@ -237,25 +240,23 @@ Pages that belong together under one menu item keep their own addresses: the ite
237
240
  on top. An app with two work areas (Nexus Identity and HR) puts `<WorkspaceSwitcher options value onSelect />`
238
241
  into the sidebar's `top`.
239
242
 
240
- **Page actions in the sidebar** (from 0.18.0, UISPEC section 2): `<Sidebar pageActions ... />` keeps Übersicht (the
241
- first item of a first section without heading) on top and adds a slot right below it. A page wraps its actions in
242
- `<PageActions>`; from 768px they move into the slot, on phones they stay in the page header. The slot takes no
243
- room on pages without actions; with actions it pushes the menu down.
243
+ **One button in the sidebar** (from 0.54.0, Markus 2026-11-10): the sidebar shows the search, the one blue
244
+ `primaryAction` (the app's main action) and the menu. No buttons below Übersicht and no second way to the same action:
245
+ a page does not repeat the main action in its header. Page actions (Neu …, Import, Zurück) stay in the page header;
246
+ `<PageActions>` renders them in place. `<Sidebar pageActions />` and `<ActionSlot />` (0.18.0 to 0.53.x) are still
247
+ accepted but do nothing.
244
248
 
245
249
  ```jsx
246
250
  <PageHeader title="Kontakte" actions={<PageActions><Button onClick={add}><Plus /> Kontakt</Button></PageActions>} />
247
- <PageHeader title={doc.number} actions={<PageActions><Button variant="outline" asChild><Link to="/invoices"><ArrowLeft /> Zurück</Link></Button></PageActions>} />
248
251
  ```
249
252
 
250
- Only actions that start something or lead away go there (Neu …, Import, Scannen, Zurück), at most two per page.
251
- Labels without "Neu"/"New": the + icon says it ("+ Kontakt", not "+ Neuer Kontakt").
252
- Filters, search, tabs and Speichern stay on the page. Apps with their own sidebar place `<ActionSlot />` themselves.
253
+ At most two page actions per page, only one of them blue. Labels without "Neu"/"New": the + icon says it
254
+ ("+ Kontakt", not "+ Neuer Kontakt"). Filters, search, tabs and Speichern stay on the page.
253
255
 
254
256
  ## Page templates (React, from 0.33.0)
255
257
 
256
258
  UISPEC section 2 «Page templates» (`nav/N10` B): every page is an overview, a list, a detail or the settings
257
- (`SettingsLayout`, below). The templates draw the header, put `actions` into `<PageActions>` (sidebar slot from
258
- 768px), and show `Loading` or `EmptyState` where the content would be.
259
+ (`SettingsLayout`, below). The templates draw the header, put `actions` into `<PageActions>` (in the header), and show `Loading` or `EmptyState` where the content would be.
259
260
 
260
261
  ```jsx
261
262
  <OverviewPage title="Übersicht" kpis={[{ label: "Tenants", value: 3 }, { label: "Abweichungen", value: 2, tone: "error" }]}>
@@ -272,8 +273,8 @@ UISPEC section 2 «Page templates» (`nav/N10` B): every page is an overview, a
272
273
  facts={[{ label: "Tenant-ID", value: t.id }]}>…</DetailPage>
273
274
  ```
274
275
 
275
- On a detail page `back` and `pageActions` (start something, lead away) go to the sidebar slot; `actions` are the
276
- record's own actions (Freigeben, Stornieren) and stay in the header. `badge` takes an app's own status badge.
276
+ On a detail page `back` sits above the title; `pageActions` (start something, lead away) and `actions` (the
277
+ record's own actions: Freigeben, Stornieren) sit on the right of the header. `badge` takes an app's own status badge.
277
278
 
278
279
  Panels sit in a grid with one column, two from 1024px and three from 1536px; key facts of a detail page move to
279
280
  a right column from 1024px and leave no gap when there are none.
package/nav.css CHANGED
@@ -217,6 +217,30 @@
217
217
  .scalio-support-conn-facts dt { color: hsl(var(--muted-foreground)); }
218
218
  .scalio-support-conn-facts dd { margin: 0; font-family: 'JetBrains Mono', monospace; overflow-wrap: anywhere; }
219
219
  .scalio-support-conn-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
220
+ /* Tenant step (react/tenant.js, 0.54.0): one large Microsoft button, script and code folded away, no inner scroll. */
221
+ .scalio-tenant-step { display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.875rem; }
222
+ .scalio-tenant-step .scalio-support-meta { margin: 0; }
223
+ .scalio-tenant-step .scalio-tenant-signin { display: flex; align-items: center; justify-content: center; gap: 0.625rem; width: 100%; height: 2.75rem; margin-top: 0; }
224
+ .scalio-tenant-ms { display: inline-flex; padding: 3px; border-radius: 2px; background: #fff; }
225
+ .scalio-tenant-ms svg { width: 14px; height: 14px; }
226
+ .scalio-tenant-more { border-top: 1px solid hsl(var(--border)); padding-top: 0.5rem; }
227
+ .scalio-tenant-more > summary {
228
+ cursor: pointer; list-style: none; font-size: 0.8125rem; font-weight: 600; color: hsl(var(--muted-foreground));
229
+ }
230
+ .scalio-tenant-more > summary::-webkit-details-marker { display: none; }
231
+ .scalio-tenant-more > summary::after { content: " \25B8"; }
232
+ .scalio-tenant-more[open] > summary::after { content: " \25BE"; }
233
+ .scalio-tenant-more > summary:hover { color: hsl(var(--foreground)); }
234
+ .scalio-tenant-script { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.5rem; }
235
+ .scalio-tenant-code { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; resize: vertical; }
236
+ .scalio-tenant-code-form { display: flex; flex-direction: column; gap: 0.25rem; }
237
+ .scalio-tenant-code-row { display: flex; gap: 0.5rem; align-items: stretch; }
238
+ .scalio-tenant-code-row .scalio-input { flex: 1 1 auto; min-width: 0; }
239
+ .scalio-tenant-step .scalio-tenant-code-row .scalio-btn-primary { margin-top: 0; flex-shrink: 0; }
240
+ .scalio-tenant-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 0; }
241
+ .scalio-tenant-facts dt { color: hsl(var(--muted-foreground)); }
242
+ .scalio-tenant-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
243
+ .scalio-tenant-facts dd.is-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 400; }
220
244
  .scalio-btn-danger { color: hsl(var(--destructive)); }
221
245
  .scalio-field-label { margin-top: 0.5rem; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: hsl(var(--muted-foreground)); }
222
246
  .scalio-input {
@@ -226,7 +250,7 @@
226
250
  .scalio-textarea { height: auto; padding: 0.5rem 0.75rem; resize: vertical; }
227
251
  .scalio-input:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 0; }
228
252
  .scalio-btn-primary {
229
- margin-top: 0.75rem; height: 2.5rem; border: 0; border-radius: 2px; cursor: pointer;
253
+ margin-top: 0.75rem; height: 2.5rem; padding: 0 1.25rem; border: 0; border-radius: 2px; cursor: pointer;
230
254
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
231
255
  font: inherit; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
232
256
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.53.0",
3
+ "version": "0.54.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/actions.js CHANGED
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
- // Page actions in the sidebar (UISPEC section 2, "Seitenaktionen", from 0.18.0). Buttons such as "Neu ...",
3
- // "Import" or "Zurück" sit right below Übersicht, close to the navigation, instead of far right in the page
4
- // header. The slot takes no room when a page has no actions; with actions it pushes the menu down.
5
- // Phones have no sidebar: there the actions stay in the page header.
2
+ // Page actions (UISPEC section 2, "Seitenaktionen"). From 0.18.0 to 0.53.x they moved into a slot in the sidebar
3
+ // below Übersicht. Since 0.54.0 (Markus 2026-11-10: no buttons below Übersicht, only one blue button in the
4
+ // sidebar, the main action) they stay where the page puts them: in the page header.
6
5
  //
7
- // The app turns the slot on with <Sidebar pageActions />; a page wraps its actions in <PageActions>.
8
- // No provider: the slot registers itself in a small store, so pages need no wiring.
6
+ // <PageActions> and <ActionSlot> stay exported so apps keep building; ActionSlot renders nothing and PageActions
7
+ // renders its children in place.
9
8
  const React = require("react");
10
9
  const h = React.createElement;
11
10
 
@@ -54,23 +53,16 @@ function useDesktop() {
54
53
  return desktop;
55
54
  }
56
55
 
57
- // The empty slot in the sidebar. Sidebar renders it when pageActions is set; apps with their own sidebar
58
- // can place it themselves.
59
- function ActionSlot({ testId }) {
60
- return h("div", { ref: setActionSlot, className: "scalio-action-slot", "data-testid": testId || "action-slot" });
56
+ // Kept for older apps: renders nothing (no page actions in the sidebar since 0.54.0).
57
+ function ActionSlot() {
58
+ setActionSlot(null);
59
+ return null;
61
60
  }
62
61
 
63
- // Wrap a page's actions: in the sidebar slot from 768px, otherwise where it stands (page header).
64
- // Only for actions that start something or lead away (Neu, Import, Scannen, Zurück); filters, search and
65
- // Speichern stay on the page.
66
- function PageActions({ children, testId }) {
67
- const slot = useActionSlot();
68
- const desktop = useDesktop();
62
+ // Wraps a page's actions; they stay where they stand (page header). Only actions that start something or lead
63
+ // away (Neu, Import, Scannen, Zurück); filters, search and Speichern stay on the page.
64
+ function PageActions({ children }) {
69
65
  if (children == null || children === false) return null;
70
- if (slot && desktop) {
71
- const ReactDOM = require("react-dom");
72
- return ReactDOM.createPortal(h("div", { className: "scalio-side-actions", "data-testid": testId || "page-actions" }, children), slot);
73
- }
74
66
  return h(React.Fragment, null, children);
75
67
  }
76
68
 
package/react/labels.js CHANGED
@@ -226,14 +226,17 @@ const LABELS = {
226
226
  beaconSuggestConnect: "Mit Beacon verbinden",
227
227
  // Shared step «Microsoft-Tenant» (TenantConnectStep, ADR 0092 setup/S2)
228
228
  tenantTitle: "Microsoft-Tenant",
229
- tenantHelp: "{app} liest Ihren Microsoft-Tenant mit der eigenen App-Registrierung «Scalio Lesen». Melden Sie sich als Globaler Administrator oder Administrator für privilegierte Rollen an; die Seite «Scalio Setup» legt die Registrierung an und bringt den Code selbst zurück. Scalio speichert keine Anmeldung und kein Token.",
229
+ tenantHelp: "{app} liest Ihren Microsoft-Tenant mit der App-Registrierung «Scalio Lesen». Melden Sie sich als Globaler Administrator an. Scalio speichert keine Anmeldung und kein Token.",
230
230
  tenantConnected: "Verbunden",
231
231
  tenantNotConnected: "Noch nicht verbunden",
232
232
  tenantOrganization: "Organisation",
233
233
  tenantId: "Tenant-ID",
234
234
  tenantMissing: "Fehlende Berechtigungen: Skript erneut ausführen",
235
235
  tenantSignIn: "Mit Microsoft verbinden",
236
- tenantOrScript: "Oder mit dem Einrichtungsskript",
236
+ tenantOrScript: "Ohne Browser-Anmeldung: Einrichtungsskript",
237
+ tenantRights: "Rechte prüfen",
238
+ tenantName: "Tenant",
239
+ tenantDomain: "Domain",
237
240
  tenantScriptHelp: "In der Azure Cloud Shell (PowerShell) oder in PowerShell 7 mit dem Modul Microsoft.Graph ausführen. Es zeigt zuerst die Berechtigungen; erneutes Ausführen ist sicher.",
238
241
  tenantShowScript: "Skript anzeigen",
239
242
  tenantCode: "Verbindungscode",
@@ -791,14 +794,17 @@ const LABELS = {
791
794
  beaconSuggested: "Scalio Beacon runs for your organisation at {url}. Connect this installation with one click, without a pairing code.",
792
795
  beaconSuggestConnect: "Connect with Beacon",
793
796
  tenantTitle: "Microsoft tenant",
794
- tenantHelp: "{app} reads your Microsoft tenant with its own app registration «Scalio Lesen». Sign in as Global Administrator or Privileged Role Administrator; the page «Scalio Setup» creates the registration and brings the code back by itself. Scalio stores no sign-in and no token.",
797
+ tenantHelp: "{app} reads your Microsoft tenant with the app registration «Scalio Lesen». Sign in as Global Administrator. Scalio stores no sign-in and no token.",
795
798
  tenantConnected: "Connected",
796
799
  tenantNotConnected: "Not connected yet",
797
800
  tenantOrganization: "Organisation",
798
801
  tenantId: "Tenant ID",
799
802
  tenantMissing: "Missing permissions: run the script again",
800
803
  tenantSignIn: "Connect with Microsoft",
801
- tenantOrScript: "Or with the setup script",
804
+ tenantOrScript: "Without browser sign-in: setup script",
805
+ tenantRights: "Check permissions",
806
+ tenantName: "Tenant",
807
+ tenantDomain: "Domain",
802
808
  tenantScriptHelp: "Run it in the Azure Cloud Shell (PowerShell) or in PowerShell 7 with the Microsoft.Graph module. It shows the permissions first; running it again is safe.",
803
809
  tenantShowScript: "Show script",
804
810
  tenantCode: "Connection code",
package/react/nav.js CHANGED
@@ -6,7 +6,6 @@ const React = require("react");
6
6
  const h = React.createElement;
7
7
  const Icons = require("./icons");
8
8
  const { labelsFor } = require("./labels");
9
- const { ActionSlot } = require("./actions");
10
9
 
11
10
  function cx() {
12
11
  return Array.prototype.slice.call(arguments).filter(Boolean).join(" ");
@@ -102,21 +101,17 @@ function SearchButton({ search, lang, labels, testIdPrefix, onNavigate }) {
102
101
 
103
102
  // Sidebar. variant "desktop" shows from 768px, "drawer" is the same content inside NavDrawer.
104
103
  // link: the router's NavLink (gets to, end, className(fn), onClick); without it plain <a> + activePath.
105
- // pageActions: a slot for the page's actions (react/actions.js) right below Übersicht, desktop only.
106
- // Übersicht (first item of the first section when it has no heading) then stays on top and does not scroll.
104
+ // Only one button in the sidebar: the blue primaryAction on top (Markus 2026-11-10, no buttons below Übersicht).
105
+ // pageActions is still accepted for older apps but does nothing: page actions stay in the page header.
107
106
  function Sidebar(props) {
108
107
  const {
109
108
  nav, link, activePath, top, search, primaryAction, footer, version, commit, lang, labels,
110
- variant, onNavigate, testId, testIdPrefix, pageActions,
109
+ variant, onNavigate, testId, testIdPrefix,
111
110
  } = props;
112
111
  const prefix = testIdPrefix != null ? testIdPrefix : variant === "drawer" ? "m-" : "";
113
112
  const L = labelsFor(lang, labels);
114
113
  const sections = visibleSections(nav);
115
- const slot = !!pageActions && variant !== "drawer";
116
- // Only Übersicht (first item of a first section without heading) is pinned; the rest of that section scrolls.
117
- const first = sections[0];
118
- const pinned = slot && first && !first.label ? Object.assign({}, first, { items: first.items.slice(0, 1) }) : null;
119
- const rest = !pinned ? sections : first.items.length > 1 ? [Object.assign({}, first, { items: first.items.slice(1) })].concat(sections.slice(1)) : sections.slice(1);
114
+ const rest = sections;
120
115
  const section = (sec, i) =>
121
116
  h(
122
117
  "div",
@@ -134,9 +129,7 @@ function Sidebar(props) {
134
129
  top ? h("div", { className: "scalio-sidebar-top" }, top) : null,
135
130
  h(SearchButton, { search, lang, labels, testIdPrefix: prefix, onNavigate }),
136
131
  h(PrimaryAction, { action: primaryAction, link, onNavigate, testIdPrefix: prefix }),
137
- pinned ? h("div", { className: "scalio-sidebar-pinned" }, section(pinned, 0)) : null,
138
- slot ? h(ActionSlot, { testId: `${prefix}action-slot` }) : null,
139
- h("div", { className: cx("scalio-sidebar-scroll", slot && "has-action-slot") }, rest.map(section)),
132
+ h("div", { className: "scalio-sidebar-scroll" }, rest.map(section)),
140
133
  footer || version
141
134
  ? h(
142
135
  "div",
package/react/pages.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Page templates (UISPEC section 2 «Page templates», nav/N10 B, from 0.33.0): Overview, List and Detail. The
3
- // Settings template is SettingsLayout (settings.js). A page passes its data; header, page actions in the sidebar
4
- // slot, grids, toolbar, loading and empty state look the same in every app.
3
+ // Settings template is SettingsLayout (settings.js). A page passes its data; header, page actions
4
+ // in the header, grids, toolbar, loading and empty state look the same in every app.
5
5
  const React = require("react");
6
6
  const h = React.createElement;
7
7
  const { labelsFor } = require("./labels");
@@ -138,25 +138,23 @@ function KeyFacts({ items, title, testId }) {
138
138
  );
139
139
  }
140
140
 
141
- // Detail: back link and actions that lead away (`pageActions`) in the sidebar slot from 768px, header with status
142
- // badge and the record's own actions (`actions`: Freigeben, Stornieren; they stay on the page), tabs, key facts on
143
- // the right. tabs: [{id, label}] with tab/onTab, or leave them out for one section. status: {tone, label}, or
141
+ // Detail: back link above the title, header with status badge, actions that lead away (`pageActions`) and the
142
+ // record's own actions (`actions`: Freigeben, Stornieren) on the right (no page actions in the sidebar since
143
+ // 0.54.0), tabs, key facts on the right. tabs: [{id, label}] with tab/onTab, or leave them out for one section. status: {tone, label}, or
144
144
  // `badge` for an app's own badge element.
145
145
  function DetailPage({ title, subtitle, back, pageActions, status, badge: ownBadge, actions, tabs, tab, onTab, facts, factsTitle, loading, children, lang, labels, testId }) {
146
146
  const L = labelsFor(lang, labels);
147
147
  const list = (tabs || []).filter(Boolean);
148
148
  const badge = ownBadge || (status && status.label ? h(StatusBadge, { tone: status.tone, testId: "detail-status" }, status.label) : null);
149
- const slot = back || pageActions
150
- ? h(React.Fragment, null, back ? h("span", { className: "scalio-detail-back", "data-testid": "detail-back" }, back) : null, pageActions || null)
151
- : null;
149
+ const own = pageActions || actions ? h(React.Fragment, null, pageActions || null, actions || null) : null;
152
150
  return h(
153
151
  "div",
154
152
  { className: "scalio-template is-detail", "data-testid": testId || "detail-page" },
155
153
  h(Header, {
156
154
  title: badge ? h(React.Fragment, null, title, " ", badge) : title,
157
155
  subtitle,
158
- actions: slot,
159
- extra: actions || null,
156
+ back: back ? h("span", { className: "scalio-detail-back", "data-testid": "detail-back" }, back) : null,
157
+ actions: own,
160
158
  }),
161
159
  list.length
162
160
  ? h(
package/react/tenant.js CHANGED
@@ -11,6 +11,7 @@
11
11
  const React = require("react");
12
12
  const h = React.createElement;
13
13
  const { labelsFor } = require("./labels");
14
+ const { MicrosoftLogo } = require("./auth");
14
15
 
15
16
  function errorText(err) {
16
17
  const d = err && err.response && err.response.data && err.response.data.detail;
@@ -98,57 +99,77 @@ function TenantConnectStep({ client, app = "Scalio", lang, labels, onChange, sho
98
99
  Object.assign(document.createElement("a"), { href: url, download: "Scalio-Lesen.ps1" }).click();
99
100
  URL.revokeObjectURL(url);
100
101
  };
101
- return h(
102
+ // Layout from the wizard sketch (Markus 2026-11-10): one large «Mit Microsoft verbinden», the script and the code
103
+ // folded away, no inner scrollbar; connected: green badge, tenant name and domain, «Rechte prüfen» folded away.
104
+ const scriptBox = h(
102
105
  "div",
103
- { className: "scalio-support-conn", "data-testid": "tenant-step" },
104
- h("div", { className: "scalio-support-conn-head" },
105
- h("span", { className: "scalio-badge " + (st.connected ? "is-ok" : ""), "data-testid": "tenant-state" },
106
- st.connected ? L.tenantConnected : L.tenantNotConnected)),
107
- st.connected
108
- ? h("dl", { className: "scalio-support-conn-facts" },
109
- st.organization ? h(React.Fragment, null, h("dt", null, L.tenantOrganization), h("dd", null, st.organization)) : null,
110
- st.azure_tenant_id ? h(React.Fragment, null, h("dt", null, L.tenantId), h("dd", null, st.azure_tenant_id)) : null)
111
- : h("p", { className: "scalio-support-meta" }, L.tenantHelp.replace("{app}", app)),
106
+ { className: "scalio-tenant-script", "data-testid": "tenant-script-box" },
107
+ h("p", { className: "scalio-support-meta" }, L.tenantScriptHelp),
108
+ script
109
+ ? h(React.Fragment, null,
110
+ h("textarea", { readOnly: true, rows: 6, className: "scalio-input scalio-tenant-code", value: script, "data-testid": "tenant-script",
111
+ onFocus: (e) => e.target.select() }),
112
+ h("div", { className: "scalio-support-conn-actions" },
113
+ h("button", { type: "button", className: "scalio-btn",
114
+ onClick: () => navigator.clipboard && navigator.clipboard.writeText(script) }, L.copy),
115
+ h("button", { type: "button", className: "scalio-btn", onClick: download }, L.download)))
116
+ : h("div", { className: "scalio-support-conn-actions" },
117
+ h("button", { type: "button", className: "scalio-btn", disabled: !!busy, "data-testid": "tenant-show-script",
118
+ onClick: () => run("script", async () => setScript(((await client.script()) || {}).script || "")) }, L.tenantShowScript)),
119
+ h("form", { className: "scalio-tenant-code-form", onSubmit: (e) => { e.preventDefault(); redeem(code); } },
120
+ h("label", { className: "scalio-field-label", htmlFor: "tenant-code" }, L.tenantCode),
121
+ h("p", { className: "scalio-support-meta" }, L.tenantCodeHelp),
122
+ h("div", { className: "scalio-tenant-code-row" },
123
+ h("input", { id: "tenant-code", className: "scalio-input", placeholder: "SCALIO1.…", value: code,
124
+ onChange: (e) => setCode(e.target.value), "data-testid": "tenant-code" }),
125
+ h("button", { type: "submit", className: "scalio-btn-primary", disabled: !!busy || code.trim().length < 10,
126
+ "data-testid": "tenant-connect" }, L.tenantConnect)))
127
+ );
128
+ const fold = (label, open, testId, body) =>
129
+ h("details", { className: "scalio-tenant-more", open: open || undefined, "data-testid": testId },
130
+ h("summary", null, label), body);
131
+ const notices = h(React.Fragment, null,
112
132
  st.last_error ? h("div", { className: "scalio-notice is-error", "data-testid": "tenant-last-error" }, st.last_error) : null,
113
133
  missing.length
114
134
  ? h("div", { className: "scalio-notice is-error", "data-testid": "tenant-missing" }, L.tenantMissing + ": " + missing.join(", "))
115
135
  : null,
116
136
  note ? h("div", { className: "scalio-notice is-ok", "data-testid": "tenant-note" }, note) : null,
117
- error ? h("div", { className: "scalio-notice is-error", role: "alert", "data-testid": "tenant-error" }, error) : null,
118
- h("div", { className: "scalio-support-conn-actions" },
119
- st.connected
120
- ? (client.check
121
- ? h("button", { type: "button", className: "scalio-btn", disabled: !!busy, "data-testid": "tenant-check",
122
- onClick: () => run("check", () => client.check()) }, L.tenantCheck)
123
- : null)
124
- : h("button", { type: "button", className: "scalio-btn-primary", disabled: !!busy, "data-testid": "tenant-signin",
125
- onClick: signIn }, L.tenantSignIn)),
126
- st.connected && !missing.length
127
- ? null
128
- : h(
129
- "div",
130
- { className: "scalio-support-form", "data-testid": "tenant-script-box" },
131
- h("div", { className: "scalio-field-label" }, L.tenantOrScript),
132
- h("p", { className: "scalio-support-meta" }, L.tenantScriptHelp),
133
- script
134
- ? h(React.Fragment, null,
135
- h("textarea", { readOnly: true, rows: 8, className: "scalio-input", value: script, "data-testid": "tenant-script",
136
- onFocus: (e) => e.target.select() }),
137
- h("div", { className: "scalio-support-conn-actions" },
138
- h("button", { type: "button", className: "scalio-btn",
139
- onClick: () => navigator.clipboard && navigator.clipboard.writeText(script) }, L.copy),
140
- h("button", { type: "button", className: "scalio-btn", onClick: download }, L.download)))
141
- : h("button", { type: "button", className: "scalio-btn", disabled: !!busy, "data-testid": "tenant-show-script",
142
- onClick: () => run("script", async () => setScript(((await client.script()) || {}).script || "")) }, L.tenantShowScript),
143
- h("form", { onSubmit: (e) => { e.preventDefault(); redeem(code); } },
144
- h("label", { className: "scalio-field-label", htmlFor: "tenant-code" }, L.tenantCode),
145
- h("p", { className: "scalio-support-meta" }, L.tenantCodeHelp),
146
- h("input", { id: "tenant-code", className: "scalio-input", placeholder: "SCALIO1.…", value: code,
147
- onChange: (e) => setCode(e.target.value), "data-testid": "tenant-code" }),
148
- h("button", { type: "submit", className: "scalio-btn-primary", disabled: !!busy || code.trim().length < 10,
149
- "data-testid": "tenant-connect" }, L.tenantConnect))
150
- ),
151
- showLater && !st.connected ? h("p", { className: "scalio-support-meta" }, L.tenantLater) : null
137
+ error ? h("div", { className: "scalio-notice is-error", role: "alert", "data-testid": "tenant-error" }, error) : null);
138
+ const badge = h("span", { className: "scalio-badge " + (st.connected ? "is-ok" : ""), "data-testid": "tenant-state" },
139
+ st.connected ? L.tenantConnected : L.tenantNotConnected);
140
+
141
+ if (st.connected) {
142
+ const domain = st.domain || st.default_domain || "";
143
+ return h(
144
+ "div",
145
+ { className: "scalio-tenant-step is-connected", "data-testid": "tenant-step" },
146
+ h("div", { className: "scalio-support-conn-head" }, badge),
147
+ h("dl", { className: "scalio-tenant-facts" },
148
+ st.organization ? h(React.Fragment, null, h("dt", null, L.tenantName), h("dd", { "data-testid": "tenant-name" }, st.organization)) : null,
149
+ domain ? h(React.Fragment, null, h("dt", null, L.tenantDomain), h("dd", { "data-testid": "tenant-domain" }, domain)) : null,
150
+ st.azure_tenant_id ? h(React.Fragment, null, h("dt", null, L.tenantId), h("dd", { className: "is-mono" }, st.azure_tenant_id)) : null),
151
+ notices,
152
+ client.check || missing.length
153
+ ? fold(L.tenantRights, missing.length > 0, "tenant-rights", h(React.Fragment, null,
154
+ client.check
155
+ ? h("div", { className: "scalio-support-conn-actions" },
156
+ h("button", { type: "button", className: "scalio-btn", disabled: !!busy, "data-testid": "tenant-check",
157
+ onClick: () => run("check", () => client.check()) }, L.tenantCheck))
158
+ : null,
159
+ missing.length ? scriptBox : null))
160
+ : null
161
+ );
162
+ }
163
+ return h(
164
+ "div",
165
+ { className: "scalio-tenant-step", "data-testid": "tenant-step" },
166
+ h("div", { className: "scalio-support-conn-head" }, badge),
167
+ h("p", { className: "scalio-support-meta" }, L.tenantHelp.replace("{app}", app)),
168
+ notices,
169
+ h("button", { type: "button", className: "scalio-btn-primary scalio-tenant-signin", disabled: !!busy, "data-testid": "tenant-signin",
170
+ onClick: signIn }, h("span", { className: "scalio-tenant-ms", "aria-hidden": "true" }, h(MicrosoftLogo)), h("span", null, L.tenantSignIn)),
171
+ fold(L.tenantOrScript, !!script || code.length > 0, "tenant-script-more", scriptBox),
172
+ showLater ? h("p", { className: "scalio-support-meta", "data-testid": "tenant-later" }, L.tenantLater) : null
152
173
  );
153
174
  }
154
175