@gravitee/graphene-core 3.51.0 → 3.52.0-feat-app-context-switcher.ca73800

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.
Files changed (59) hide show
  1. package/USAGE_GUIDE.md +71 -3
  2. package/dist/__stories__/fixtures/index.d.ts +1 -0
  3. package/dist/__stories__/fixtures/index.d.ts.map +1 -1
  4. package/dist/__stories__/fixtures/shell/app-context-switcher.fixture.d.ts +20 -0
  5. package/dist/__stories__/fixtures/shell/app-context-switcher.fixture.d.ts.map +1 -0
  6. package/dist/base/Command/Command.d.ts +3 -2
  7. package/dist/base/Command/Command.d.ts.map +1 -1
  8. package/dist/composed/AppContextSwitcher/AppColumn.d.ts +21 -0
  9. package/dist/composed/AppContextSwitcher/AppColumn.d.ts.map +1 -0
  10. package/dist/composed/AppContextSwitcher/AppContextSwitcher.d.ts +18 -0
  11. package/dist/composed/AppContextSwitcher/AppContextSwitcher.d.ts.map +1 -0
  12. package/dist/composed/AppContextSwitcher/AppContextSwitcherTrigger.d.ts +15 -0
  13. package/dist/composed/AppContextSwitcher/AppContextSwitcherTrigger.d.ts.map +1 -0
  14. package/dist/composed/AppContextSwitcher/AppRow.d.ts +14 -0
  15. package/dist/composed/AppContextSwitcher/AppRow.d.ts.map +1 -0
  16. package/dist/composed/AppContextSwitcher/EntranceRow.d.ts +17 -0
  17. package/dist/composed/AppContextSwitcher/EntranceRow.d.ts.map +1 -0
  18. package/dist/composed/AppContextSwitcher/EnvironmentColumn.d.ts +12 -0
  19. package/dist/composed/AppContextSwitcher/EnvironmentColumn.d.ts.map +1 -0
  20. package/dist/composed/AppContextSwitcher/EnvironmentRow.d.ts +16 -0
  21. package/dist/composed/AppContextSwitcher/EnvironmentRow.d.ts.map +1 -0
  22. package/dist/composed/AppContextSwitcher/appContextSwitcher.types.d.ts +59 -0
  23. package/dist/composed/AppContextSwitcher/appContextSwitcher.types.d.ts.map +1 -0
  24. package/dist/composed/AppContextSwitcher/environmentList.d.ts +8 -0
  25. package/dist/composed/AppContextSwitcher/environmentList.d.ts.map +1 -0
  26. package/dist/composed/AppContextSwitcher/index.d.ts +3 -0
  27. package/dist/composed/AppContextSwitcher/index.d.ts.map +1 -0
  28. package/dist/composed/AppContextSwitcher/panelNavigation.d.ts +26 -0
  29. package/dist/composed/AppContextSwitcher/panelNavigation.d.ts.map +1 -0
  30. package/dist/composed/AppContextSwitcher/use-app-context-switcher.d.ts +39 -0
  31. package/dist/composed/AppContextSwitcher/use-app-context-switcher.d.ts.map +1 -0
  32. package/dist/composed/AppLayout/AppLayout.d.ts +6 -0
  33. package/dist/composed/AppLayout/AppLayout.d.ts.map +1 -1
  34. package/dist/composed/AppSidebar/AppSidebar.d.ts +9 -1
  35. package/dist/composed/AppSidebar/AppSidebar.d.ts.map +1 -1
  36. package/dist/composed/AppSidebar/ContextSidebar.d.ts +6 -1
  37. package/dist/composed/AppSidebar/ContextSidebar.d.ts.map +1 -1
  38. package/dist/composed/AppSidebar/ContextToggleButton.d.ts +4 -1
  39. package/dist/composed/AppSidebar/ContextToggleButton.d.ts.map +1 -1
  40. package/dist/composed/AppSidebar/SidebarNavigation.d.ts +6 -1
  41. package/dist/composed/AppSidebar/SidebarNavigation.d.ts.map +1 -1
  42. package/dist/composed/AppSidebar/SidebarUpgradeFooter.d.ts +3 -1
  43. package/dist/composed/AppSidebar/SidebarUpgradeFooter.d.ts.map +1 -1
  44. package/dist/composed/AppSidebar/types.d.ts +4 -0
  45. package/dist/composed/AppSidebar/types.d.ts.map +1 -1
  46. package/dist/composed/ContentHeader/ContentHeader.d.ts +1 -1
  47. package/dist/composed/LayoutSlots/LayoutSlotsContext.d.ts +1 -0
  48. package/dist/composed/LayoutSlots/LayoutSlotsContext.d.ts.map +1 -1
  49. package/dist/composed/SidebarMode/SidebarModeContext.d.ts +1 -0
  50. package/dist/composed/SidebarMode/SidebarModeContext.d.ts.map +1 -1
  51. package/dist/composed/SidebarMode/SidebarModeControl.d.ts +6 -1
  52. package/dist/composed/SidebarMode/SidebarModeControl.d.ts.map +1 -1
  53. package/dist/composed/ThemeProvider/ThemeProvider.d.ts +1 -0
  54. package/dist/composed/ThemeProvider/ThemeProvider.d.ts.map +1 -1
  55. package/dist/index.d.ts +1 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +7000 -6534
  58. package/dist/styles/globals.css +1 -1
  59. package/package.json +2 -1
package/USAGE_GUIDE.md CHANGED
@@ -358,9 +358,57 @@ App and environment switching has moved from the sidebar header into the top con
358
358
 
359
359
  **Local dev shells:** Module-local dev shells (`LocalDevShell`) that previously passed `apps`/`activeAppKey` to `AppSidebar` need the same migration. For minimal single-app dev setups, `AppContextBar` can be omitted entirely — just remove the old props from `AppSidebar`.
360
360
 
361
+ ### App context switcher
362
+
363
+ `AppContextSwitcher` is the other way to fill `appContext`: one menu for the app and the environment, where `AppContextBar` has a menu for each. The entrance (Account Management on Cloud, Home elsewhere) sits on top, every environment on the left with the pinned ones first, and the apps of the selected environment on the right. Picking an environment only shows its apps: nothing happens until the user picks an app or the entrance, so one pick changes both. With a single environment, the column and the search go away and the apps show as tiles.
364
+
365
+ Both go in the same slot, and a host uses one of them. The switcher fits a host with several environments: an app in another environment is one pick away, and a long list scrolls and can be searched. With `toHref`, the apps and the entrance are real links. An environment never is, since picking one only shows its apps: keep `AppContextBar` if users need to open an environment in a new tab. Like `AppContextBar`, it is host-owned: federated modules don't set it.
366
+
367
+ **`AppContextSwitcher` props:**
368
+
369
+ | Prop | Type | Required | Notes |
370
+ | --- | --- | --- | --- |
371
+ | `apps` | `AppDefinition[]` | Yes | The apps of an environment. `pinned` and `href` are ignored |
372
+ | `environments` | `EnvironmentDefinition[]` | Yes | `{ key, label, pinned? }`. Pinned environments come first |
373
+ | `entrance` | `EntranceDefinition` | No | `{ key, label, icon, contextLabel? }`. `contextLabel` (the account name) ends the entrance row in muted text, and takes the place of the environment in the trigger while the entrance is the active page |
374
+ | `activeAppKey` | `string` | Yes | The entrance key while the entrance is the active page |
375
+ | `activeEnvironmentKey` | `string` | Yes | |
376
+ | `onSelect` | `(selection: AppContextSwitcherSelection) => void` | Yes | See below |
377
+ | `toHref` | `(selection: AppContextSwitcherSelection) => string \| undefined` | No | The URL of a selection. With it, the apps and the entrance are real links: cmd/ctrl-click, middle-click or cmd/ctrl/shift+Enter open one in a new tab, a plain click or Enter still goes through `onSelect` |
378
+ | `defaultOpen` | `boolean` | No | Opens the panel on the first render |
379
+ | `onOpenChange` | `(open: boolean) => void` | No | |
380
+
381
+ **`onSelect`** gets one of:
382
+
383
+ - `{ kind: 'app', appKey, environmentKey }`: open the app in that environment, at its root.
384
+ - `{ kind: 'entrance', environmentKey }`: open the entrance. `environmentKey` is the environment selected in the panel, for an entrance that depends on it, such as Home.
385
+
386
+ The panel closes on every pick. Picking the page already shown calls nothing.
387
+
388
+ **Pins** are read-only: the panel shows them, with no control to change them, because a button inside an option is out of keyboard reach. Store them on the host and let users pin on a page you own, such as the environments page.
389
+
390
+ ```tsx
391
+ <ContentHeader
392
+ leading={slots.leading}
393
+ appContext={
394
+ <AppContextSwitcher
395
+ apps={apps}
396
+ environments={environments}
397
+ entrance={{ key: 'account', label: 'Account Management', icon: <GioProductizeIcon />, contextLabel: accountName }}
398
+ activeAppKey={activeAppKey}
399
+ activeEnvironmentKey={envHrid}
400
+ onSelect={handleSelect}
401
+ toHref={(selection) => (selection.kind === 'app' ? appPath(selection) : '/account')}
402
+ />
403
+ }
404
+ breadcrumbs={slots.breadcrumbs}
405
+ trailing={...}
406
+ />
407
+ ```
408
+
361
409
  ### Breadcrumbs
362
410
 
363
- When using `AppContextBar` in the `appContext` slot, the active application name is already visible in the header bar. Remove the app/module name (e.g. "API Management", "Access Management") from your first breadcrumb segment to avoid duplication. Breadcrumbs should start at the **page level**:
411
+ When using `AppContextBar` or `AppContextSwitcher` in the `appContext` slot, the active application name is already visible in the header bar. Remove the app/module name (e.g. "API Management", "Access Management") from your first breadcrumb segment to avoid duplication. Breadcrumbs should start at the **page level**:
364
412
 
365
413
  ```tsx
366
414
  /* Good — starts at the page, app name is in AppContextBar */
@@ -383,7 +431,7 @@ If you have not migrated to `AppContextBar` yet, keeping the app name as the fir
383
431
 
384
432
  **Linear breadcrumbs:** When each step maps to a **path string** and React Router’s `navigate`, use **`buildLinearBreadcrumbs(navigate, segments)`** so `ContentHeader` / `useLayoutConfig` get consistent `BreadcrumbEntry[]` without copying the same `onClick` wiring. If the first crumb is a **custom action** (e.g. “back” that is not `navigate('/path')`), build that entry by hand or mix with `buildLinearBreadcrumbs`—see Storybook **Composed/ContentHeader → Linear breadcrumbs from builder** for the canonical route-based pattern. API edge cases are covered in `packages/core/src/lib/breadcrumbs/buildLinearBreadcrumbs.test.ts`.
385
433
 
386
- **Opening navigation in a new tab:** an app (`AppDefinition`), an environment or other `SelectorDropdown` option (`SelectorOption`), a side menu item (`NavItem`) or a breadcrumb (`BreadcrumbEntry`) with an `href` renders as a real link, so users can right-click, middle-click or cmd/ctrl-click it to open it in a new tab. A plain click still calls your callback (`onAppChange`, `onEnvironmentChange`, `onItemSelect`, the crumb's `onClick`) and navigates without a reload. A modified click leaves the app switcher or environment menu open, so several items can be opened in turn. Without a callback, a plain click loads the `href`, except on the current app, environment or side menu item, which stays put. The browser opens an `href` as-is, without React Router's relative resolution or `basename`, so pass the full URL. `buildLinearBreadcrumbs` adds `href` only when you pass `toHref`, which turns each segment's `to` into that URL: `to` still goes to `navigate` unchanged, so `toHref` must resolve it the same way `navigate` does. `(to) => to` is enough when every `to` is an absolute path and the router has no `basename`; for a relative `to` such as `'..'`, resolve it, e.g. with React Router's `resolvePath(to, location.pathname).pathname` for `relative: 'path'`, and add the `basename` if there is one.
434
+ **Opening navigation in a new tab:** an app (`AppDefinition`), an environment or other `SelectorDropdown` option (`SelectorOption`), a side menu item (`NavItem`) or a breadcrumb (`BreadcrumbEntry`) with an `href`, or a row of `AppContextSwitcher` whose `toHref` gives a URL, renders as a real link, so users can right-click, middle-click or cmd/ctrl-click it to open it in a new tab. A plain click still calls your callback (`onAppChange`, `onEnvironmentChange`, `onItemSelect`, the crumb's `onClick`) and navigates without a reload. A modified click leaves the app switcher or environment menu open, so several items can be opened in turn. Without a callback, a plain click loads the `href`, except on the current app, environment or side menu item, which stays put. The browser opens an `href` as-is, without React Router's relative resolution or `basename`, so pass the full URL. `buildLinearBreadcrumbs` adds `href` only when you pass `toHref`, which turns each segment's `to` into that URL: `to` still goes to `navigate` unchanged, so `toHref` must resolve it the same way `navigate` does. `(to) => to` is enough when every `to` is an absolute path and the router has no `basename`; for a relative `to` such as `'..'`, resolve it, e.g. with React Router's `resolvePath(to, location.pathname).pathname` for `relative: 'path'`, and add the `basename` if there is one.
387
435
 
388
436
  ### `contentVariant` — content width
389
437
 
@@ -1060,7 +1108,7 @@ The platform e2e suite selects elements by `data-testid` only. These are the rul
1060
1108
  - Anything that opens an overlay: the trigger.
1061
1109
  - Dialogs, sheets, drawers and popovers: the content node inside the portal, not the overlay.
1062
1110
  - Rows: the `<tr>`.
1063
- - Radix roots that render no element (`Dialog`, `Select`, `DropdownMenu`, `Popover`, `Tooltip`, …) have no target: put the id on their Trigger, Content or Item.
1111
+ - Radix roots that render no element (`Dialog`, `Select`, `DropdownMenu`, `Popover`, `Tooltip`, …) have no target: put the id on their Trigger, Content or Item. Nor do the providers (`ThemeProvider`, `SidebarModeProvider`, `LayoutSlotsProvider`): put the id on the components inside them.
1064
1112
  - Each component's docs page names its element and its derived parts: "Test id lands on …". Only what a docs page or the **Derived parts** table below states is guaranteed.
1065
1113
  - **Derived ids.** A component may give the parts it renders itself, that you can't compose, an id derived from yours: `${id}-<part>`, or `${id}-<part>-<key>` with a key taken verbatim from your data (a built-in close button would be `${id}-close`). Which parts exist is in the **Derived parts** table below and on each component's docs page: don't assume one they don't list. Match exact ids, not prefixes.
1066
1114
  - **Stability.** Documented targets and part names are public API. Renaming or removing one, or moving it to another element, ships only in a major version, with a release note.
@@ -1147,6 +1195,18 @@ The components that derive ids from yours. A part exists only when you pass an i
1147
1195
  | `FacetedFilter` | `${id}-count` | Count badge, while a value is selected |
1148
1196
  | `FacetedFilter` | `${id}-option-<value>` | Option, while the popover is open and the search shows it; `value` verbatim, not ending with `-select` |
1149
1197
  | `FacetedFilter` | `${id}-option-<value>-select` | The option's checkbox, present with its option; read-only: read `aria-checked`, click `${id}-option-<value>` to select (a click on the checkbox fails, the option intercepts it) |
1198
+ | `AppLayout` | `${id}-main` | Main content region (`<main>`) |
1199
+ | `AppLayout` | `${id}-context-sidebar` | Context sidebar `<aside>`, while `viewMode` is `'context'` with a `contextSidebar`; `aria-hidden` while collapsed |
1200
+ | `AppLayout` | `${id}-banner` | Banner wrapper, with `banner` |
1201
+ | `AppSidebar` | `${id}-logo` | Logo button, with `onLogoClick`; without it the logo is decorative and has no id |
1202
+ | `AppSidebar` | `${id}-footer` | Footer, holding the `renderFooter` content and the sidebar mode control |
1203
+ | `AppSidebar` | `${id}-rail` | Rail button (toggles the sidebar) |
1204
+ | `AppSidebar` | `${id}-mode` | Sidebar mode control trigger; its parts are those of `SidebarModeControl`: `${id}-mode-content`, `${id}-mode-option-<mode>` |
1205
+ | `SidebarModeControl` | `${id}-content` | Popover content, while the popover is open |
1206
+ | `SidebarModeControl` | `${id}-option-<mode>` | Mode option (`expanded`, `collapsed`, `hover-expand`), while the popover is open |
1207
+ | `SidebarNavigation` | `${id}-nav-<item.key>` | Item link, with an `href`, or button, locked or without one; `item.key` verbatim, unique across the whole navigation |
1208
+ | `ContextSidebar` | `${id}-nav-<item.key>` | Navigation item, with `groups`: the navigation takes the sidebar's own id; its parts are those of `SidebarNavigation` |
1209
+ | `SidebarUpgradeFooter` | `${id}-action` | Upgrade link, while `lockedFeatures` is not empty |
1150
1210
  | `CodeEditor` | `${id}-loading` | Skeleton, while Monaco loads |
1151
1211
  | `CodeEditor` | `${id}-fallback` | Plain textarea, when Monaco fails to load |
1152
1212
  | `JsonSchemaForm` | `${id}-<path>` | The control of the field at the react-hook-form path, verbatim (`headers.0.name`); a code editor field: its container, with `-loading` while Monaco loads and `-fallback` when it fails |
@@ -1160,9 +1220,17 @@ The components that derive ids from yours. A part exists only when you pass an i
1160
1220
  | `JsonSchemaForm` | `${id}-<path>.<i>-toggle` | Array item row toggle, object items only; `<i>` is the item's position |
1161
1221
  | `JsonSchemaForm` | `${id}-<path>-variant` | `oneOf` / `anyOf` variant selector; its items are `-variant-option-<index>`, by position |
1162
1222
  | `JsonSchemaForm` | `${id}-schema-error` | The invalid schema alert |
1223
+ | `AppContextSwitcher` | `${id}-content` | Panel content node, inside the portal |
1224
+ | `AppContextSwitcher` | `${id}-search` | Search field, with several environments |
1225
+ | `AppContextSwitcher` | `${id}-clear` | Clear button of the search field, while it has text |
1226
+ | `AppContextSwitcher` | `${id}-entrance` | Entrance row |
1227
+ | `AppContextSwitcher` | `${id}-environment-option-<key>` | Environment row, `EnvironmentDefinition.key` |
1228
+ | `AppContextSwitcher` | `${id}-app-option-<key>` | App row, `AppDefinition.key` |
1163
1229
 
1164
1230
  `JsonSchemaForm` renders no element of its own, so its id is only a prefix. A field at the root path is `${id}`, and its error `${id}-error`.
1165
1231
 
1232
+ `SidebarNavigation` renders no element of its own either: its id only prefixes its items. `ContextSidebar` hands its own id, unchanged, to the `SidebarNavigation` it renders from `groups`, so its items are `${id}-nav-<item.key>`. Some exports have their docs line on another component's page: `SidebarNavigation`, `SidebarUpgradeFooter`, `SidebarModeControl` and `SidebarModeProvider` on the `AppSidebar` page, `ContextToggleButton` and `LayoutSlotsProvider` on the `ContextSidebar` page, `ThemeProvider` on the `AppLayout` page.
1233
+
1166
1234
  The `DataTable` row key is TanStack's `row.id`: pass `tableOptions={{ getRowId: (entity) => entity.id }}` for a stable key. Without `getRowId`, the key is the row's index in `data`, which is not a contract. `DataTableColumnHeader` takes the prefix of its header cell, `${tableId}-header-<columnId>`, unless you give it an id of its own. Keys are verbatim, never escaped: a `getRowId` result must not end with `-select`, and a column id must not end with `-sort` or `-resize`, or two elements share one id (row `a`'s checkbox and a row `a-select` are both `${tableId}-row-a-select`). Use the record's own id, not a display label. `columnId` is TanStack's `column.id`: the column's `id`, else its `accessorKey` (`.` becomes `_`), else its `header` when that is a string, which makes the key a display label. Give an explicit `id` to every column group and to every column without an `accessorKey`. The id of a column group's header, `${tableId}-header-<groupId>` and its `-resize`, is unique only while the group's columns stay adjacent: a `columnOrder` or `columnPinning` passed through `tableOptions` that puts another column between them renders the group's header twice, with the same id.
1167
1235
 
1168
1236
  The `Calendar` day keys are dates as react-day-picker formats them: they assume react-day-picker's default `numerals` (`latn`) and no `dateLib` override (Gregorian calendar); the `locale` doesn't change them. The dropdown keys are positions: navigating or picking a month doesn't change them. A `Calendar` part you replace through `components` gets no id. Replacing `MonthCaption` also drops the `month` and `year` ids, even though the dropdowns still render.
@@ -2,6 +2,7 @@
2
2
  * Storybook fixtures by feature area. Prefer importing from this barrel or from a
3
3
  * specific module (e.g. `./apim/navigation.fixture`) in large stories.
4
4
  */
5
+ export { accountManagementEntrance, cloudEnvironments, gammaConsoleApps, homeEntrance, manyEnvironments, selfHostedEnvironments, teamEnvironments, } from './shell/app-context-switcher.fixture';
5
6
  export { sampleApps, sampleAppsExtended } from './shell/app-switcher.fixture';
6
7
  export { sampleEnvironments, sampleEnvironmentsForSidebar } from './shell/environment-picker.fixture';
7
8
  export { agentManagementApps, agentManagementNavGroups, contextNavGroups, contextPageTabKeys, findContextLabel, findNavLabel, licenseAwareNavGroups, pageLayoutNavGroups, sampleNavGroups, } from './navigation.fixture';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__stories__/fixtures/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAEtG,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB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,EAC1B,8BAA8B,EAC9B,sCAAsC,EACtC,gCAAgC,EAChC,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,sBAAsB,EACtB,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { EntranceDefinition, EnvironmentDefinition } from '../../../composed/AppContextSwitcher';
2
+ import { AppDefinition } from '../../../composed/AppSwitcher';
3
+ /** The Gamma console's apps, in the order of its catalog. */
4
+ export declare const gammaConsoleApps: AppDefinition[];
5
+ /** A Cloud account's environments, two of them pinned. */
6
+ export declare const cloudEnvironments: EnvironmentDefinition[];
7
+ /** Enough environments to search through. */
8
+ export declare const manyEnvironments: EnvironmentDefinition[];
9
+ /**
10
+ * A production and a staging environment per team, two of them pinned: a search can match more of them than the
11
+ * panel holds.
12
+ */
13
+ export declare const teamEnvironments: EnvironmentDefinition[];
14
+ /** A self-hosted installation's environments. */
15
+ export declare const selfHostedEnvironments: EnvironmentDefinition[];
16
+ /** On Cloud, Account Management sits above the environments. */
17
+ export declare const accountManagementEntrance: EntranceDefinition;
18
+ /** Without Account Management, Home takes its place. */
19
+ export declare const homeEntrance: EntranceDefinition;
20
+ //# sourceMappingURL=app-context-switcher.fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-context-switcher.fixture.d.ts","sourceRoot":"","sources":["../../../../src/__stories__/fixtures/shell/app-context-switcher.fixture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACrH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAalF,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,EAAE,aAAa,EA2C3C,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB,EAAE,qBAAqB,EAMpD,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,EASnD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,qBAAqB,EA4BlD,CAAC;AAEH,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,EAAE,qBAAqB,EAIzD,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,kBAKvC,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,YAAY,EAAE,kBAA0E,CAAC"}
@@ -10,12 +10,13 @@ declare function CommandDialog({ title, description, children, className, showCl
10
10
  /** Lands on the dialog content; the built-in close button, with `showCloseButton`, gets `${id}-close`. */
11
11
  'data-testid'?: string;
12
12
  }): React.JSX.Element;
13
- declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
13
+ /** `children` land in the group after the input: a trailing addon, such as a clear button. */
14
+ declare function CommandInput({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
14
15
  declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
15
16
  declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
16
17
  declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
17
18
  declare function CommandSeparator({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
18
- declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
19
+ declare function CommandItem({ className, children, asChild, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
19
20
  declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
20
21
  export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, };
21
22
  //# sourceMappingURL=Command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../src/base/Command/Command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,MAAM,EAKP,MAAM,qCAAqC,CAAC;AAK7C,iBAAS,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,qBAWtF;AAED,iBAAS,aAAa,CAAC,EACrB,KAAyB,EACzB,WAA8C,EAC9C,QAAQ,EACR,SAAS,EACT,eAAuB,EACvB,aAAa,EAAE,MAAM,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0GAA0G;IAC1G,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,qBAiBA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAkBjG;AAED,iBAAS,WAAW,CAAC,EAAE,SAA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,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW7E;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Ref } from 'react';
2
+ import { AppDefinition } from '../AppSwitcher';
3
+ interface AppColumnProps {
4
+ readonly ref?: Ref<HTMLDivElement>;
5
+ readonly apps: readonly AppDefinition[];
6
+ readonly activeAppKey: string;
7
+ /** The apps shown are the active environment's. */
8
+ readonly inActiveEnvironment: boolean;
9
+ /** Names the environment next to the environment column. Without it, the apps are tiles, as in `AppSwitcher`. */
10
+ readonly environmentLabel?: string;
11
+ readonly hrefOf?: (appKey: string) => string | undefined;
12
+ readonly onSelect: (key: string) => void;
13
+ readonly partTestId: (part: string) => string | undefined;
14
+ }
15
+ /**
16
+ * The apps of the selected environment: a column next to the environments, or under them in a narrow panel, or tiles
17
+ * on their own.
18
+ */
19
+ declare function AppColumn({ ref, apps, activeAppKey, inActiveEnvironment, environmentLabel, hrefOf, onSelect, partTestId, }: AppColumnProps): import("react").JSX.Element;
20
+ export { AppColumn };
21
+ //# sourceMappingURL=AppColumn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppColumn.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/AppColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAIlF,UAAU,cAAc;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,iHAAiH;IACjH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC3D;AAED;;;GAGG;AACH,iBAAS,SAAS,CAAC,EACjB,GAAG,EACH,IAAI,EACJ,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,UAAU,GACX,EAAE,cAAc,+BA2BhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { AppContextSwitcherProps } from './appContextSwitcher.types';
2
+ /**
3
+ * One control for the app and the environment: the entrance on top, the environments on the left, the apps of the
4
+ * selected environment on the right. A narrow panel, in a small or zoomed window, stacks the apps under the
5
+ * environments.
6
+ *
7
+ * A Radix menu would eat the search field's keystrokes with its typeahead, so this composes `Popover` and `Command`
8
+ * as `DataTableViewOptionsSearch` does. Up and Down move within a column, Right and Left move between the columns,
9
+ * Enter picks, Escape closes and returns the focus to the trigger. Enter or Right on an environment shows its apps
10
+ * and highlights what Enter opens next, where a click only shows them. The highlight wears a ring while the
11
+ * keyboard drives it, as `focus-visible` would, and screen readers follow it through `aria-activedescendant`.
12
+ */
13
+ declare function AppContextSwitcher({ apps, environments, entrance, activeAppKey, activeEnvironmentKey, onSelect, toHref, defaultOpen, onOpenChange, className, 'data-testid': testId, }: AppContextSwitcherProps): import("react").JSX.Element;
14
+ declare namespace AppContextSwitcher {
15
+ var displayName: string;
16
+ }
17
+ export { AppContextSwitcher };
18
+ //# sourceMappingURL=AppContextSwitcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppContextSwitcher.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/AppContextSwitcher.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AA2B1E;;;;;;;;;;GAUG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,MAAM,EACN,WAAmB,EACnB,YAAY,EACZ,SAAS,EACT,aAAa,EAAE,MAAM,GACtB,EAAE,uBAAuB,+BAyPzB;kBArQQ,kBAAkB;;;AAyQ3B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { Button } from '../../base/Button';
3
+ interface AppContextSwitcherTriggerProps extends ComponentProps<typeof Button> {
4
+ readonly icon?: ReactNode;
5
+ readonly label: string;
6
+ /** Where the label applies: the environment, or the entrance's context. */
7
+ readonly context?: string;
8
+ }
9
+ /**
10
+ * The header button: the active app and its environment, such as "API Management · Production". It never outgrows its
11
+ * container: a name too long for its room is cut, the full name in its tooltip.
12
+ */
13
+ declare function AppContextSwitcherTrigger({ icon, label, context, className, ...props }: AppContextSwitcherTriggerProps): import("react").JSX.Element;
14
+ export { AppContextSwitcherTrigger };
15
+ //# sourceMappingURL=AppContextSwitcherTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppContextSwitcherTrigger.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/AppContextSwitcherTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D,UAAU,8BAA+B,SAAQ,cAAc,CAAC,OAAO,MAAM,CAAC;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,iBAAS,yBAAyB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,8BAA8B,+BA4B/G;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { AppDefinition } from '../AppSwitcher';
2
+ interface AppRowProps {
3
+ readonly app: AppDefinition;
4
+ /** The page shown: the active app in the active environment. */
5
+ readonly current: boolean;
6
+ /** A tile with the app's description, as in `AppSwitcher`, instead of a single line. */
7
+ readonly tile: boolean;
8
+ readonly href?: string;
9
+ readonly onSelect: (key: string) => void;
10
+ readonly 'data-testid'?: string;
11
+ }
12
+ declare function AppRow({ app, current, tile, href, onSelect, 'data-testid': testId }: AppRowProps): import("react").JSX.Element;
13
+ export { AppRow };
14
+ //# sourceMappingURL=AppRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppRow.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/AppRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAKlF,UAAU,WAAW;IACnB,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,iBAAS,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,WAAW,+BAuCzF;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { EntranceDefinition } from './appContextSwitcher.types';
2
+ interface EntranceRowProps {
3
+ readonly entrance: EntranceDefinition;
4
+ readonly current: boolean;
5
+ /** The apps below are tiles: the icon keeps a tile's width so that the labels line up. */
6
+ readonly overTiles: boolean;
7
+ readonly href?: string;
8
+ readonly onSelect: () => void;
9
+ readonly 'data-testid'?: string;
10
+ }
11
+ /**
12
+ * The row above the columns: the page that sits above the environments. Its context, the account, ends the row in
13
+ * muted text: everything the panel lists belongs to it, and it cannot be changed from here.
14
+ */
15
+ declare function EntranceRow({ entrance, current, overTiles, href, onSelect, 'data-testid': testId }: EntranceRowProps): import("react").JSX.Element;
16
+ export { EntranceRow };
17
+ //# sourceMappingURL=EntranceRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntranceRow.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/EntranceRow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGrE,UAAU,gBAAgB;IACxB,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,0FAA0F;IAC1F,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,gBAAgB,+BAkC7G;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { EnvironmentDefinition } from './appContextSwitcher.types';
2
+ interface EnvironmentColumnProps {
3
+ readonly environments: readonly EnvironmentDefinition[];
4
+ readonly selectedKey: string;
5
+ readonly activeKey: string;
6
+ readonly onSelect: (key: string) => void;
7
+ readonly partTestId: (part: string) => string | undefined;
8
+ }
9
+ /** The left column: every environment, or the ones a search matches. */
10
+ declare function EnvironmentColumn({ environments, selectedKey, activeKey, onSelect, partTestId }: EnvironmentColumnProps): import("react").JSX.Element;
11
+ export { EnvironmentColumn };
12
+ //# sourceMappingURL=EnvironmentColumn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentColumn.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/EnvironmentColumn.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC3D;AAED,wEAAwE;AACxE,iBAAS,iBAAiB,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,sBAAsB,+BAuBhH;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { EnvironmentDefinition } from './appContextSwitcher.types';
2
+ interface EnvironmentRowProps {
3
+ readonly environment: EnvironmentDefinition;
4
+ /** Its apps are the ones shown. */
5
+ readonly selected: boolean;
6
+ readonly active: boolean;
7
+ readonly onSelect: (key: string) => void;
8
+ readonly 'data-testid'?: string;
9
+ }
10
+ /**
11
+ * One environment. Picking it shows its apps, nothing more: a chevron points at them, darker on the environment whose
12
+ * apps are shown, which also keeps a fill. The check marks the active environment, a pin the pinned ones.
13
+ */
14
+ declare function EnvironmentRow({ environment, selected, active, onSelect, 'data-testid': testId }: EnvironmentRowProps): import("react").JSX.Element;
15
+ export { EnvironmentRow };
16
+ //# sourceMappingURL=EnvironmentRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentRow.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/EnvironmentRow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AASD;;;GAGG;AACH,iBAAS,cAAc,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BAoC9G;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { ReactNode } from 'react';
2
+ import { AppDefinition } from '../AppSwitcher';
3
+ interface EnvironmentDefinition {
4
+ readonly key: string;
5
+ readonly label: string;
6
+ /**
7
+ * Pinned environments come first, with a pin. The panel only shows pins: a button inside an option would be out of
8
+ * keyboard reach, so the host lets users pin elsewhere, such as on its environments page.
9
+ */
10
+ readonly pinned?: boolean;
11
+ }
12
+ /**
13
+ * The page above the environments, on its own row at the top of the panel: Account Management on Cloud, Home
14
+ * elsewhere.
15
+ */
16
+ interface EntranceDefinition {
17
+ readonly key: string;
18
+ readonly label: string;
19
+ readonly icon: ReactNode;
20
+ /**
21
+ * The account name: ends the entrance row in the panel, and takes the place of the environment in the trigger while
22
+ * the entrance is the active page. Without it, the trigger shows the active environment, as it does for an app.
23
+ */
24
+ readonly contextLabel?: string;
25
+ }
26
+ type AppContextSwitcherSelection = {
27
+ readonly kind: 'app';
28
+ readonly appKey: string;
29
+ readonly environmentKey: string;
30
+ } | {
31
+ readonly kind: 'entrance';
32
+ /** The environment selected in the panel, for an entrance that depends on it, such as Home. */
33
+ readonly environmentKey: string;
34
+ };
35
+ interface AppContextSwitcherProps {
36
+ /** The apps of an environment. `pinned` and `href` are ignored. */
37
+ readonly apps: readonly AppDefinition[];
38
+ readonly environments: readonly EnvironmentDefinition[];
39
+ readonly entrance?: EntranceDefinition;
40
+ /** The active app, or the entrance key while the entrance is the active page. */
41
+ readonly activeAppKey: string;
42
+ readonly activeEnvironmentKey: string;
43
+ /** Called when an app or the entrance is picked, except for the page already shown. The panel closes either way. */
44
+ readonly onSelect: (selection: AppContextSwitcherSelection) => void;
45
+ /**
46
+ * The URL of a selection: makes the apps and the entrance real links, so that they open in a new tab on
47
+ * cmd/ctrl-click, middle-click or cmd/ctrl/shift+Enter. A plain click or Enter still goes through `onSelect`.
48
+ */
49
+ readonly toHref?: (selection: AppContextSwitcherSelection) => string | undefined;
50
+ /** Opens the panel on the first render. */
51
+ readonly defaultOpen?: boolean;
52
+ readonly onOpenChange?: (open: boolean) => void;
53
+ /** Applied to the trigger. */
54
+ readonly className?: string;
55
+ /** Lands on the trigger. The parts the panel renders derive their ids from it. */
56
+ readonly 'data-testid'?: string;
57
+ }
58
+ export type { AppContextSwitcherProps, AppContextSwitcherSelection, EntranceDefinition, EnvironmentDefinition };
59
+ //# sourceMappingURL=appContextSwitcher.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appContextSwitcher.types.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/appContextSwitcher.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAElF,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,KAAK,2BAA2B,GAC5B;IACE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,+FAA+F;IAC/F,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC,CAAC;AAEN,UAAU,uBAAuB;IAC/B,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC,iFAAiF;IACjF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,oHAAoH;IACpH,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,2BAA2B,KAAK,IAAI,CAAC;IACpE;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,2BAA2B,KAAK,MAAM,GAAG,SAAS,CAAC;IACjF,2CAA2C;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,kFAAkF;IAClF,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,YAAY,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { EnvironmentDefinition } from './appContextSwitcher.types';
2
+ /**
3
+ * The environments the panel lists: pinned ones first, then the others, each in the order given. A query keeps those
4
+ * whose label contains it.
5
+ */
6
+ declare function listEnvironments(environments: readonly EnvironmentDefinition[], query: string): EnvironmentDefinition[];
7
+ export { listEnvironments };
8
+ //# sourceMappingURL=environmentList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environmentList.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/environmentList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAKhH;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { AppContextSwitcher } from './AppContextSwitcher';
2
+ export type { AppContextSwitcherProps, AppContextSwitcherSelection, EntranceDefinition, EnvironmentDefinition, } from './appContextSwitcher.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,26 @@
1
+ declare const ENTRANCE_ITEM = "entrance";
2
+ declare function environmentItem(key: string): string;
3
+ declare function appItem(key: string): string;
4
+ /** The panel's items by area, each in the order shown: the entrance row, the environment column, the apps column. */
5
+ interface PanelAreas {
6
+ readonly top: readonly string[];
7
+ readonly left: readonly string[];
8
+ readonly right: readonly string[];
9
+ }
10
+ /** Where a move to the other column lands. */
11
+ interface ColumnLanding {
12
+ readonly left?: string;
13
+ readonly right?: string;
14
+ }
15
+ declare const NAVIGATION_KEYS: readonly ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
16
+ type NavigationKey = (typeof NAVIGATION_KEYS)[number];
17
+ declare function isNavigationKey(key: string): key is NavigationKey;
18
+ /**
19
+ * The item a navigation key moves the highlight to. Up and Down stay in the column and stop at its ends, Up from the
20
+ * top of a column reaches the entrance row. Right goes from the environments to the apps, Left comes back. Returns
21
+ * `undefined` when the key is not the panel's to handle, so the search field keeps it to move its caret.
22
+ */
23
+ declare function nextItem(areas: PanelAreas, current: string, key: NavigationKey, landing: ColumnLanding): string | undefined;
24
+ export { appItem, ENTRANCE_ITEM, environmentItem, isNavigationKey, nextItem };
25
+ export type { ColumnLanding, NavigationKey, PanelAreas };
26
+ //# sourceMappingURL=panelNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panelNavigation.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/panelNavigation.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,aAAa,CAAC;AAEjC,iBAAS,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,iBAAS,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpC;AAED,qHAAqH;AACrH,UAAU,UAAU;IAClB,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,8CAA8C;AAC9C,UAAU,aAAa;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,eAAe,8DAA+D,CAAC;AACrF,KAAK,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,iBAAS,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,aAAa,CAE1D;AAUD;;;;GAIG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAoBpH;AAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;AAC9E,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { AppDefinition } from '../AppSwitcher';
2
+ import { EntranceDefinition, EnvironmentDefinition } from './appContextSwitcher.types';
3
+ import { NavigationKey } from './panelNavigation';
4
+ interface UseAppContextSwitcherOptions {
5
+ readonly apps: readonly AppDefinition[];
6
+ readonly environments: readonly EnvironmentDefinition[];
7
+ readonly entrance?: EntranceDefinition;
8
+ readonly activeAppKey: string;
9
+ readonly activeEnvironmentKey: string;
10
+ readonly defaultOpen: boolean;
11
+ readonly onOpenChange?: (open: boolean) => void;
12
+ }
13
+ /**
14
+ * The switcher's state. The selected environment is the one whose apps are shown: the picked one, which starts as the
15
+ * active one at each opening, or the first match of a search that leaves it out. The highlight is cmdk's, held here so
16
+ * that the arrow keys can move it by column. cmdk still moves it on its own, to the first item after each search and
17
+ * to the item under the pointer, and those moves are always accepted: cmdk updates its internal value before it
18
+ * reports one.
19
+ */
20
+ declare function useAppContextSwitcher({ apps, environments, entrance, activeAppKey, activeEnvironmentKey, defaultOpen, onOpenChange, }: UseAppContextSwitcherOptions): {
21
+ open: boolean;
22
+ changeOpen: (next: boolean) => void;
23
+ query: string;
24
+ changeQuery: import('react').Dispatch<import('react').SetStateAction<string>>;
25
+ highlighted: string;
26
+ changeHighlighted: import('react').Dispatch<import('react').SetStateAction<string>>;
27
+ moveHighlight: (key: NavigationKey) => boolean;
28
+ selectedEnvironmentKey: string;
29
+ showEnvironment: (key: string) => void;
30
+ pickHighlightedEnvironment: () => boolean;
31
+ inActiveEnvironment: boolean;
32
+ singleEnvironment: boolean;
33
+ listedEnvironments: EnvironmentDefinition[];
34
+ showEntrance: boolean;
35
+ showApps: boolean;
36
+ };
37
+ export { useAppContextSwitcher };
38
+ export type { UseAppContextSwitcherOptions };
39
+ //# sourceMappingURL=use-app-context-switcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-app-context-switcher.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/use-app-context-switcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAE5F,OAAO,EAKL,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAC;AAE3B,UAAU,4BAA4B;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACjD;AAED;;;;;;GAMG;AACH,iBAAS,qBAAqB,CAAC,EAC7B,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,YAAY,GACb,EAAE,4BAA4B;;uBA2CH,OAAO;;;;;yBA0BL,aAAa,KAAG,OAAO;;2BAfrB,MAAM;sCAMG,OAAO;;;;;;EAoC/C;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,YAAY,EAAE,4BAA4B,EAAE,CAAC"}
@@ -2,6 +2,12 @@ import { ReactNode } from 'react';
2
2
  import { SidebarMode } from '../SidebarMode';
3
3
  import { ThemeMode } from '../ThemeProvider';
4
4
  interface AppLayoutProps {
5
+ /**
6
+ * Lands on the root `div[data-slot=sidebar-wrapper]`. Main region (`<main>`): `${id}-main`, context sidebar
7
+ * (`<aside>`, in context view mode with a `contextSidebar`): `${id}-context-sidebar`, banner (with `banner`):
8
+ * `${id}-banner`.
9
+ */
10
+ readonly 'data-testid'?: string;
5
11
  readonly className?: string;
6
12
  /** Side navigation element (typically an <AppSidebar />). */
7
13
  readonly sidebar?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src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,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,WAAW,CAAC;IAC1C,kDAAkD;IAClD,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC;CACnC;AAyGD,iBAAS,SAAS,CAAC,EAAE,kBAAmC,EAAE,YAAuB,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,+BAQ3G;kBARQ,SAAS;;;AAYlB,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,CAAC"}
@@ -1,5 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  interface AppSidebarProps {
3
+ /**
4
+ * Lands on the sidebar panel: `div[data-slot=sidebar-container]` on desktop; on mobile, the sheet content, inside
5
+ * the portal, while the sheet is open. `${id}-logo`: the logo button, with `onLogoClick` (without it the logo is
6
+ * decorative and has no id). Footer: `${id}-footer`, rail: `${id}-rail`, sidebar mode control: `${id}-mode`, which
7
+ * derives the parts of `SidebarModeControl` (`${id}-mode-content`, `${id}-mode-option-<mode>`); on mobile they too
8
+ * exist only while the sheet is open. What `renderNavigation` and `renderFooter` return keeps its own ids.
9
+ */
10
+ readonly 'data-testid'?: string;
3
11
  readonly className?: string;
4
12
  /**
5
13
  * Click handler for the logo. Use this for client-side routing in SPAs.
@@ -21,7 +29,7 @@ interface AppSidebarProps {
21
29
  */
22
30
  readonly renderFooter?: () => ReactNode;
23
31
  }
24
- declare function AppSidebar({ className, onLogoClick, renderNavigation, renderFooter }: AppSidebarProps): import("react").JSX.Element;
32
+ declare function AppSidebar({ className, onLogoClick, renderNavigation, renderFooter, 'data-testid': testId, }: AppSidebarProps): import("react").JSX.Element;
25
33
  declare namespace AppSidebar {
26
34
  var displayName: string;
27
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppSidebar.d.ts","sourceRoot":"","sources":["../../../src/composed/AppSidebar/AppSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAmBvC,UAAU,eAAe;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAElC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,SAAS,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,SAAS,CAAC;CACzC;AASD,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,EAAE,eAAe,+BAmD9F;kBAnDQ,UAAU;;;AAuDnB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"AppSidebar.d.ts","sourceRoot":"","sources":["../../../src/composed/AppSidebar/AppSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoBvC,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAElC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,SAAS,CAAC;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,SAAS,CAAC;CACzC;AASD,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EAAE,MAAM,GACtB,EAAE,eAAe,+BAqDjB;kBA3DQ,UAAU;;;AA+DnB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { NavGroup } from './types';
3
3
  interface ContextSidebarProps {
4
+ /**
5
+ * Lands on the root `div[data-slot=context-sidebar]`. With `groups`, the navigation it renders takes the same id:
6
+ * each item is `${id}-nav-<item.key>`, as in `SidebarNavigation`. `children` keep their own ids.
7
+ */
8
+ readonly 'data-testid'?: string;
4
9
  readonly className?: string;
5
10
  /** App-specific header content (e.g. resource name, version, status). */
6
11
  readonly header?: ReactNode;
@@ -11,7 +16,7 @@ interface ContextSidebarProps {
11
16
  /** Escape hatch: provide fully custom navigation instead of `groups`. */
12
17
  readonly children?: ReactNode;
13
18
  }
14
- declare function ContextSidebar({ className, header, groups, activeItemKey, onItemSelect, children }: ContextSidebarProps): import("react").JSX.Element;
19
+ declare function ContextSidebar({ className, header, groups, activeItemKey, onItemSelect, children, 'data-testid': testId, }: ContextSidebarProps): import("react").JSX.Element;
15
20
  declare namespace ContextSidebar {
16
21
  var displayName: string;
17
22
  }