@gravitee/graphene-core 3.53.1 → 3.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/USAGE_GUIDE.md CHANGED
@@ -1159,6 +1159,20 @@ The components that derive ids from yours. A part exists only when you pass an i
1159
1159
  | `SidebarNavigation` | `${id}-nav-<item.key>` | Item link, with an `href`, or button, locked or without one; `item.key` verbatim, unique across the whole navigation |
1160
1160
  | `ContextSidebar` | `${id}-nav-<item.key>` | Navigation item, with `groups`: the navigation takes the sidebar's own id; its parts are those of `SidebarNavigation` |
1161
1161
  | `SidebarUpgradeFooter` | `${id}-action` | Upgrade link, while `lockedFeatures` is not empty |
1162
+ | `ContentHeader` | `${id}-breadcrumb-<index>` | Crumb link, button (`onClick` without `href`) or current page `span`, not its `li`; _positional_, from 0 |
1163
+ | `AppContextBar` | `${id}-app-trigger` | App trigger button |
1164
+ | `AppContextBar` | `${id}-app` | App menu, a prefix only; its parts are those of `AppSwitcher`: `${id}-app-content`, `${id}-app-option-<app.key>` |
1165
+ | `AppContextBar` | `${id}-environment-trigger` | Environment trigger button, with `environments` |
1166
+ | `AppContextBar` | `${id}-environment` | Environment menu, with `environments`, a prefix only; its parts are those of `SelectorDropdown`: `${id}-environment-content`, `${id}-environment-option-<key>` |
1167
+ | `AppSwitcher` | `${id}-content` | Menu content, while the menu is open |
1168
+ | `AppSwitcher` | `${id}-option-<app.key>` | App link, with an `href`, or menu item, while the menu is open; `app.key` verbatim |
1169
+ | `SelectorDropdown` | `${id}-content` | Menu content, while the menu is open |
1170
+ | `SelectorDropdown` | `${id}-option-<option.key>` | Option link, with an `href`, or menu item, while the menu is open; `option.key` verbatim |
1171
+ | `TopNavUser` | `${id}-content` | Menu content, while the menu is open |
1172
+ | `TopNavUser` | `${id}-name` | User name, while the menu is open |
1173
+ | `TopNavUser` | `${id}-email` | User email, with `email`, while the menu is open |
1174
+ | `TopNavUser` | `${id}-theme-option-<value>` | Theme item (`light`, `dark`, `system`), while the menu is open |
1175
+ | `TopNavUser` | `${id}-sign-out` | Sign out item, while the menu is open |
1162
1176
  | `CodeEditor` | `${id}-loading` | Skeleton, while Monaco loads |
1163
1177
  | `CodeEditor` | `${id}-fallback` | Plain textarea, when Monaco fails to load |
1164
1178
  | `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 |
@@ -1175,7 +1189,7 @@ The components that derive ids from yours. A part exists only when you pass an i
1175
1189
 
1176
1190
  `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`.
1177
1191
 
1178
- `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.
1192
+ `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>`. `AppSwitcher` and `SelectorDropdown` render no element of their own either: their trigger is the one you pass, which keeps its own id, and their id only prefixes their menu content and options. 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` and `AppContextBar` on the `AppLayout` page, `SelectorTriggerButton` on the `SelectorDropdown` page.
1179
1193
 
1180
1194
  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.
1181
1195
 
@@ -1,6 +1,13 @@
1
1
  import { AppDefinition } from '../AppSwitcher';
2
2
  import { SelectorOption } from '../SelectorDropdown';
3
3
  interface AppContextBarProps {
4
+ /**
5
+ * Lands on the root `<div>`. App trigger: `${id}-app-trigger`; while its menu is open, the menu `${id}-app-content`
6
+ * and each app `${id}-app-option-<app.key>`, as in `AppSwitcher`. With `environments`, the environment trigger
7
+ * `${id}-environment-trigger`; while its menu is open, the menu `${id}-environment-content` and each environment
8
+ * `${id}-environment-option-<key>`, as in `SelectorDropdown`.
9
+ */
10
+ readonly 'data-testid'?: string;
4
11
  readonly apps: AppDefinition[];
5
12
  readonly activeAppKey: string;
6
13
  readonly onAppChange?: (key: string) => void;
@@ -9,7 +16,7 @@ interface AppContextBarProps {
9
16
  readonly onEnvironmentChange?: (key: string) => void;
10
17
  readonly className?: string;
11
18
  }
12
- declare function AppContextBar({ apps, activeAppKey, onAppChange, environments, activeEnvironmentKey, onEnvironmentChange, className, }: AppContextBarProps): import("react").JSX.Element;
19
+ declare function AppContextBar({ apps, activeAppKey, onAppChange, environments, activeEnvironmentKey, onEnvironmentChange, className, 'data-testid': testId, }: AppContextBarProps): import("react").JSX.Element;
13
20
  declare namespace AppContextBar {
14
21
  var displayName: string;
15
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppContextBar.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextBar/AppContextBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AAIxF,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;IACzC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAErD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,iBAAS,aAAa,CAAC,EACrB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,GACV,EAAE,kBAAkB,+BAgDpB;kBAxDQ,aAAa;;;AA4DtB,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"AppContextBar.d.ts","sourceRoot":"","sources":["../../../src/composed/AppContextBar/AppContextBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AAKxF,UAAU,kBAAkB;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAE7C,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;IACzC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAErD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,iBAAS,aAAa,CAAC,EACrB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,aAAa,EAAE,MAAM,GACtB,EAAE,kBAAkB,+BA6DpB;kBAtEQ,aAAa;;;AA0EtB,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  interface AppDefinition {
3
+ /** A stable key, never a label. Used verbatim as the test id key (`${id}-option-<key>`). */
3
4
  readonly key: string;
4
5
  readonly label: string;
5
6
  readonly description?: string;
@@ -19,6 +20,11 @@ interface AppDefinition {
19
20
  readonly href?: string;
20
21
  }
21
22
  interface AppSwitcherProps {
23
+ /**
24
+ * No element of its own: the trigger is `children`, which keeps its own id. The id prefixes the parts the switcher
25
+ * renders while its menu is open: the menu content `${id}-content` and each app `${id}-option-<app.key>`.
26
+ */
27
+ readonly 'data-testid'?: string;
22
28
  readonly apps: AppDefinition[];
23
29
  readonly activeKey: string;
24
30
  readonly onChange?: (key: string) => void;
@@ -28,7 +34,7 @@ interface AppSwitcherProps {
28
34
  readonly contentClassName?: string;
29
35
  readonly children?: ReactNode;
30
36
  }
31
- declare function AppSwitcher({ apps, activeKey, onChange, onOpenChange, side, contentClassName, children }: AppSwitcherProps): import("react").JSX.Element;
37
+ declare function AppSwitcher({ apps, activeKey, onChange, onOpenChange, side, contentClassName, children, 'data-testid': testId, }: AppSwitcherProps): import("react").JSX.Element;
32
38
  declare namespace AppSwitcher {
33
39
  var displayName: string;
34
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppSwitcher.d.ts","sourceRoot":"","sources":["../../../src/composed/AppSwitcher/AppSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvC,UAAU,aAAa;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACpD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAiDD,iBAAS,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,gBAAg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,EACR,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,aAAa,EAAE,MAAM,GACtB,EAAE,gBAAgB,+BAkClB;kBA3CQ,WAAW;;;AA+CpB,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BreadcrumbEntry } from './breadcrumb-entry';
3
3
  interface ContentHeaderProps {
4
+ /**
5
+ * Lands on the root `div[data-slot=content-header]`. Each crumb: `${id}-breadcrumb-<index>`, positional from 0, on
6
+ * its link, button or current page `span` (not the `li`). `leading`, `appContext` and `trailing` keep their own ids.
7
+ */
8
+ readonly 'data-testid'?: string;
4
9
  readonly className?: string;
5
10
  readonly breadcrumbs?: BreadcrumbEntry[];
6
11
  /** Leading icon (e.g. context sidebar toggle). Only rendered when provided. */
@@ -13,7 +18,7 @@ interface ContentHeaderProps {
13
18
  /** Right-aligned content (e.g. search, user avatar, notifications). */
14
19
  readonly trailing?: ReactNode;
15
20
  }
16
- declare function ContentHeader({ className, breadcrumbs, leading, appContext, trailing }: ContentHeaderProps): import("react").JSX.Element;
21
+ declare function ContentHeader({ className, breadcrumbs, leading, appContext, trailing, 'data-testid': testId, }: ContentHeaderProps): import("react").JSX.Element;
17
22
  declare namespace ContentHeader {
18
23
  var displayName: string;
19
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentHeader.d.ts","sourceRoot":"","sources":["../../../src/composed/ContentHeader/ContentHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IACzC,+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aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC;AACnC,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
2
  interface SelectorOption {
3
+ /** A stable key, never a label. Used verbatim as the test id key (`${id}-option-<key>`). */
3
4
  readonly key: string;
4
5
  readonly label: string;
5
6
  readonly icon?: ReactNode;
@@ -15,6 +16,12 @@ interface SelectorTriggerRenderContext {
15
16
  readonly activeKey: string;
16
17
  }
17
18
  interface SelectorDropdownBaseProps {
19
+ /**
20
+ * No element of its own: the trigger (`children` or `renderTrigger`) keeps its own id. The id prefixes the parts the
21
+ * dropdown renders while its menu is open: the menu content `${id}-content` and each option
22
+ * `${id}-option-<option.key>`.
23
+ */
24
+ readonly 'data-testid'?: string;
18
25
  readonly options: SelectorOption[];
19
26
  readonly activeKey: string;
20
27
  readonly onChange?: (key: string) => void;
@@ -31,7 +38,7 @@ type SelectorDropdownProps = SelectorDropdownBaseProps & ({
31
38
  readonly renderTrigger: (ctx: SelectorTriggerRenderContext) => ReactElement;
32
39
  readonly children?: never;
33
40
  });
34
- declare function SelectorDropdown({ options, activeKey, onChange, onOpenChange, align, side, className, children, renderTrigger, }: SelectorDropdownProps): import("react").JSX.Element;
41
+ declare function SelectorDropdown({ options, activeKey, onChange, onOpenChange, align, side, className, children, renderTrigger, 'data-testid': testId, }: SelectorDropdownProps): import("react").JSX.Element;
35
42
  declare namespace SelectorDropdown {
36
43
  var displayName: string;
37
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectorDropdown.d.ts","sourceRoot":"","sources":["../../../src/composed/SelectorDropdown/SelectorDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWrD,UAAU,cAAc;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,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AC7B;AAED,KAAK,qBAAqB,GAAG,yBAAyB,GACpD,CACI;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,GAChE;IACE,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,4BAA4B,KAAK,YAAY,CAAC;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;CAC3B,CACJ,CAAC;AAEJ,iBAAS,gBAAgB,CAAC,EACxB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,KAAe,EACf,IAAe,EACf,SAAS,EACT,QAAQ,EACR,aAAa,EACb,aAAa,EAAE,MAAM,GACtB,EAAE,qBAAqB,+BAwCvB;kBAnDQ,gBAAgB;;;AAuDzB,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,4BAA4B,EAAE,CAAC"}
@@ -2,6 +2,8 @@ import { ComponentProps } from 'react';
2
2
  import { Button } from '../../base/Button';
3
3
  import { SelectorOption } from './SelectorDropdown';
4
4
  interface SelectorTriggerButtonProps extends Omit<ComponentProps<typeof Button>, 'children'> {
5
+ /** Lands on its `<button>`. */
6
+ readonly 'data-testid'?: string;
5
7
  /** Resolved from `SelectorDropdown` via `renderTrigger`, or pass manually when used with `children`. */
6
8
  readonly activeOption: SelectorOption | undefined;
7
9
  /** Shown when there is no matching option. */
@@ -1 +1 @@
1
- {"version":3,"file":"SelectorTriggerButton.d.ts","sourceRoot":"","sources":["../../../src/composed/SelectorDropdown/SelectorTriggerButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,UAAU,0BAA2B,SAAQ,I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,10 @@
1
1
  interface TopNavUserProps {
2
+ /**
3
+ * Lands on the trigger `<button>`. While the menu is open: the menu content `${id}-content`; the name `${id}-name`
4
+ * and, with `email`, the email `${id}-email`; each theme `${id}-theme-option-<value>` (`light`, `dark`,
5
+ * `system`); the sign out item `${id}-sign-out`.
6
+ */
7
+ readonly 'data-testid'?: string;
2
8
  readonly name: string;
3
9
  readonly email?: string;
4
10
  readonly avatarUrl?: string;
@@ -6,7 +12,7 @@ interface TopNavUserProps {
6
12
  readonly className?: string;
7
13
  readonly onSignOut?: () => void;
8
14
  }
9
- declare function TopNavUser({ name, email, avatarUrl, initials, className, onSignOut }: TopNavUserProps): import("react").JSX.Element;
15
+ declare function TopNavUser({ name, email, avatarUrl, initials, className, onSignOut, 'data-testid': testId, }: TopNavUserProps): import("react").JSX.Element;
10
16
  declare namespace TopNavUser {
11
17
  var displayName: string;
12
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TopNavUser.d.ts","sourceRoot":"","sources":["../../../src/composed/TopNavUser/TopNavUser.tsx"],"names":[],"mappings":"AAcA,UAAU,eAAe;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAQD,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,eAAe,+BAyC9F;kBAzCQ,UAAU;;;AA6CnB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"TopNavUser.d.ts","sourceRoot":"","sources":["../../../src/composed/TopNavUser/TopNavUser.tsx"],"names":[],"mappings":"AAeA,UAAU,eAAe;IACvB;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAQD,iBAAS,UAAU,CAAC,EAClB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EAAE,MAAM,GACtB,EAAE,eAAe,+BAoDjB;kBA5DQ,UAAU;;;AAgEnB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -24902,20 +24902,21 @@ function jW({ href: e, fallback: t = "button", followHref: n = !1, menuItem: r =
24902
24902
  }
24903
24903
  //#endregion
24904
24904
  //#region src/composed/AppSwitcher/AppSwitcher.tsx
24905
- function MW({ app: e, isActive: n, followHref: r, onSelect: i }) {
24906
- let a = e.pinned === !0;
24905
+ function MW({ app: e, isActive: n, followHref: r, onSelect: i, "data-testid": a }) {
24906
+ let o = e.pinned === !0;
24907
24907
  return /* @__PURE__ */ U(TL, {
24908
24908
  asChild: !0,
24909
24909
  onSelect: i,
24910
- className: t("cursor-pointer gap-2.5 rounded-lg px-2", a ? "py-1.5" : "py-2", n ? "bg-accent" : "focus:bg-muted/50 focus:text-foreground"),
24910
+ className: t("cursor-pointer gap-2.5 rounded-lg px-2", o ? "py-1.5" : "py-2", n ? "bg-accent" : "focus:bg-muted/50 focus:text-foreground"),
24911
24911
  "aria-current": n ? "true" : void 0,
24912
+ "data-testid": a,
24912
24913
  children: /* @__PURE__ */ W(jW, {
24913
24914
  href: e.href,
24914
24915
  fallback: "div",
24915
24916
  followHref: r,
24916
24917
  menuItem: !0,
24917
24918
  children: [/* @__PURE__ */ U("span", {
24918
- className: t("flex shrink-0 items-center justify-center [&_svg]:size-5", a ? "h-5 w-8" : "size-8 rounded-md bg-muted/50"),
24919
+ className: t("flex shrink-0 items-center justify-center [&_svg]:size-5", o ? "h-5 w-8" : "size-8 rounded-md bg-muted/50"),
24919
24920
  "aria-hidden": "true",
24920
24921
  children: e.icon
24921
24922
  }), /* @__PURE__ */ W("div", {
@@ -24923,7 +24924,7 @@ function MW({ app: e, isActive: n, followHref: r, onSelect: i }) {
24923
24924
  children: [/* @__PURE__ */ U("span", {
24924
24925
  className: t("truncate text-sm", n ? "font-semibold" : "font-medium"),
24925
24926
  children: e.label
24926
- }), !a && e.description && /* @__PURE__ */ U("span", {
24927
+ }), !o && e.description && /* @__PURE__ */ U("span", {
24927
24928
  className: "truncate text-xs text-muted-foreground",
24928
24929
  children: e.description
24929
24930
  })]
@@ -24931,14 +24932,15 @@ function MW({ app: e, isActive: n, followHref: r, onSelect: i }) {
24931
24932
  })
24932
24933
  });
24933
24934
  }
24934
- function NW({ apps: e, activeKey: n, onChange: r, onOpenChange: i, side: a, contentClassName: o, children: s }) {
24935
- let c = QH(), l = e.filter((e) => e.pinned), u = e.filter((e) => !e.pinned), d = (e) => /* @__PURE__ */ U(MW, {
24935
+ function NW({ apps: e, activeKey: n, onChange: r, onOpenChange: i, side: a, contentClassName: o, children: s, "data-testid": c }) {
24936
+ let l = QH(), u = e.filter((e) => e.pinned), d = e.filter((e) => !e.pinned), f = (e) => /* @__PURE__ */ U(MW, {
24936
24937
  app: e,
24937
24938
  isActive: e.key === n,
24938
24939
  followHref: r === void 0 && e.key !== n,
24939
24940
  onSelect: () => {
24940
24941
  e.key !== n && r?.(e.key);
24941
- }
24942
+ },
24943
+ "data-testid": J(c, `option-${e.key}`)
24942
24944
  }, e.key);
24943
24945
  return /* @__PURE__ */ W(bL, {
24944
24946
  onOpenChange: i,
@@ -24946,18 +24948,19 @@ function NW({ apps: e, activeKey: n, onChange: r, onOpenChange: i, side: a, cont
24946
24948
  asChild: !0,
24947
24949
  children: s
24948
24950
  }), /* @__PURE__ */ W(CL, {
24949
- side: a ?? (c ? "bottom" : "right"),
24951
+ side: a ?? (l ? "bottom" : "right"),
24950
24952
  align: "start",
24951
24953
  className: t("w-[34rem] max-w-[calc(100vw-1rem)] p-1", o),
24954
+ "data-testid": J(c, "content"),
24952
24955
  children: [
24953
- l.length > 0 && /* @__PURE__ */ U("div", {
24956
+ u.length > 0 && /* @__PURE__ */ U("div", {
24954
24957
  className: "grid gap-0.5",
24955
- children: l.map(d)
24958
+ children: u.map(f)
24956
24959
  }),
24957
- l.length > 0 && u.length > 0 && /* @__PURE__ */ U(AL, {}),
24958
- u.length > 0 && /* @__PURE__ */ U("div", {
24960
+ u.length > 0 && d.length > 0 && /* @__PURE__ */ U(AL, {}),
24961
+ d.length > 0 && /* @__PURE__ */ U("div", {
24959
24962
  className: "grid grid-cols-2 gap-0.5",
24960
- children: u.map(d)
24963
+ children: d.map(f)
24961
24964
  })
24962
24965
  ]
24963
24966
  })]
@@ -24966,25 +24969,27 @@ function NW({ apps: e, activeKey: n, onChange: r, onOpenChange: i, side: a, cont
24966
24969
  NW.displayName = "AppSwitcher";
24967
24970
  //#endregion
24968
24971
  //#region src/composed/SelectorDropdown/SelectorDropdown.tsx
24969
- function PW({ options: e, activeKey: n, onChange: r, onOpenChange: i, align: a = "start", side: o = "bottom", className: s, children: c, renderTrigger: l }) {
24970
- let u = e.find((e) => e.key === n);
24972
+ function PW({ options: e, activeKey: n, onChange: r, onOpenChange: i, align: a = "start", side: o = "bottom", className: s, children: c, renderTrigger: l, "data-testid": u }) {
24973
+ let d = e.find((e) => e.key === n);
24971
24974
  return /* @__PURE__ */ W(bL, {
24972
24975
  onOpenChange: i,
24973
24976
  children: [/* @__PURE__ */ U(SL, {
24974
24977
  asChild: !0,
24975
24978
  children: l ? l({
24976
- activeOption: u,
24979
+ activeOption: d,
24977
24980
  activeKey: n
24978
24981
  }) : c
24979
24982
  }), /* @__PURE__ */ U(CL, {
24980
24983
  align: a,
24981
24984
  side: o,
24982
24985
  className: t("min-w-48", s),
24986
+ "data-testid": J(u, "content"),
24983
24987
  children: e.map((e) => /* @__PURE__ */ U(TL, {
24984
24988
  asChild: !0,
24985
24989
  className: t("gap-2", e.key === n && "font-medium", e.href && "cursor-pointer"),
24986
24990
  onSelect: () => r?.(e.key),
24987
24991
  "aria-current": e.key === n ? "true" : void 0,
24992
+ "data-testid": J(u, `option-${e.key}`),
24988
24993
  children: /* @__PURE__ */ W(jW, {
24989
24994
  href: e.href,
24990
24995
  fallback: "div",
@@ -25022,49 +25027,54 @@ function FW({ activeOption: e, emptyLabel: n = "Select...", className: r, ...i }
25022
25027
  FW.displayName = "SelectorTriggerButton";
25023
25028
  //#endregion
25024
25029
  //#region src/composed/AppContextBar/AppContextBar.tsx
25025
- function IW({ apps: e, activeAppKey: n, onAppChange: r, environments: i, activeEnvironmentKey: a, onEnvironmentChange: o, className: s }) {
25026
- let c = e.find((e) => e.key === n), l = i && i.length > 0, u = a ?? i?.[0]?.key ?? "", d = i?.find((e) => e.key === u);
25030
+ function IW({ apps: e, activeAppKey: n, onAppChange: r, environments: i, activeEnvironmentKey: a, onEnvironmentChange: o, className: s, "data-testid": c }) {
25031
+ let l = e.find((e) => e.key === n), u = i && i.length > 0, d = a ?? i?.[0]?.key ?? "", f = i?.find((e) => e.key === d);
25027
25032
  return /* @__PURE__ */ W("div", {
25028
25033
  className: t("flex items-center gap-0.5", s),
25034
+ "data-testid": c,
25029
25035
  children: [/* @__PURE__ */ U(NW, {
25030
25036
  apps: e,
25031
25037
  activeKey: n,
25032
25038
  onChange: r,
25033
25039
  side: "bottom",
25040
+ "data-testid": J(c, "app"),
25034
25041
  children: /* @__PURE__ */ W(ay, {
25035
25042
  variant: "ghost",
25036
25043
  size: "sm",
25037
25044
  className: "gap-1.5 px-1.5 font-semibold data-open:bg-accent data-open:text-accent-foreground",
25045
+ "data-testid": J(c, "app-trigger"),
25038
25046
  children: [
25039
25047
  /* @__PURE__ */ U("span", {
25040
25048
  className: "flex size-5 shrink-0 items-center justify-center [&_svg]:size-5",
25041
- children: c?.icon
25049
+ children: l?.icon
25042
25050
  }),
25043
25051
  /* @__PURE__ */ U("span", {
25044
25052
  className: "max-w-48 truncate text-sm",
25045
- children: c?.label ?? "Select app"
25053
+ children: l?.label ?? "Select app"
25046
25054
  }),
25047
25055
  /* @__PURE__ */ U(le, { className: "size-3 shrink-0 opacity-50" })
25048
25056
  ]
25049
25057
  })
25050
- }), l && /* @__PURE__ */ U(PW, {
25058
+ }), u && /* @__PURE__ */ U(PW, {
25051
25059
  options: i,
25052
- activeKey: u,
25060
+ activeKey: d,
25053
25061
  onChange: o,
25054
25062
  side: "bottom",
25055
25063
  align: "start",
25064
+ "data-testid": J(c, "environment"),
25056
25065
  children: /* @__PURE__ */ W(ay, {
25057
25066
  variant: "ghost",
25058
25067
  size: "sm",
25059
25068
  className: "gap-1 px-1.5 text-xs font-medium text-muted-foreground",
25060
- title: d?.label,
25061
- "aria-label": `Switch environment (current: ${d?.label})`,
25069
+ title: f?.label,
25070
+ "aria-label": f ? `Switch environment (current: ${f.label})` : void 0,
25071
+ "data-testid": J(c, "environment-trigger"),
25062
25072
  children: [
25063
25073
  /* @__PURE__ */ U("span", {
25064
25074
  className: "size-1.5 rounded-full bg-foreground/30",
25065
25075
  "aria-hidden": !0
25066
25076
  }),
25067
- d?.label,
25077
+ f?.label ?? "Select environment",
25068
25078
  /* @__PURE__ */ U(le, { className: "size-3 shrink-0 opacity-50" })
25069
25079
  ]
25070
25080
  })
@@ -25436,36 +25446,43 @@ function tG(e) {
25436
25446
  }
25437
25447
  //#endregion
25438
25448
  //#region src/composed/ContentHeader/ContentHeader.tsx
25439
- function nG({ crumb: e, isLast: t }) {
25440
- return t ? /* @__PURE__ */ U(ty, { children: e.label }) : e.onClick ? /* @__PURE__ */ U(ey, {
25449
+ function nG({ crumb: e, isLast: t, "data-testid": n }) {
25450
+ return t ? /* @__PURE__ */ U(ty, {
25451
+ "data-testid": n,
25452
+ children: e.label
25453
+ }) : e.onClick ? /* @__PURE__ */ U(ey, {
25441
25454
  asChild: !0,
25442
25455
  children: /* @__PURE__ */ U(jW, {
25443
25456
  href: e.href,
25444
25457
  onClick: e.onClick,
25458
+ "data-testid": n,
25445
25459
  children: e.label
25446
25460
  })
25447
25461
  }) : /* @__PURE__ */ U(ey, {
25448
25462
  href: e.href,
25463
+ "data-testid": n,
25449
25464
  children: e.label
25450
25465
  });
25451
25466
  }
25452
- function rG({ className: e, breadcrumbs: n = [], leading: r, appContext: i, trailing: a }) {
25453
- let o = n.length > 0;
25467
+ function rG({ className: e, breadcrumbs: n = [], leading: r, appContext: i, trailing: a, "data-testid": o }) {
25468
+ let s = n.length > 0;
25454
25469
  return /* @__PURE__ */ W("div", {
25455
25470
  "data-slot": "content-header",
25456
25471
  className: t("flex items-center gap-2 border-b px-4 py-2", e),
25472
+ "data-testid": o,
25457
25473
  children: [
25458
25474
  r,
25459
25475
  i,
25460
- i && o && /* @__PURE__ */ U(g, {
25476
+ i && s && /* @__PURE__ */ U(g, {
25461
25477
  orientation: "vertical",
25462
25478
  className: "my-1"
25463
25479
  }),
25464
- o && /* @__PURE__ */ U(Zv, { children: /* @__PURE__ */ U(Qv, { children: n.map((e, t) => {
25480
+ s && /* @__PURE__ */ U(Zv, { children: /* @__PURE__ */ U(Qv, { children: n.map((e, t) => {
25465
25481
  let r = t === n.length - 1;
25466
25482
  return /* @__PURE__ */ W(Pe, { children: [/* @__PURE__ */ U($v, { children: /* @__PURE__ */ U(nG, {
25467
25483
  crumb: e,
25468
- isLast: r
25484
+ isLast: r,
25485
+ "data-testid": J(o, `breadcrumb-${t}`)
25469
25486
  }) }), !r && /* @__PURE__ */ U(ny, {})] }, t);
25470
25487
  }) }) }),
25471
25488
  /* @__PURE__ */ U("div", { className: "flex-1" }),
@@ -36392,43 +36409,51 @@ var d$ = [
36392
36409
  label: "System"
36393
36410
  }
36394
36411
  ];
36395
- function f$({ name: e, email: n, avatarUrl: r, initials: i, className: a, onSignOut: o }) {
36396
- let s = i ?? e.slice(0, 2).toUpperCase(), { mode: c, setMode: l } = Me();
36412
+ function f$({ name: e, email: n, avatarUrl: r, initials: i, className: a, onSignOut: o, "data-testid": s }) {
36413
+ let c = i ?? e.slice(0, 2).toUpperCase(), { mode: l, setMode: u } = Me();
36397
36414
  return /* @__PURE__ */ W(bL, { children: [/* @__PURE__ */ U(SL, {
36398
36415
  asChild: !0,
36399
36416
  children: /* @__PURE__ */ U("button", {
36400
36417
  type: "button",
36401
36418
  className: t("rounded-full ring-ring outline-none focus-visible:ring-2", a),
36402
36419
  "aria-label": "User menu",
36420
+ "data-testid": s,
36403
36421
  children: /* @__PURE__ */ W(Uv, { children: [r && /* @__PURE__ */ U(Wv, {
36404
36422
  src: r,
36405
36423
  alt: e
36406
- }), /* @__PURE__ */ U(Gv, { children: s })] })
36424
+ }), /* @__PURE__ */ U(Gv, { children: c })] })
36407
36425
  })
36408
36426
  }), /* @__PURE__ */ W(CL, {
36409
36427
  align: "end",
36410
36428
  className: "min-w-48",
36429
+ "data-testid": J(s, "content"),
36411
36430
  children: [
36412
36431
  /* @__PURE__ */ W(kL, {
36413
36432
  className: "flex flex-col gap-0.5",
36414
- children: [/* @__PURE__ */ U("span", { children: e }), n && /* @__PURE__ */ U("span", {
36433
+ children: [/* @__PURE__ */ U("span", {
36434
+ "data-testid": J(s, "name"),
36435
+ children: e
36436
+ }), n && /* @__PURE__ */ U("span", {
36415
36437
  className: "text-xs font-normal text-muted-foreground",
36438
+ "data-testid": J(s, "email"),
36416
36439
  children: n
36417
36440
  })]
36418
36441
  }),
36419
36442
  /* @__PURE__ */ U(AL, {}),
36420
36443
  /* @__PURE__ */ U(kL, { children: "Theme" }),
36421
36444
  /* @__PURE__ */ U(DL, {
36422
- value: c,
36423
- onValueChange: (e) => l(e),
36445
+ value: l,
36446
+ onValueChange: (e) => u(e),
36424
36447
  children: d$.map((e) => /* @__PURE__ */ U(OL, {
36425
36448
  value: e.value,
36449
+ "data-testid": J(s, `theme-option-${e.value}`),
36426
36450
  children: e.label
36427
36451
  }, e.value))
36428
36452
  }),
36429
36453
  /* @__PURE__ */ U(AL, {}),
36430
36454
  /* @__PURE__ */ U(TL, {
36431
36455
  onSelect: o,
36456
+ "data-testid": J(s, "sign-out"),
36432
36457
  children: "Sign out"
36433
36458
  })
36434
36459
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/graphene-core",
3
- "version": "3.53.1",
3
+ "version": "3.54.0",
4
4
  "type": "module",
5
5
  "description": "Gravitee's Graphene design system: accessible React components, design tokens, icons, and shared ESLint/TypeScript configs. Built on shadcn/ui and Tailwind.",
6
6
  "keywords": [
@@ -77,8 +77,7 @@
77
77
  "build-storybook": "storybook build",
78
78
  "shadcn": "shadcn",
79
79
  "sync-ai-rules": "node scripts/sync-ai-rules.mjs",
80
- "test": "vitest run",
81
- "test:ids:update": "UPDATE_PENDING_TEST_IDS=1 vitest run src/__tests__/test-ids.test.tsx"
80
+ "test": "vitest run"
82
81
  },
83
82
  "dependencies": {
84
83
  "@base-ui/react": "1.4.1",