@scalio-cloud/ui 0.50.0 → 0.50.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/nav.css CHANGED
@@ -837,6 +837,8 @@ ul.scalio-notice { flex-direction: column; gap: 0.25rem; padding-left: 2rem; lis
837
837
 
838
838
  /* Dialogs instead of browser popups (ADR 0096): askConfirm, askText, showMessage, UpdateProgress. */
839
839
  .scalio-dialog-root { z-index: 70; }
840
+ /* A confirmation always lies above the dialog it was opened from (e.g. delete in «Benutzer bearbeiten»). */
841
+ [data-scalio-dialog-host] .scalio-dialog-root { z-index: 80; }
840
842
  .scalio-dialog {
841
843
  display: flex; flex-direction: column; gap: 0.75rem; width: calc(100vw - 2rem); max-width: 28rem; max-height: 90vh; overflow-y: auto;
842
844
  padding: 1.5rem; border: 1px solid hsl(var(--border)); border-radius: 2px; background: hsl(var(--background)); color: hsl(var(--foreground));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalio-cloud/ui",
3
- "version": "0.50.0",
3
+ "version": "0.50.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/users.js CHANGED
@@ -135,16 +135,20 @@ function Dialog({ title, onClose, children, testId }) {
135
135
  // Props:
136
136
  // client (usersApi), me (id of the signed-in person), lang, labels, notify(message, tone), confirm({title, text, action, danger}),
137
137
  // formatError(err), roles [{value, label}], defaultRole, adminRole ("admin"; emergency only for it),
138
- // signInModes (subset of ["microsoft", "password", "invite"], first is the default), microsoftEnabled,
138
+ // signInModes (subset of ["microsoft", "password", "invite"], first is the default; always shown in that order), microsoftEnabled,
139
139
  // canLock (accounts can be locked), accessColumn {label, render(user)}, accessField(value, onChange, role, user) -> element
140
140
  // (create, edit and approve; value is passed as `access` in the body), onChange() after every change, testId.
141
+ const MODE_ORDER = ["microsoft", "password", "invite"];
141
142
  function UserAdmin(props) {
142
143
  const { client, me, lang, notify, confirm } = props;
143
144
  const L = labelsFor(lang, props.labels).users;
144
145
  const fmtErr = props.formatError || errorText;
145
146
  const roles = props.roles || [];
146
147
  const roleLabel = (r) => (roles.find((x) => x.value === r) || { label: r }).label;
147
- const modes = (props.signInModes || ["microsoft", "password"]).filter((m) => m !== "microsoft" || props.microsoftEnabled !== false);
148
+ // Same order in every app (Microsoft, password, invitation last); the app's first mode stays the default.
149
+ const given = (props.signInModes || ["microsoft", "password"]).filter((m) => m !== "microsoft" || props.microsoftEnabled !== false);
150
+ const modes = MODE_ORDER.filter((m) => given.includes(m)).concat(given.filter((m) => !MODE_ORDER.includes(m)));
151
+ const defaultMode = given[0];
148
152
  const adminRole = props.adminRole || "admin";
149
153
  const [rows, setRows] = React.useState(null);
150
154
  const [dialog, setDialog] = React.useState(null); // {mode: create|edit|merge|secret, user, ...}
@@ -182,7 +186,7 @@ function UserAdmin(props) {
182
186
 
183
187
  const openCreate = () => {
184
188
  setError("");
185
- setForm({ name: "", email: "", role: props.defaultRole || (roles[0] && roles[0].value) || "", signIn: modes[0], access: null });
189
+ setForm({ name: "", email: "", role: props.defaultRole || (roles[0] && roles[0].value) || "", signIn: defaultMode, access: null });
186
190
  setDialog({ mode: "create" });
187
191
  };
188
192
  const openEdit = (u) => {
@@ -11,7 +11,7 @@ const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => /*
11
11
  AlertDialogPrimitive.Overlay,
12
12
  {
13
13
  className: cn(
14
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
14
+ "fixed inset-0 z-[80] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
15
15
  className
16
16
  ),
17
17
  ...props,
@@ -24,7 +24,7 @@ const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => /*
24
24
  {
25
25
  ref,
26
26
  className: cn(
27
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
27
+ "fixed left-[50%] top-[50%] z-[80] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
28
28
  className
29
29
  ),
30
30
  ...props