@gravitee/graphene-core 3.38.0 → 3.39.0-feat-app-context-switcher.c8f1066

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 (60) hide show
  1. package/USAGE_GUIDE.md +85 -14
  2. package/dist/{CodeEditor-W9JPCQhc.js → CodeEditor-C44Pe2i6.js} +23 -18
  3. package/dist/{CodeEditorField-CIqdz3P2.js → CodeEditorField-B5QDl5Zv.js} +1 -1
  4. package/dist/__stories__/fixtures/index.d.ts +1 -0
  5. package/dist/__stories__/fixtures/index.d.ts.map +1 -1
  6. package/dist/__stories__/fixtures/shell/app-context-switcher.fixture.d.ts +20 -0
  7. package/dist/__stories__/fixtures/shell/app-context-switcher.fixture.d.ts.map +1 -0
  8. package/dist/base/Command/Command.d.ts +3 -2
  9. package/dist/base/Command/Command.d.ts.map +1 -1
  10. package/dist/code-editor/index.js +1 -1
  11. package/dist/composed/AppContextSwitcher/AppColumn.d.ts +27 -0
  12. package/dist/composed/AppContextSwitcher/AppColumn.d.ts.map +1 -0
  13. package/dist/composed/AppContextSwitcher/AppContextSwitcher.d.ts +18 -0
  14. package/dist/composed/AppContextSwitcher/AppContextSwitcher.d.ts.map +1 -0
  15. package/dist/composed/AppContextSwitcher/AppContextSwitcherTrigger.d.ts +15 -0
  16. package/dist/composed/AppContextSwitcher/AppContextSwitcherTrigger.d.ts.map +1 -0
  17. package/dist/composed/AppContextSwitcher/AppRow.d.ts +14 -0
  18. package/dist/composed/AppContextSwitcher/AppRow.d.ts.map +1 -0
  19. package/dist/composed/AppContextSwitcher/CurrentPageRow.d.ts +15 -0
  20. package/dist/composed/AppContextSwitcher/CurrentPageRow.d.ts.map +1 -0
  21. package/dist/composed/AppContextSwitcher/EntranceRow.d.ts +17 -0
  22. package/dist/composed/AppContextSwitcher/EntranceRow.d.ts.map +1 -0
  23. package/dist/composed/AppContextSwitcher/EnvironmentColumn.d.ts +14 -0
  24. package/dist/composed/AppContextSwitcher/EnvironmentColumn.d.ts.map +1 -0
  25. package/dist/composed/AppContextSwitcher/EnvironmentRow.d.ts +16 -0
  26. package/dist/composed/AppContextSwitcher/EnvironmentRow.d.ts.map +1 -0
  27. package/dist/composed/AppContextSwitcher/appContextSwitcher.types.d.ts +65 -0
  28. package/dist/composed/AppContextSwitcher/appContextSwitcher.types.d.ts.map +1 -0
  29. package/dist/composed/AppContextSwitcher/environmentList.d.ts +17 -0
  30. package/dist/composed/AppContextSwitcher/environmentList.d.ts.map +1 -0
  31. package/dist/composed/AppContextSwitcher/index.d.ts +3 -0
  32. package/dist/composed/AppContextSwitcher/index.d.ts.map +1 -0
  33. package/dist/composed/AppContextSwitcher/panelNavigation.d.ts +28 -0
  34. package/dist/composed/AppContextSwitcher/panelNavigation.d.ts.map +1 -0
  35. package/dist/composed/AppContextSwitcher/use-app-context-switcher.d.ts +43 -0
  36. package/dist/composed/AppContextSwitcher/use-app-context-switcher.d.ts.map +1 -0
  37. package/dist/composed/CodeEditor/CodeEditor.d.ts +6 -1
  38. package/dist/composed/CodeEditor/CodeEditor.d.ts.map +1 -1
  39. package/dist/composed/ContentHeader/ContentHeader.d.ts +1 -1
  40. package/dist/composed/CopyableText/CopyableText.d.ts +3 -1
  41. package/dist/composed/CopyableText/CopyableText.d.ts.map +1 -1
  42. package/dist/composed/DataTableEmptyState/DataTableEmptyState.d.ts +2 -0
  43. package/dist/composed/DataTableEmptyState/DataTableEmptyState.d.ts.map +1 -1
  44. package/dist/composed/ElCheatSheetTrigger/ElCheatSheetTrigger.d.ts +6 -1
  45. package/dist/composed/ElCheatSheetTrigger/ElCheatSheetTrigger.d.ts.map +1 -1
  46. package/dist/composed/ElCheatSheetTrigger/index.d.ts +1 -0
  47. package/dist/composed/ElCheatSheetTrigger/index.d.ts.map +1 -1
  48. package/dist/composed/PageFocused/PageFocused.d.ts +5 -1
  49. package/dist/composed/PageFocused/PageFocused.d.ts.map +1 -1
  50. package/dist/composed/PageHeader/PageHeader.d.ts +3 -1
  51. package/dist/composed/PageHeader/PageHeader.d.ts.map +1 -1
  52. package/dist/composed/PasswordInput/PasswordInput.d.ts +3 -1
  53. package/dist/composed/PasswordInput/PasswordInput.d.ts.map +1 -1
  54. package/dist/composed/SearchField/SearchField.d.ts +3 -1
  55. package/dist/composed/SearchField/SearchField.d.ts.map +1 -1
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +4492 -3935
  59. package/dist/styles/globals.css +1 -1
  60. package/package.json +2 -1
package/USAGE_GUIDE.md CHANGED
@@ -358,9 +358,60 @@ 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, the environments 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 can be searched. With `toHref`, the apps, "Open this page" 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, "Open this page" 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
+ | `onViewAllEnvironments` | `() => void` | No | Adds "View all environments" below the list when the list leaves some out |
379
+ | `maxVisibleEnvironments` | `number` | No | How many environments the list shows without a search, the active and selected ones aside. Defaults to 8. The search looks through all of them |
380
+ | `defaultOpen` | `boolean` | No | Opens the panel on the first render |
381
+ | `onOpenChange` | `(open: boolean) => void` | No | |
382
+
383
+ **`onSelect`** gets one of:
384
+
385
+ - `{ kind: 'app', appKey, environmentKey, keepPage }`: open the app in that environment. `keepPage` is `true` when the user picked "Open this page", on top of the apps of another environment: open the current page there, not the app's home.
386
+ - `{ kind: 'entrance', environmentKey }`: open the entrance. `environmentKey` is the environment selected in the panel, for an entrance that depends on it, such as Home.
387
+
388
+ The panel closes on every pick. Picking the page already shown calls nothing.
389
+
390
+ **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.
391
+
392
+ ```tsx
393
+ <ContentHeader
394
+ leading={slots.leading}
395
+ appContext={
396
+ <AppContextSwitcher
397
+ apps={apps}
398
+ environments={environments}
399
+ entrance={{ key: 'account', label: 'Account Management', icon: <GioProductizeIcon />, contextLabel: accountName }}
400
+ activeAppKey={activeAppKey}
401
+ activeEnvironmentKey={envHrid}
402
+ onSelect={handleSelect}
403
+ toHref={(selection) => (selection.kind === 'app' ? appPath(selection) : '/account')}
404
+ onViewAllEnvironments={() => navigate('/environments')}
405
+ />
406
+ }
407
+ breadcrumbs={slots.breadcrumbs}
408
+ trailing={...}
409
+ />
410
+ ```
411
+
361
412
  ### Breadcrumbs
362
413
 
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**:
414
+ 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
415
 
365
416
  ```tsx
366
417
  /* Good — starts at the page, app name is in AppContextBar */
@@ -383,7 +434,7 @@ If you have not migrated to `AppContextBar` yet, keeping the app name as the fir
383
434
 
384
435
  **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
436
 
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.
437
+ **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
438
 
388
439
  ### `contentVariant` — content width
389
440
 
@@ -1071,18 +1122,38 @@ The platform e2e suite selects elements by `data-testid` only. These are the rul
1071
1122
 
1072
1123
  The components that derive ids from yours. A part exists only when you pass an id and its element is rendered.
1073
1124
 
1074
- | Component | Part | Element |
1075
- | ----------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------- |
1076
- | `FileUploadInput` | `${id}-input` | Hidden file input |
1077
- | `FileUploadInput` | `${id}-trigger` | Trigger button, when `triggerLabel` renders one |
1078
- | `Calendar` | `${id}-previous` | Previous month button |
1079
- | `Calendar` | `${id}-next` | Next month button |
1080
- | `Calendar` | `${id}-day-<yyyy-MM-dd>` | Day button, with `mode` or `onDayClick`; an outside day too, unless another displayed month shows its date |
1081
- | `Calendar` | `${id}-month-<n>` | Month dropdown of the displayed month at position `n` (from 0), with a dropdown `captionLayout` |
1082
- | `Calendar` | `${id}-year-<n>` | Year dropdown of the displayed month at position `n` (from 0), with a dropdown `captionLayout` |
1083
- | `DialogContent` | `${id}-close` | Built-in close button, with `showCloseButton` (the default) |
1084
- | `DialogFooter` | `${id}-close` | Built-in close button, with `showCloseButton` |
1085
- | `SheetContent` | `${id}-close` | Built-in close button, with `showCloseButton` (the default) |
1125
+ | Component | Part | Element |
1126
+ | --------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------- |
1127
+ | `FileUploadInput` | `${id}-input` | Hidden file input |
1128
+ | `FileUploadInput` | `${id}-trigger` | Trigger button, when `triggerLabel` renders one |
1129
+ | `Calendar` | `${id}-previous` | Previous month button |
1130
+ | `Calendar` | `${id}-next` | Next month button |
1131
+ | `Calendar` | `${id}-day-<yyyy-MM-dd>` | Day button, with `mode` or `onDayClick`; an outside day too, unless another displayed month shows its date |
1132
+ | `Calendar` | `${id}-month-<n>` | Month dropdown of the displayed month at position `n` (from 0), with a dropdown `captionLayout` |
1133
+ | `Calendar` | `${id}-year-<n>` | Year dropdown of the displayed month at position `n` (from 0), with a dropdown `captionLayout` |
1134
+ | `DialogContent` | `${id}-close` | Built-in close button, with `showCloseButton` (the default) |
1135
+ | `DialogFooter` | `${id}-close` | Built-in close button, with `showCloseButton` |
1136
+ | `SheetContent` | `${id}-close` | Built-in close button, with `showCloseButton` (the default) |
1137
+ | `PageHeader` | `${id}-title` | Title |
1138
+ | `PageHeader` | `${id}-description` | Description, with `description` |
1139
+ | `DataTableEmptyState` | `${id}-title` | Title, when `title` is not blank |
1140
+ | `DataTableEmptyState` | `${id}-description` | Description, when `description` is not blank |
1141
+ | `PasswordInput` | `${id}-toggle` | Visibility toggle, unless `hideToggle` |
1142
+ | `SearchField` | `${id}-clear` | Clear button, while the field has text |
1143
+ | `CopyableText` | `${id}-value` | Displayed value |
1144
+ | `CopyableText` | `${id}-tooltip` | Tooltip content, while the tooltip is open |
1145
+ | `ElCheatSheetTrigger` | `${id}-content` | Popover content, while the popover is open |
1146
+ | `ElCheatSheetTrigger` | `${id}-copy-<key>` | Copy button of an example: `plan-level`, `path-prefix` or `attribute-lookup` |
1147
+ | `CodeEditor` | `${id}-loading` | Skeleton, while Monaco loads |
1148
+ | `CodeEditor` | `${id}-fallback` | Plain textarea, when Monaco fails to load |
1149
+ | `AppContextSwitcher` | `${id}-content` | Panel content node, inside the portal |
1150
+ | `AppContextSwitcher` | `${id}-search` | Search field, with several environments |
1151
+ | `AppContextSwitcher` | `${id}-clear` | Clear button of the search field, while it has text |
1152
+ | `AppContextSwitcher` | `${id}-entrance` | Entrance row |
1153
+ | `AppContextSwitcher` | `${id}-environment-option-<key>` | Environment row, `EnvironmentDefinition.key` |
1154
+ | `AppContextSwitcher` | `${id}-view-all` | "View all environments" |
1155
+ | `AppContextSwitcher` | `${id}-current-page` | "Open this page", in another environment |
1156
+ | `AppContextSwitcher` | `${id}-app-option-<key>` | App row, `AppDefinition.key` |
1086
1157
 
1087
1158
  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.
1088
1159
 
@@ -185,53 +185,58 @@ function g() {
185
185
  }), () => e.disconnect();
186
186
  }, []), e;
187
187
  }
188
- function _({ value: o, defaultValue: s, onChange: c, language: f = "plaintext", readOnly: p = !1, disabled: _ = !1, height: v, className: y, options: b, onMount: x }) {
189
- let [S, C] = r.useState(() => u() ? { status: "ready" } : { status: "loading" });
188
+ function _({ value: o, defaultValue: s, onChange: c, language: f = "plaintext", readOnly: p = !1, disabled: _ = !1, height: v, className: y, options: b, onMount: x, "data-testid": S }) {
189
+ let [C, w] = r.useState(() => u() ? { status: "ready" } : { status: "loading" });
190
190
  r.useEffect(() => {
191
- if (S.status !== "loading") return;
191
+ if (C.status !== "loading") return;
192
192
  let e = !1;
193
193
  return l().then(() => {
194
- e || C({ status: "ready" });
194
+ e || w({ status: "ready" });
195
195
  }, (t) => {
196
196
  if (e) return;
197
197
  let n = t instanceof Error ? t.message : "Unknown error";
198
- console.error("[CodeEditor] Failed to configure Monaco loader:", t), C({
198
+ console.error("[CodeEditor] Failed to configure Monaco loader:", t), w({
199
199
  status: "error",
200
200
  message: n
201
201
  });
202
202
  }), () => {
203
203
  e = !0;
204
204
  };
205
- }, [S.status]);
206
- let w = g(), T = r.useRef(null), E = r.useRef(null);
205
+ }, [C.status]);
206
+ let T = g(), E = r.useRef(null), D = r.useRef(null);
207
207
  r.useEffect(() => {
208
- T.current && m(T.current);
209
- }, [w]);
210
- let D = r.useCallback((e, t) => {
211
- T.current = t, E.current = e, x?.(e, t);
212
- }, [x]), O = typeof v == "number" ? `${v}px` : v ?? "300px", k = /* @__PURE__ */ i(n, { className: "size-full" });
208
+ E.current && m(E.current);
209
+ }, [T]);
210
+ let O = r.useCallback((e, t) => {
211
+ E.current = t, D.current = e, x?.(e, t);
212
+ }, [x]), k = typeof v == "number" ? `${v}px` : v ?? "300px", A = /* @__PURE__ */ i(n, {
213
+ className: "size-full",
214
+ "data-testid": S ? `${S}-loading` : void 0
215
+ });
213
216
  return /* @__PURE__ */ i("div", {
214
217
  "data-slot": "code-editor",
218
+ "data-testid": S,
215
219
  "data-disabled": _ ? "" : void 0,
216
220
  "data-readonly": p && !_ ? "" : void 0,
217
221
  className: t("overflow-hidden rounded-lg border border-input bg-background", "data-disabled:pointer-events-none data-disabled:opacity-50", "data-readonly:bg-muted/30", y),
218
- style: { height: O },
219
- children: S.status === "error" ? /* @__PURE__ */ i(e, {
222
+ style: { height: k },
223
+ children: C.status === "error" ? /* @__PURE__ */ i(e, {
220
224
  value: o ?? "",
221
225
  onChange: (e) => c?.(e.target.value),
222
226
  readOnly: p || _,
223
227
  spellCheck: !1,
228
+ "data-testid": S ? `${S}-fallback` : void 0,
224
229
  className: "size-full resize-none rounded-none border-0 p-3 font-mono text-xs focus-visible:ring-0"
225
- }) : S.status === "ready" ? /* @__PURE__ */ i(a, {
230
+ }) : C.status === "ready" ? /* @__PURE__ */ i(a, {
226
231
  height: "100%",
227
232
  language: f,
228
233
  value: o,
229
234
  defaultValue: s,
230
235
  theme: d,
231
236
  onChange: c,
232
- onMount: D,
237
+ onMount: O,
233
238
  beforeMount: h,
234
- loading: k,
239
+ loading: A,
235
240
  options: {
236
241
  readOnly: p || _,
237
242
  minimap: { enabled: !1 },
@@ -254,7 +259,7 @@ function _({ value: o, defaultValue: s, onChange: c, language: f = "plaintext",
254
259
  fixedOverflowWidgets: !0,
255
260
  ...b
256
261
  }
257
- }) : k
262
+ }) : A
258
263
  });
259
264
  }
260
265
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { a as e, g as t, h as n, l as r, p as i, r as a, s as o, t as s, v as c } from "./SchemaBanner-B4C-TVbq.js";
2
- import { t as l } from "./CodeEditor-W9JPCQhc.js";
2
+ import { t as l } from "./CodeEditor-C44Pe2i6.js";
3
3
  import { useEffect as u, useRef as d, useState as f } from "react";
4
4
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
5
5
  //#region src/composed/JsonSchemaForm/fields/code-editor/CodeEditorField.tsx
@@ -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,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gCAAgC,EAChC,0BAA0B,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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__stories__/fixtures/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C,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,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gCAAgC,EAChC,0BAA0B,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
+ /** More environments than the panel lists, so the search and "View all environments" take over. */
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,mGAAmG;AACnG,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"}
@@ -8,12 +8,13 @@ declare function CommandDialog({ title, description, children, className, showCl
8
8
  className?: string;
9
9
  showCloseButton?: boolean;
10
10
  }): React.JSX.Element;
11
- declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
11
+ /** `children` land in the group after the input: a trailing addon, such as a clear button. */
12
+ declare function CommandInput({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
12
13
  declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
13
14
  declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
14
15
  declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
15
16
  declare function CommandSeparator({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
16
- declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
17
+ declare function CommandItem({ className, children, asChild, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
17
18
  declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
18
19
  export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, };
19
20
  //# 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,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,e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ACR,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAgCpD;AAED,iBAAS,eAAe,CAAC,EAAE,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"}
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "../CodeEditor-W9JPCQhc.js";
1
+ import { n as e, t } from "../CodeEditor-C44Pe2i6.js";
2
2
  export { t as CodeEditor, e as setupCodeEditor };
@@ -0,0 +1,27 @@
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
+ /** While another environment than the active one is shown: the active app, whose page a row on top opens there. */
12
+ readonly currentPage?: {
13
+ readonly app: AppDefinition;
14
+ readonly href?: string;
15
+ readonly onSelect: () => void;
16
+ };
17
+ readonly hrefOf?: (appKey: string) => string | undefined;
18
+ readonly onSelect: (key: string) => void;
19
+ readonly partTestId: (part: string) => string | undefined;
20
+ }
21
+ /**
22
+ * The apps of the selected environment: a column next to the environments, or under them in a narrow panel, or tiles
23
+ * on their own.
24
+ */
25
+ declare function AppColumn({ ref, apps, activeAppKey, inActiveEnvironment, environmentLabel, currentPage, hrefOf, onSelect, partTestId, }: AppColumnProps): import("react").JSX.Element;
26
+ export { AppColumn };
27
+ //# sourceMappingURL=AppColumn.d.ts.map
@@ -0,0 +1 @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cherProps } 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, onViewAllEnvironments, maxVisibleEnvironments, 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,qBAAqB,EACrB,sBAA0B,EAC1B,WAAmB,EACnB,YAAY,EACZ,SAAS,EACT,aAAa,EAAE,MAAM,GACtB,EAAE,uBAAuB,+BAyQzB;kBAvRQ,kBAAkB;;;AA2R3B,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,+BAmCzF;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { AppDefinition } from '../AppSwitcher';
2
+ interface CurrentPageRowProps {
3
+ /** The active app: the page shown is one of its pages. */
4
+ readonly app: AppDefinition;
5
+ readonly href?: string;
6
+ readonly onSelect: () => void;
7
+ readonly 'data-testid'?: string;
8
+ }
9
+ /**
10
+ * Tops the apps of another environment: opens the page shown there, where the app's own row opens its root. The
11
+ * heading of the group names the environment, so the row does not repeat it.
12
+ */
13
+ declare function CurrentPageRow({ app, href, onSelect, 'data-testid': testId }: CurrentPageRowProps): import("react").JSX.Element;
14
+ export { CurrentPageRow };
15
+ //# sourceMappingURL=CurrentPageRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrentPageRow.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextSwitcher/CurrentPageRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAMlF,UAAU,mBAAmB;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,aAAa,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,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BAiB1F;AAED,OAAO,EAAE,cAAc,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,14 @@
1
+ import { EnvironmentDefinition } from './appContextSwitcher.types';
2
+ interface EnvironmentColumnProps {
3
+ readonly environments: readonly EnvironmentDefinition[];
4
+ readonly selectedKey: string;
5
+ readonly activeKey: string;
6
+ readonly showViewAll: boolean;
7
+ readonly onSelect: (key: string) => void;
8
+ readonly onViewAll: () => void;
9
+ readonly partTestId: (part: string) => string | undefined;
10
+ }
11
+ /** The left column: the listed environments, then "View all environments" when some are left out. */
12
+ declare function EnvironmentColumn({ environments, selectedKey, activeKey, showViewAll, onSelect, onViewAll, partTestId, }: EnvironmentColumnProps): import("react").JSX.Element;
13
+ export { EnvironmentColumn };
14
+ //# 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;AAGxE,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,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC3D;AAED,qGAAqG;AACrG,iBAAS,iBAAiB,CAAC,EACzB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACT,UAAU,GACX,EAAE,sBAAsB,+BA6BxB;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,65 @@
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
+ /** Picked from "Open this page": open the current page in that environment, not the app's root. */
31
+ readonly keepPage: boolean;
32
+ } | {
33
+ readonly kind: 'entrance';
34
+ /** The environment selected in the panel, for an entrance that depends on it, such as Home. */
35
+ readonly environmentKey: string;
36
+ };
37
+ interface AppContextSwitcherProps {
38
+ /** The apps of an environment. `pinned` and `href` are ignored. */
39
+ readonly apps: readonly AppDefinition[];
40
+ readonly environments: readonly EnvironmentDefinition[];
41
+ readonly entrance?: EntranceDefinition;
42
+ /** The active app, or the entrance key while the entrance is the active page. */
43
+ readonly activeAppKey: string;
44
+ readonly activeEnvironmentKey: string;
45
+ /** Called when an app or the entrance is picked, except for the page already shown. The panel closes either way. */
46
+ readonly onSelect: (selection: AppContextSwitcherSelection) => void;
47
+ /**
48
+ * The URL of a selection: makes the apps, "Open this page" and the entrance real links, so that they open in a new
49
+ * tab on cmd/ctrl-click, middle-click or cmd/ctrl/shift+Enter. A plain click or Enter still goes through `onSelect`.
50
+ */
51
+ readonly toHref?: (selection: AppContextSwitcherSelection) => string | undefined;
52
+ /** Adds "View all environments" below the list when there are more environments than it shows. */
53
+ readonly onViewAllEnvironments?: () => void;
54
+ /** How many environments the list shows without a search, the active and selected ones aside. Defaults to 8. */
55
+ readonly maxVisibleEnvironments?: number;
56
+ /** Opens the panel on the first render. */
57
+ readonly defaultOpen?: boolean;
58
+ readonly onOpenChange?: (open: boolean) => void;
59
+ /** Applied to the trigger. */
60
+ readonly className?: string;
61
+ /** Lands on the trigger. The parts the panel renders derive their ids from it. */
62
+ readonly 'data-testid'?: string;
63
+ }
64
+ export type { AppContextSwitcherProps, AppContextSwitcherSelection, EntranceDefinition, EnvironmentDefinition };
65
+ //# 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,CA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AM,IAAI,CAAC;IAC5C,gHAAgH;IAChH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC,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,17 @@
1
+ import { EnvironmentDefinition } from './appContextSwitcher.types';
2
+ interface EnvironmentListOptions {
3
+ readonly environments: readonly EnvironmentDefinition[];
4
+ readonly query: string;
5
+ readonly maxVisible: number;
6
+ /** Environments listed even past the limit: the active one and the one whose apps are shown. */
7
+ readonly keepVisible: readonly string[];
8
+ }
9
+ /**
10
+ * The environments the panel lists. Without a query, the first `maxVisible` ones, plus the kept ones when they fall
11
+ * past the limit, so the user always sees where they are. With a query, every environment whose label contains it,
12
+ * whatever the limit.
13
+ */
14
+ declare function listEnvironments({ environments, query, maxVisible, keepVisible, }: EnvironmentListOptions): EnvironmentDefinition[];
15
+ export { listEnvironments };
16
+ export type { EnvironmentListOptions };
17
+ //# 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,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,YAAY,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,gGAAgG;IAChG,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAOD;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,EACxB,YAAY,EACZ,KAAK,EACL,UAAU,EACV,WAAW,GACZ,EAAE,sBAAsB,GAAG,qBAAqB,EAAE,CAQlD;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,sBAAsB,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"}