@aiquants/auth-react-router 0.36.0 → 0.37.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
@@ -8,8 +8,9 @@ React Router v7 auth adapter for [`@aiquants/auth-core`](../auth-core/): Google
8
8
  pnpm add @aiquants/auth-core @aiquants/auth-react-router
9
9
  ```
10
10
 
11
- Peers: `react`, `react-router@^7`, `remix-auth@^4`, `remix-auth-oauth2@^3`, `react-icons`, `@aiquants/console-ui@^0.6.0`
12
- (the admin console reads every colour from it, the values of `@aiquants/console-ui/core`, and needs none of its stylesheets).
11
+ The peers and their floors are written once, in `peerDependencies` of `package.json`. The admin console (`./admin`) is
12
+ drawn with `@aiquants/console-ui` parts, so a host that mounts it also loads the console's stylesheet once (see
13
+ "Stylesheet" under "User administration surface").
13
14
 
14
15
  ## User admin shell: the self-permission badge
15
16
 
@@ -29,8 +30,9 @@ createUserAdminApp({
29
30
 
30
31
  - Query **the resource your guards actually check**. Asking about a different key makes the badge disagree with the
31
32
  guard — the user is admitted but told they have no permission.
32
- - If the port is absent, rejects, or returns no entries, the badge renders an explicit "unknown" state
33
- (`data-testid="user-admin-permission-unavailable"`) and the failure is logged. It never renders a permissive value:
33
+ - If the port is absent, rejects, or returns no entries, the badge renders an explicit "unknown" state: one pill holding
34
+ the status word alone (`permissions.unknown`, `data-testid="user-admin-permission-unavailable"`), and the failure is
35
+ logged. A resource whose value is `undefined` gets the same word in its own pill. It never renders a permissive value:
34
36
  a badge that claims "editable" when the answer is unknown is worse than no badge at all.
35
37
 
36
38
  ## Wiring (single composition point — `app/services/auth/config.server.ts`)
@@ -181,6 +183,10 @@ export default () => <AuthUserAdminAppView basePath="/users" />
181
183
  groups tab are built from it. There is no default: the host decides where the console lives, and a built-in default
182
184
  would keep drawing links to that default after the mount moves — the routes still resolve and the build still
183
185
  passes, only the links point at a place that is not served.
186
+ - **Serve the view with `userAdminApp.loader`**: `AuthUserAdminAppView` draws the tab its loader's `segment` names
187
+ (`users`, `groups`, `group_members`, `allowlist` or `directory`; the package's loader reads any other path below the
188
+ base as `users`) and throws `RangeError` for any other value, no loader data included, so a wiring mistake surfaces
189
+ instead of drawing the users tab.
184
190
 
185
191
  - **`guards` is mandatory** — this surface lists every user and mutates group membership, so an unguarded mount is an account-enumeration and privilege-escalation path. Allow by returning, deny by throwing (`Response` / `redirect` / `Error`); the return value is `void` by contract, so a predicate-style guard that returns `false` cannot silently fail open.
186
192
  - **Per-operation authorization**: the guard receives the CRUD verb each intent actually performs (`read` / `create` / `update` / `delete`), so a principal holding only `update` cannot delete. Membership add/remove map to `create`/`delete` because they add and remove rows.
@@ -202,31 +208,44 @@ export default () => <AuthUserAdminAppView basePath="/users" />
202
208
  other guard rejection propagates unchanged.
203
209
  - Neither returns the guard's own message: it carries internal vocabulary (tenant ids, denial reasons).
204
210
  - Labels default to **English** (`defaultUserAdminLabels`); inject `jaUserAdminLabels` or a partial override via `resolveUserAdminLabels`.
205
- - **Every control is a 44 × 44 CSS px target under every pointer** (mouse, pen and touch alike; WCAG 2.2 SC 2.5.5,
206
- AAA): the tabs, the sort buttons, the row actions, the links to a group's members, the search and form fields, the
207
- selects, and every control of the dialogs. Where the control is drawn smaller than its target, the target is the
208
- element around it: the label of the visually hidden "create from" radios and of the "members only" checkbox. The two
209
- upstream-group pickers keep the 44 px targets of `@aiquants/select-box` itself. Rows grow to hold their actions; on
210
- a narrow screen the toolbars and the tabs wrap, the tables scroll sideways, and a dialog taller than the screen
211
- scrolls with its backdrop. The fields of the directory link form shrink to the width of the form's row, so the page
212
- never scrolls sideways, even at 400 % zoom (a viewport 320 to 360 CSS px wide).
213
- - **Text size**: the names of the row actions, of the links to a group's members and of the pressable "create from"
214
- and "members only" labels are set in the `body` step (13 px on a 20 px line), and the permission badge of the header
215
- and its pills, and the lead and lines of the upstream members not in a group, in the `caption` step (11 px on a
216
- 20 px line); no text of the package is smaller than `caption`. A
217
- size is always read together with its line height. A one-line name sits inside its 44 px target without changing
218
- it; a name that wraps takes 20 px per line (the longer "create from" label wraps to two lines, a 54.8 px box). The
219
- sizes are in rem, so they follow the browser's zoom and its root font-size setting. They are read from custom
220
- properties with these defaults, which a host may bind once on `:root` (never declare them on an element inside the
221
- screen: a declaration there wins over the host's binding):
222
-
223
- | Custom property | Default | Read by |
224
- | --- | --- | --- |
225
- | `--aqau-font-size-body` | `0.8125rem` (13 px) | the names of the controls above |
226
- | `--aqau-line-height-body` | `1.25rem` (20 px) | the same controls, together with the size |
227
- | `--aqau-font-size-caption` | `0.6875rem` (11 px) | the permission badge of the header and its pills, the upstream members not in a group |
228
- | `--aqau-line-height-caption` | `1.25rem` (20 px) | the same badge, pills and members, together with the size |
229
-
211
+ - **Stylesheet**: the views are `@aiquants/console-ui` parts inside the console's root (`ConsoleUiRoot`, which the shell
212
+ opens with `labels.locale`, `labels.formatLocale` and `labels.timeZone`), so the host loads
213
+ `@aiquants/console-ui/styles/console-ui.css` once, with the `cui` layer above its reset layer (console-ui's README,
214
+ "Loading the stylesheet"). Without it the parts draw unstyled and the layout below has no lengths to count. A view
215
+ rendered outside the shell (`UsersView` and the others) sits inside a `ConsoleUiRoot` of the host's: the parts throw
216
+ outside a root, and a root inside a root throws too. The shell draws no `<main>`: the host decides the page's
217
+ landmarks and wraps the console in its own.
218
+ - **Layout by formula, down to a 320 px viewport** (WCAG 2.2 SC 1.4.10): no part of the console scrolls sideways.
219
+
220
+ | Formula | What it decides |
221
+ | --- | --- |
222
+ | 1 content width | The page box (`PAGE_STYLE`, `data-testid="user-admin-page"`) pads `clamp(16px, 4vw, 24px)` on each inline side and has no maximum width, so the content is `C(v) = v − 2·clamp(16, 0.04v, 24)` px wide at a viewport `v`: 288 at 320, 358 at 390, 1392 at 1440. Lines of text keep the console's reading measure. |
223
+ | 2 tables | Every table (`DataTable`) is one flexible row-header column plus at most one fixed column sized from its closed vocabulary (`fixedColumnPx`: a status pill, an operation's button), so its frame's minimum fits `C(320)` in both catalogs. |
224
+ | 3 row height | A table whose rows hold a button draws the console's `row-control` rows (52 px); a table of text alone (the members of a group owned upstream) draws `row` rows (44 px). |
225
+ | 4 tabs | The tabs are links (`Tabs`, collapsible): in a content box narrower than 48rem they fold into one button naming the current tab, whose popup lists every tab. The directory tab is listed while the directory is wired, a group is linked, or it is the current tab. |
226
+ | 5 header annotation | Each unit of the annotation the shell hands the header (the permissions lead, each permission pill, the heading badge) fits 180 px on one line in both catalogs; host data (a resource's name) wraps inside its pill. |
227
+ | 6 dialogs | The create and edit dialogs are console-ui's `Dialog`: `calc(40ic + 48px)` wide, never wider than the viewport less 48 px. |
228
+ | 9 group cards | The groups' cards sit in `repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr))` with a 16 px gap (`GROUP_GRID_STYLE`): a grid `W` px wide holds `⌊(W + 16) / 296⌋` columns (1 at 288, 4 at 1392), and a card shrinks to a grid narrower than 280 px. |
229
+ | 10 group members | The group-members tab is a `MasterDetail` with 240 px minimums and a 24 px gap: the group list and the member panel sit side by side from a 504 px content box (a 548 px viewport) and stack, each at the full width, below it. The heading, the action error and the deep-link note sit above it at the full width. |
230
+
231
+ - **Rows and operations**: the row header of the users and directory tables is a button that opens the row's detail,
232
+ where the operations sit (edit, activate or deactivate; synchronize now, pause or resume synchronization, allow sign-in,
233
+ unlink). The allowlist table and the members table of a group managed locally carry one operation column; the members
234
+ table of a group owned upstream has none, since its memberships cannot change here, and the note under each member's
235
+ name says the group is managed upstream (`member-readonly-<id>`). While a submission is in flight, the pressed button
236
+ says it is sending (`common.sending`) and every other operation, the buttons that open the create and edit dialogs
237
+ included, is unavailable, described by `common.submittingNote` (a dialog opened mid-flight would show the in-flight
238
+ answer as its own). Every control is a console-ui part, so its target is 44 × 44 CSS px under every pointer
239
+ (WCAG 2.2 SC 2.5.5, AAA) and its text is set at the console's type steps; the two upstream-group pickers keep the 44 px
240
+ targets of `@aiquants/select-box`.
241
+ - **Names**: every field is named by its visible label, and its examples and what a search matches are its description,
242
+ never a placeholder; the two upstream-group pickers, named by their visible labels too, keep select-box's search
243
+ prompt (`pickUpstreamPlaceholder`, see Localization). The accessible name of a row operation contains its visible
244
+ label by construction (WCAG 2.2 SC 2.5.3): each name template (`usersView.editUserAria` and the 15 other keys ending
245
+ in `Aria`) holds `{action}` exactly once, the view draws the visible label there and the rest of the template as text
246
+ only assistive technology reads, and `resolveUserAdminLabels` refuses a template that holds `{action}` other than once.
247
+ The spaces between the visible label and the hidden text are drawn outside the hidden text, so the space between the
248
+ words never depends on how an implementation treats the edges of hidden text (jsdom's name computation drops them).
230
249
  - **Upstream members not in a group are listed by reason**, never as one count under one label: someone who matches
231
250
  more than one user, someone whose address belongs to a user linked to another upstream account, someone the next
232
251
  synchronization adds, someone deactivated and someone not registered yet are different facts, cleared in different
@@ -236,25 +255,20 @@ export default () => <AuthUserAdminAppView basePath="/users" />
236
255
  synchronization's own resolver). The block sits on the group's card in the groups tab and in the group's cell of the
237
256
  directory tab — not beside the last sync time, since who is missing is a fact of the group, not of the run:
238
257
 
239
- | Reason | Label (`directoryView.*`) | Colour | What the operator does |
258
+ | Reason | Label (`directoryView.*`) | Text role | What the operator does |
240
259
  | --- | --- | --- | --- |
241
- | `ambiguous` | `unresolvedAmbiguousTemplate` | amber | Tidy the users (check) |
242
- | `claimedByAnother` | `unresolvedClaimedByAnotherTemplate` | amber | Confirm who the person is (check) |
243
- | `pendingSync` | `unresolvedPendingSyncTemplate` | sky | Wait for the next synchronization |
244
- | `deactivated` | `unresolvedDeactivatedTemplate` | neutral (muted text) | Nothing, when the deactivation is deliberate |
245
- | `unregistered` | `unresolvedUnregisteredTemplate` | neutral (muted text) | Nothing: the person joins at their first sign-in |
260
+ | `ambiguous` | `unresolvedAmbiguousTemplate` | `warning-fg` | Tidy the users (check) |
261
+ | `claimedByAnother` | `unresolvedClaimedByAnotherTemplate` | `warning-fg` | Confirm who the person is (check) |
262
+ | `pendingSync` | `unresolvedPendingSyncTemplate` | `info-fg` | Wait for the next synchronization |
263
+ | `deactivated` | `unresolvedDeactivatedTemplate` | `fg-muted` | Nothing, when the deactivation is deliberate |
264
+ | `unregistered` | `unresolvedUnregisteredTemplate` | `fg-muted` | Nothing: the person joins at their first sign-in |
246
265
 
247
266
  One line per reason that has anyone, in the order of `AUTH_DIRECTORY_UNRESOLVED_REASONS` (the reasons to check
248
267
  first); a count that is zero, negative or not a number draws no line, and a group with no line draws no block. The
249
- lead `directoryView.unresolvedLead` names the list (`<ul role="list" aria-labelledby>`; the role is explicit
250
- because WebKit drops it from a list drawn without markers). The colour only repeats the text: each reason is a
251
- sentence of its own, and the ones to check say so. Test hooks: the block is `group-unresolved-<id>` /
252
- `directory-unresolved-<id>`, each line `<block>-<reason>` with `data-reason="<reason>"`.
253
- - **The group-members tab reflows without a media query** (WCAG 2.2 SC 1.4.10): the group list keeps a 240 px basis
254
- and the member panel never takes less than half the row, so the two sit side by side from about 518 px
255
- (`2 × (240 px + 1.2rem)`) and stack, each at the full width, below it. The heading, the action error and the
256
- deep-link note are rows of the vertical stack outside the wrapping row, so they span the whole width in both
257
- arrangements. Long addresses wrap inside a member row.
268
+ lead `directoryView.unresolvedLead` names the list (console-ui's `List`, drawn without markers, keeps its list role
269
+ in WebKit). The colour only repeats the text: each reason is a sentence of its own, and the ones to check say so.
270
+ Test hooks: the block is `group-unresolved-<id>` / `directory-unresolved-<id>`, each line `<block>-<reason>` with
271
+ `data-reason="<reason>"`.
258
272
 
259
273
  ### Field limits and duplicate group keys: checked before the store
260
274
 
@@ -290,7 +304,7 @@ field, the length, or the group in the way. The action therefore checks both bef
290
304
  - **Group keys are compared with `normalizeGroupKey`** (trimmed, NFKC, lower case), the same rule on the server and in
291
305
  the dialog, because a typical unique index compares case- and width-insensitively (SQL Server's `_CI_` collations).
292
306
  `createGroup` and `createLinkedGroup` name the group holding the key (`errors.groupKeyTaken`); the dialog checks on
293
- every keystroke and pick and keeps "Create" disabled while a field has a problem.
307
+ every keystroke and pick and keeps "Create" unavailable, naming the problem, while a field has one.
294
308
  - **Creating from an upstream group whose key an unlinked local group holds** offers to link that local group itself
295
309
  (`data-testid="link-existing-group"`), with the same confirmation as the directory tab — usually what the operator
296
310
  wants, instead of a second group for the same department under another key.
@@ -301,53 +315,42 @@ field, the length, or the group in the way. The action therefore checks both bef
301
315
 
302
316
  ### Colour scheme
303
317
 
304
- Every colour the console draws is a pair of a light value and a dark value written as CSS `light-dark()`, so it follows
305
- the `color-scheme` the host sets on an ancestor: `color-scheme: dark` (on `html.dark`, for example) shows the dark
306
- values, and a page that sets none keeps the light ones. The package reads neither a `.dark` class nor
307
- `prefers-color-scheme`, and it declares no colour property for a host to bind. The values are `@aiquants/console-ui`'s
308
- tokens and tone table, so the console and a console built on console-ui draw the same colours.
309
-
310
- The shell (`AuthUserAdminAppView`, or `UserAdminShell` around your own views) is the console's colour root: it paints
311
- the console's surface and text, every button, field and select carries its own palette text and surface, and every link
312
- its own palette text, so none falls back to the browser's control colours, which follow the page rather than the
313
- console's surfaces. No inline style reaches a placeholder, so the shell carries `data-aqar-user-admin` on its root and
314
- renders one `<style>` element whose rule draws every placeholder under that root in the muted text colour, opaque; the
315
- rule reaches no field of the host. The colour contract holds under the shell only: a view rendered without it draws on
316
- whatever the host paints. A header rendered through `renderHeader` sits on the shell's surface and keeps the host's own
317
- colours; the annotation the shell hands it carries the palette's.
318
+ The console's colours are `@aiquants/console-ui`'s roles: the shell's `ConsoleUiRoot` paints the console's surface and
319
+ text, and every part (button, field, select, table, card, pill, notice, alert) carries its own roles, written as CSS
320
+ `light-dark()` pairs that follow the `color-scheme` the host sets on an ancestor. console-ui's README holds the colour
321
+ contract (every text role reaches 7:1 and every non-text mark 3:1 against the surfaces it is drawn on, in both schemes;
322
+ WCAG 2.2 AAA, SC 1.4.6 and 1.4.11). The package writes no colour of its own, with one exception: the option rows of the
323
+ two upstream-group pickers are drawn by `@aiquants/select-box` inside its own popup, outside the console's parts, so they
324
+ paint their match highlight from the console's tone table (`lightDark(TONES.<hue>.<role>)` of `@aiquants/console-ui/core`:
325
+ emerald for an exact match, amber for a fuzzy one) and set their note at the console's `caption` step. A header rendered
326
+ through `renderHeader` keeps the host's colours; the annotation the shell hands it carries the console's roles.
318
327
 
319
328
  | Tone | Used for |
320
329
  | --- | --- |
321
- | emerald | an active user and the activate button, an enabled sync, a member's row, an exact match, an editable permission |
322
- | amber | warnings and notes (the directory sync banner, a queued sync request, an unset provider, a stale or unavailable catalog, the upstream members not in a group whom someone has to check), a fuzzy match, a domain entry, an unknown permission |
323
- | blue | the active tab, the links to a group's members, a read-only permission |
324
- | red | errors, the deactivate and remove buttons, an inactive user, a paused sync, a delete-only permission |
325
- | indigo | the group key, the chosen "create from" mode, the selected group of the members tab |
326
- | violet | a group owned upstream (its badge, marker and notes), a group entry |
327
- | sky | an e-mail entry, the header annotation, the upstream members the next synchronization adds to a group |
328
- | neutral | text, surfaces, lines, a control's outline, the primary button, no permission, the upstream members not in a group with nothing to do (deactivated, not registered yet) |
329
-
330
- Each text colour reaches 7:1 and each non-text mark (a control's outline, a tone's accent) 3:1 against every surface
331
- the console draws (the neutral surfaces and every tone's tint), in both schemes (WCAG 2.2 AAA, SC 1.4.6 and 1.4.11);
332
- the package's tests check every pair. The console draws nothing translucent (no `opacity` below 1, no SVG
333
- `*-opacity`), so the colours on screen are those pairs themselves rather than mixes with whatever lies behind; a test
334
- scans every admin source for it, and another renders the five tabs and the dialogs and checks that every button, field
335
- and link carries palette colours of its own and every text inherits one. The pickers of `@aiquants/select-box` colour
336
- themselves, their placeholder included.
330
+ | `success` | an active user, an enabled synchronization, a member's badge, an editable permission |
331
+ | `danger` | an inactive user, a paused synchronization, a delete-only permission, the deactivate and remove buttons |
332
+ | `warning` | the directory sync notice, a sync request that was not queued, an unset provider, an unavailable catalog, a missed deep link, an unknown permission, the upstream members someone has to check |
333
+ | `info` | notices that only inform (an empty catalog, an unwired directory), the header's heading badge, a group owned upstream, a read-only permission, the upstream members the next synchronization adds |
334
+ | `neutral` | no permission, the upstream members with nothing to do (deactivated, not registered yet) |
335
+
336
+ Colour only repeats the text: every state is also a word (a pill's label, a notice's sentence). The package's role scan
337
+ renders the five tabs and the dialogs and checks, with console-ui's `scanColourRoles`, that every text, list marker and
338
+ shape sits on a console role.
337
339
 
338
340
  **Browser support**: `light-dark()` needs Chrome / Edge 123, Firefox 120 or Safari 17.5. An older browser drops every
339
- colour declaration of the package and draws its own defaults.
341
+ colour declaration of the console and draws its own defaults.
340
342
 
341
- ### Localization (`labels.locale` vs `labels.formatLocale`)
343
+ ### Localization (`labels.locale`, `labels.formatLocale` and `labels.timeZone`)
342
344
 
343
345
  Every string this package draws lives in `UserAdminLabels`, and a host picks the language by injecting a whole catalog
344
- (`defaultUserAdminLabels` for English, the package default, or `jaUserAdminLabels`) or a partial override. Two keys
345
- carry language, and they are **different axes**:
346
+ (`defaultUserAdminLabels` for English, the package default, or `jaUserAdminLabels`) or a partial override. Three keys
347
+ carry language and time, and they are **different axes**:
346
348
 
347
349
  | Key | Type | `defaultUserAdminLabels` | `jaUserAdminLabels` | Drives |
348
350
  | --- | --- | --- | --- | --- |
349
- | `locale` | `UserAdminLocale` (`"en"` \| `"ja"`) | `"en"` | `"ja"` | UI chrome language of both upstream-group pickers (`SelectBox` `locale`) |
350
- | `formatLocale` | BCP 47 `string` | `"en-US"` | `"ja-JP"` | `Intl.DateTimeFormat` (with `timeZone`) and the user-list `Intl.Collator` |
351
+ | `locale` | `UserAdminLocale` (`"en"` \| `"ja"`) | `"en"` | `"ja"` | UI chrome language of both upstream-group pickers (`SelectBox` `locale`) and of the console's parts (`ConsoleUiRoot` `locale`) |
352
+ | `formatLocale` | BCP 47 `string` | `"en-US"` | `"ja-JP"` | `Intl.DateTimeFormat` (with `timeZone`), the user-list `Intl.Collator`, and the console's root (`ConsoleUiRoot` `formatLocale`) |
353
+ | `timeZone` | IANA `string` | `"UTC"` | `"Asia/Tokyo"` | `Intl.DateTimeFormat`, and the console's root (`ConsoleUiRoot` `timeZone`) |
351
354
 
352
355
  - **`locale`** is forwarded to both `@aiquants/select-box` pickers (the create-group dialog and the directory link
353
356
  form). The picker strings this package owns (`directoryView.pickerNoOptions` / `pickerClear` / `pickerToggle` /
@@ -385,32 +388,18 @@ carry language, and they are **different axes**:
385
388
  for a typed one ("3 options, 2 available matches" / 「候補 3 件・選べる一致 2 件」). The examples in the table are
386
389
  the blank-query phrases.
387
390
 
388
- - `resolveUserAdminLabels` (run once when `createUserAdminApp` is built) **validates `locale`**: an omitted value keeps
389
- the English default `"en"`; `"en"` / `"ja"` pass; anything else (`"ja-JP"`, `"EN"`, `""`, `null`, ...) throws
390
- `RangeError` naming `labels.formatLocale`, so a mistake stops the app at startup instead of crashing the picker on
391
- first render. There is no language negotiation — map `navigator.language` or a user setting to `"en"` / `"ja"`
392
- yourself.
393
- - **`formatLocale` is not validated**: an unreadable tag degrades (dates fall back to the raw ISO string, sorting to the
394
- runtime collator) instead of throwing, because formatting must never take the screen down.
395
-
396
- #### Migrating from 0.15.x (breaking changes in 0.16.0)
397
-
398
- 1. **`basePath` is now required** on `AuthUserAdminAppView` / `UserAdminShell` (see above). Pass the absolute mount
399
- path, without a trailing slash: `<AuthUserAdminAppView basePath="/users" />`. Omitting it fails type-checking
400
- (TS2741); an untyped caller would draw links such as `undefined/groups`.
401
- 2. **`labels.locale` changed meaning**: the old `labels.locale` (a BCP 47 tag for dates and sorting) is now
402
- `labels.formatLocale` — no alias. The new `labels.locale` (type `UserAdminLocale` = `"en"` | `"ja"`) is the UI
403
- language of the pickers, validated at startup.
404
- - Hosts that inject `jaUserAdminLabels` whole, or spread it (`{ ...jaUserAdminLabels, heading: "" }`), need no
405
- change: it carries `locale: "ja"` and `formatLocale: "ja-JP"`.
406
- - A host that overrode `locale: "ja-JP"` must write `formatLocale: "ja-JP"`, and add `locale: "ja"` if it relies
407
- on Japanese picker chrome (without it the pickers' catalog-sourced strings, such as the scroll-arrow names, are
408
- English).
409
- - A host that builds a full `UserAdminLabels` literal must add both keys.
410
- 3. **`@aiquants/select-box` `texts` is gone**: the pickers take select-box 0.10.0 `locale` / `labels`
411
- (`SelectBoxLabelOverrides`) instead of `texts` / `SelectBoxTexts`. This is internal to the views — hosts that only
412
- render `AuthUserAdminAppView` do nothing — but a host must install `@aiquants/select-box` >= 0.10.0 and
413
- `@aiquants/virtualscroll` >= 3.7.0 (the new peer floors).
391
+ - `resolveUserAdminLabels` (run once when `createUserAdminApp` is built) **validates the three axes**, in this order,
392
+ so a mistake stops the app at startup instead of the console's root refusing it on every page:
393
+ - `locale`: an omitted value keeps the English default `"en"`; a language both `@aiquants/virtualscroll` and
394
+ `@aiquants/console-ui` speak (`"en"` / `"ja"`) passes; anything else (`"ja-JP"`, `"EN"`, `""`, `null`, ...) throws
395
+ `RangeError` naming `labels.formatLocale`, with the refusing part's error as its `cause`. There is no language
396
+ negotiation — map `navigator.language` or a user setting to `"en"` / `"ja"` yourself.
397
+ - `formatLocale` with `timeZone`: the pair formats the console's sample instant (`instantSampleText` of
398
+ `@aiquants/console-ui/core`), so `Intl` decides both exactly as the console's root reads them; a pair `Intl` refuses
399
+ (`""`, `"ja_JP"`, `"Mars/Base"`, ...) throws `RangeError` naming both values, with the engine's error as its `cause`.
400
+ - the row operations' name templates (see "Names" above).
401
+ - A timestamp the views cannot read (from the store or the upstream) is shown as it came instead of taking the screen
402
+ down. The locale and the zone are settings, checked at startup, so the views never work around them.
414
403
 
415
404
  ### Upstream group catalog (optional port)
416
405
 
package/dist/admin.d.mts CHANGED
@@ -1,8 +1,10 @@
1
+ import { ConsoleUiLocale } from "@aiquants/console-ui/core";
1
2
  import { VirtualScrollLocale } from "@aiquants/virtualscroll";
2
3
  import * as react_router from "react-router";
3
4
  import { AuthUser, AuthGroup, AuthGroupMember, AuthAllowlistEntry, AuthDirectoryMembershipMode, AuthDirectoryStatus, AuthDirectoryCatalogSnapshot, AuthDirectoryCatalogGroup } from "@aiquants/auth-core";
4
- import React__default from "react";
5
- type UserAdminLocale = VirtualScrollLocale;
5
+ import * as react from "react";
6
+ import { ReactNode } from "react";
7
+ type UserAdminLocale = VirtualScrollLocale & ConsoleUiLocale;
6
8
  type UserAdminLabels = {
7
9
  title: string;
8
10
  locale: UserAdminLocale;
@@ -21,6 +23,8 @@ type UserAdminLabels = {
21
23
  managedUpstream: string;
22
24
  idTemplate: string;
23
25
  none: string;
26
+ sending: string;
27
+ submittingNote: string;
24
28
  };
25
29
  errors: {
26
30
  unknownUpstream: string;
@@ -45,8 +49,10 @@ type UserAdminLabels = {
45
49
  canDelete: string;
46
50
  none: string;
47
51
  unknown: string;
52
+ pillTemplate: string;
48
53
  };
49
54
  tabs: {
55
+ label: string;
50
56
  users: string;
51
57
  groups: string;
52
58
  groupMembers: string;
@@ -55,9 +61,12 @@ type UserAdminLabels = {
55
61
  };
56
62
  usersView: {
57
63
  title: string;
58
- sortBy: string;
59
- searchPlaceholder: string;
60
64
  searchLabel: string;
65
+ searchDescription: string;
66
+ sortLabel: string;
67
+ sortAscending: string;
68
+ sortDescending: string;
69
+ sortOptionTemplate: string;
61
70
  addUser: string;
62
71
  editUser: string;
63
72
  displayName: string;
@@ -71,8 +80,6 @@ type UserAdminLabels = {
71
80
  deactivateAria: string;
72
81
  emptyFiltered: string;
73
82
  listSummary: string;
74
- sortedAscending: string;
75
- sortedDescending: string;
76
83
  confirmDeactivate: string;
77
84
  empty: string;
78
85
  };
@@ -106,11 +113,10 @@ type UserAdminLabels = {
106
113
  keyTakenByLocal: string;
107
114
  linkExistingGroup: string;
108
115
  resolveFieldProblems: string;
109
- openMembers: string;
110
116
  openMembersAria: string;
111
117
  title: string;
112
- searchPlaceholder: string;
113
118
  searchLabel: string;
119
+ searchDescription: string;
114
120
  addGroup: string;
115
121
  editGroup: string;
116
122
  groupKey: string;
@@ -122,14 +128,14 @@ type UserAdminLabels = {
122
128
  editGroupAria: string;
123
129
  deleteGroupAria: string;
124
130
  noDescription: string;
125
- groupKeyPlaceholder: string;
126
- namePlaceholder: string;
131
+ groupKeyDescription: string;
132
+ nameDescription: string;
127
133
  empty: string;
128
134
  };
129
135
  groupMembersView: {
130
136
  title: string;
131
137
  searchLabel: string;
132
- searchPlaceholder: string;
138
+ searchDescription: string;
133
139
  onlyMembers: string;
134
140
  emptyFiltered: string;
135
141
  summary: string;
@@ -141,6 +147,7 @@ type UserAdminLabels = {
141
147
  deepLinkMissed: string;
142
148
  actionAdd: string;
143
149
  actionRemove: string;
150
+ memberBadge: string;
144
151
  actionAddAria: string;
145
152
  actionRemoveAria: string;
146
153
  upstreamNotice: string;
@@ -212,7 +219,9 @@ type UserAdminLabels = {
212
219
  pickerClear: string;
213
220
  pickerToggle: string;
214
221
  pickerSelected: string;
215
- externalKeyPlaceholder: string;
222
+ externalKeyDescription: string;
223
+ linkNeedsFields: string;
224
+ syncFailure: string;
216
225
  confirmLink: string;
217
226
  confirmUnlink: string;
218
227
  pause: string;
@@ -418,15 +427,15 @@ type PendingSyncPolling = {
418
427
  };
419
428
  declare const DEFAULT_PENDING_SYNC_POLLING: PendingSyncPolling;
420
429
  type UserAdminShellProps = {
421
- children?: React__default.ReactNode;
430
+ children?: ReactNode;
422
431
  renderHeader?: (props: {
423
432
  title: string;
424
- annotation: React__default.ReactNode;
425
- }) => React__default.ReactNode;
433
+ annotation: ReactNode;
434
+ }) => ReactNode;
426
435
  basePath: string;
427
436
  pendingSyncPolling?: PendingSyncPolling;
428
437
  };
429
- declare function UserAdminShell({ children, renderHeader, pendingSyncPolling, basePath }: UserAdminShellProps): React__default.JSX.Element;
438
+ declare function UserAdminShell({ children, renderHeader, pendingSyncPolling, basePath }: UserAdminShellProps): react.JSX.Element;
430
439
  type UserAdminLoaderData = {
431
440
  segment: string;
432
441
  users: AuthUser[];
@@ -438,11 +447,11 @@ type UserAdminLoaderData = {
438
447
  fieldLimits: UserAdminFieldLimits;
439
448
  labels?: UserAdminLabels;
440
449
  };
441
- declare function UsersView(): React__default.JSX.Element;
442
- declare function GroupsView(): React__default.JSX.Element;
443
- declare function GroupMembersView(): React__default.JSX.Element;
444
- declare function AllowlistView(): React__default.JSX.Element;
445
- declare function DirectoryView(): React__default.JSX.Element;
450
+ declare function UsersView(): react.JSX.Element;
451
+ declare function GroupsView(): react.JSX.Element;
452
+ declare function GroupMembersView(): react.JSX.Element;
453
+ declare function AllowlistView(): react.JSX.Element;
454
+ declare function DirectoryView(): react.JSX.Element;
446
455
  type AuthUserAdminAppViewProps = UserAdminShellProps;
447
- declare function AuthUserAdminAppView({ renderHeader, pendingSyncPolling, basePath }: AuthUserAdminAppViewProps): React__default.JSX.Element;
456
+ declare function AuthUserAdminAppView({ renderHeader, pendingSyncPolling, basePath }: AuthUserAdminAppViewProps): react.JSX.Element;
448
457
  export { AllowlistView, AuthUserAdminAppView, type AuthUserAdminAppViewProps, DEFAULT_PENDING_SYNC_POLLING, DirectoryView, GroupMembersView, GroupsView, type PartialUserAdminLabels, type PendingSyncPolling, type UserAdminAccess, type UserAdminAppConfig, type UserAdminCatalog, type UserAdminCatalogFailure, type UserAdminCatalogGroup, type UserAdminCatalogSnapshot, type UserAdminFieldLimits, type UserAdminGuards, UserAdminInputError, type UserAdminLabels, type UserAdminLinkSyncOutcome, type UserAdminLoaderData, type UserAdminLocale, UserAdminOperatorError, type UserAdminPermission, UserAdminShell, type UserAdminShellProps, type UserAdminStore, type UserAdminSyncRequestOutcome, UsersView, createInMemoryUserAdminStore, createUserAdminApp, defaultUserAdminLabels, jaUserAdminLabels, normalizeGroupKey, normalizeUpstreamKey, resolveUserAdminLabels, userAdminAccessFor, userAdminIntents };
package/dist/admin.d.ts CHANGED
@@ -1,8 +1,10 @@
1
+ import { ConsoleUiLocale } from "@aiquants/console-ui/core";
1
2
  import { VirtualScrollLocale } from "@aiquants/virtualscroll";
2
3
  import * as react_router from "react-router";
3
4
  import { AuthUser, AuthGroup, AuthGroupMember, AuthAllowlistEntry, AuthDirectoryMembershipMode, AuthDirectoryStatus, AuthDirectoryCatalogSnapshot, AuthDirectoryCatalogGroup } from "@aiquants/auth-core";
4
- import React__default from "react";
5
- type UserAdminLocale = VirtualScrollLocale;
5
+ import * as react from "react";
6
+ import { ReactNode } from "react";
7
+ type UserAdminLocale = VirtualScrollLocale & ConsoleUiLocale;
6
8
  type UserAdminLabels = {
7
9
  title: string;
8
10
  locale: UserAdminLocale;
@@ -21,6 +23,8 @@ type UserAdminLabels = {
21
23
  managedUpstream: string;
22
24
  idTemplate: string;
23
25
  none: string;
26
+ sending: string;
27
+ submittingNote: string;
24
28
  };
25
29
  errors: {
26
30
  unknownUpstream: string;
@@ -45,8 +49,10 @@ type UserAdminLabels = {
45
49
  canDelete: string;
46
50
  none: string;
47
51
  unknown: string;
52
+ pillTemplate: string;
48
53
  };
49
54
  tabs: {
55
+ label: string;
50
56
  users: string;
51
57
  groups: string;
52
58
  groupMembers: string;
@@ -55,9 +61,12 @@ type UserAdminLabels = {
55
61
  };
56
62
  usersView: {
57
63
  title: string;
58
- sortBy: string;
59
- searchPlaceholder: string;
60
64
  searchLabel: string;
65
+ searchDescription: string;
66
+ sortLabel: string;
67
+ sortAscending: string;
68
+ sortDescending: string;
69
+ sortOptionTemplate: string;
61
70
  addUser: string;
62
71
  editUser: string;
63
72
  displayName: string;
@@ -71,8 +80,6 @@ type UserAdminLabels = {
71
80
  deactivateAria: string;
72
81
  emptyFiltered: string;
73
82
  listSummary: string;
74
- sortedAscending: string;
75
- sortedDescending: string;
76
83
  confirmDeactivate: string;
77
84
  empty: string;
78
85
  };
@@ -106,11 +113,10 @@ type UserAdminLabels = {
106
113
  keyTakenByLocal: string;
107
114
  linkExistingGroup: string;
108
115
  resolveFieldProblems: string;
109
- openMembers: string;
110
116
  openMembersAria: string;
111
117
  title: string;
112
- searchPlaceholder: string;
113
118
  searchLabel: string;
119
+ searchDescription: string;
114
120
  addGroup: string;
115
121
  editGroup: string;
116
122
  groupKey: string;
@@ -122,14 +128,14 @@ type UserAdminLabels = {
122
128
  editGroupAria: string;
123
129
  deleteGroupAria: string;
124
130
  noDescription: string;
125
- groupKeyPlaceholder: string;
126
- namePlaceholder: string;
131
+ groupKeyDescription: string;
132
+ nameDescription: string;
127
133
  empty: string;
128
134
  };
129
135
  groupMembersView: {
130
136
  title: string;
131
137
  searchLabel: string;
132
- searchPlaceholder: string;
138
+ searchDescription: string;
133
139
  onlyMembers: string;
134
140
  emptyFiltered: string;
135
141
  summary: string;
@@ -141,6 +147,7 @@ type UserAdminLabels = {
141
147
  deepLinkMissed: string;
142
148
  actionAdd: string;
143
149
  actionRemove: string;
150
+ memberBadge: string;
144
151
  actionAddAria: string;
145
152
  actionRemoveAria: string;
146
153
  upstreamNotice: string;
@@ -212,7 +219,9 @@ type UserAdminLabels = {
212
219
  pickerClear: string;
213
220
  pickerToggle: string;
214
221
  pickerSelected: string;
215
- externalKeyPlaceholder: string;
222
+ externalKeyDescription: string;
223
+ linkNeedsFields: string;
224
+ syncFailure: string;
216
225
  confirmLink: string;
217
226
  confirmUnlink: string;
218
227
  pause: string;
@@ -418,15 +427,15 @@ type PendingSyncPolling = {
418
427
  };
419
428
  declare const DEFAULT_PENDING_SYNC_POLLING: PendingSyncPolling;
420
429
  type UserAdminShellProps = {
421
- children?: React__default.ReactNode;
430
+ children?: ReactNode;
422
431
  renderHeader?: (props: {
423
432
  title: string;
424
- annotation: React__default.ReactNode;
425
- }) => React__default.ReactNode;
433
+ annotation: ReactNode;
434
+ }) => ReactNode;
426
435
  basePath: string;
427
436
  pendingSyncPolling?: PendingSyncPolling;
428
437
  };
429
- declare function UserAdminShell({ children, renderHeader, pendingSyncPolling, basePath }: UserAdminShellProps): React__default.JSX.Element;
438
+ declare function UserAdminShell({ children, renderHeader, pendingSyncPolling, basePath }: UserAdminShellProps): react.JSX.Element;
430
439
  type UserAdminLoaderData = {
431
440
  segment: string;
432
441
  users: AuthUser[];
@@ -438,11 +447,11 @@ type UserAdminLoaderData = {
438
447
  fieldLimits: UserAdminFieldLimits;
439
448
  labels?: UserAdminLabels;
440
449
  };
441
- declare function UsersView(): React__default.JSX.Element;
442
- declare function GroupsView(): React__default.JSX.Element;
443
- declare function GroupMembersView(): React__default.JSX.Element;
444
- declare function AllowlistView(): React__default.JSX.Element;
445
- declare function DirectoryView(): React__default.JSX.Element;
450
+ declare function UsersView(): react.JSX.Element;
451
+ declare function GroupsView(): react.JSX.Element;
452
+ declare function GroupMembersView(): react.JSX.Element;
453
+ declare function AllowlistView(): react.JSX.Element;
454
+ declare function DirectoryView(): react.JSX.Element;
446
455
  type AuthUserAdminAppViewProps = UserAdminShellProps;
447
- declare function AuthUserAdminAppView({ renderHeader, pendingSyncPolling, basePath }: AuthUserAdminAppViewProps): React__default.JSX.Element;
456
+ declare function AuthUserAdminAppView({ renderHeader, pendingSyncPolling, basePath }: AuthUserAdminAppViewProps): react.JSX.Element;
448
457
  export { AllowlistView, AuthUserAdminAppView, type AuthUserAdminAppViewProps, DEFAULT_PENDING_SYNC_POLLING, DirectoryView, GroupMembersView, GroupsView, type PartialUserAdminLabels, type PendingSyncPolling, type UserAdminAccess, type UserAdminAppConfig, type UserAdminCatalog, type UserAdminCatalogFailure, type UserAdminCatalogGroup, type UserAdminCatalogSnapshot, type UserAdminFieldLimits, type UserAdminGuards, UserAdminInputError, type UserAdminLabels, type UserAdminLinkSyncOutcome, type UserAdminLoaderData, type UserAdminLocale, UserAdminOperatorError, type UserAdminPermission, UserAdminShell, type UserAdminShellProps, type UserAdminStore, type UserAdminSyncRequestOutcome, UsersView, createInMemoryUserAdminStore, createUserAdminApp, defaultUserAdminLabels, jaUserAdminLabels, normalizeGroupKey, normalizeUpstreamKey, resolveUserAdminLabels, userAdminAccessFor, userAdminIntents };