@scalio-cloud/ui 0.5.0 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+ - Phones: the context select (tenant, customer) is hidden in the header below 640px, there is no room next to
5
+ the header buttons. `AppShell` takes `drawerTop` and shows it above the navigation in the phone drawer.
6
+
3
7
  ## 0.5.0
4
8
  - **Visible change:** `rounded-sm` is now 2px as UISPEC says (was 0px from the preset). Buttons, fields, cards and
5
9
  badges in Nexus, Citadel and Foundry get barely visible round corners; Rosetta already had 2px and can drop its
package/README.md CHANGED
@@ -102,6 +102,7 @@ const apps = useScalioApps(() => api.get("/apps").then((r) => r.data)); // onc
102
102
  sidebar={<Sidebar nav={NAV} link={NavLink} lang={lang} version={VERSION} commit={COMMIT}
103
103
  search={{ onOpen: openPalette, shortcut: "⌘K" }} primaryAction={{ label: t("Scan starten"), icon: Play, onSelect: scan }} />}
104
104
  drawerOpen={drawer} onDrawerClose={() => setDrawer(false)} // phones: same sidebar in a drawer (test ids with "m-")
105
+ drawerTop={<ContextSelect ... testId="m-tenant-switcher" />} // below 640px the header hides the select, the drawer shows it
105
106
  >
106
107
  <Routes>...</Routes>
107
108
  </AppShell>
package/nav.css CHANGED
@@ -97,8 +97,13 @@
97
97
  .scalio-switcher-icon { width: 0.75rem; height: 0.75rem; }
98
98
  .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; }
99
99
 
100
- /* Context select (tenant, customer, organisation) in the header */
100
+ /* Context select (tenant, customer, organisation) in the header; below 640px it moves into the drawer (drawerTop) */
101
101
  .scalio-context { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
102
+ .scalio-header .scalio-context { display: none; }
103
+ @media (min-width: 640px) { .scalio-header .scalio-context { display: flex; } }
104
+ .scalio-sidebar-top .scalio-context { flex-wrap: wrap; }
105
+ .scalio-sidebar-top .scalio-context-label { display: block; width: 100%; }
106
+ .scalio-sidebar-top .scalio-context-field, .scalio-sidebar-top .scalio-context-select { width: 100%; max-width: none; }
102
107
  .scalio-context-label { display: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: hsl(var(--muted-foreground)); }
103
108
  @media (min-width: 1024px) { .scalio-context-label { display: inline; } }
104
109
  .scalio-context-field { position: relative; min-width: 0; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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
@@ -190,7 +190,9 @@ function NavDrawer({ open, onClose, children, lang, labels, testId }) {
190
190
 
191
191
  // Whole frame: switcher, header, banners, then sidebar + content. The same sidebar element is shown
192
192
  // inside the drawer on phones (variant "drawer", closes on navigation).
193
- function AppShell({ switcher, header, banner, sidebar, children, drawerOpen, onDrawerClose, lang, labels, testId }) {
193
+ // drawerTop: shown above the navigation in the phone drawer, e.g. the context select (the header hides it
194
+ // below 640px, there is no room next to the header buttons).
195
+ function AppShell({ switcher, header, banner, sidebar, children, drawerOpen, onDrawerClose, drawerTop, lang, labels, testId }) {
194
196
  return h(
195
197
  "div",
196
198
  { className: "scalio-shell", "data-testid": testId || "app-shell" },
@@ -207,7 +209,7 @@ function AppShell({ switcher, header, banner, sidebar, children, drawerOpen, onD
207
209
  ? h(
208
210
  NavDrawer,
209
211
  { open: !!drawerOpen, onClose: onDrawerClose, lang, labels },
210
- React.cloneElement(sidebar, { variant: "drawer", onNavigate: onDrawerClose })
212
+ React.cloneElement(sidebar, drawerTop ? { variant: "drawer", onNavigate: onDrawerClose, top: drawerTop } : { variant: "drawer", onNavigate: onDrawerClose })
211
213
  )
212
214
  : null
213
215
  );