@testgorilla/tgo-ui 12.2.0 → 12.3.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.
Files changed (62) hide show
  1. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +3 -0
  2. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
  3. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +3 -0
  4. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
  5. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +3 -0
  6. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
  7. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +3 -0
  8. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
  9. package/fesm2022/testgorilla-tgo-ui-components-button.mjs +19 -4
  10. package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
  11. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +3 -0
  12. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
  13. package/fesm2022/testgorilla-tgo-ui-components-core.mjs +11 -1
  14. package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
  15. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +6 -0
  16. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
  17. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +3 -0
  18. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
  19. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +3 -0
  20. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
  21. package/fesm2022/testgorilla-tgo-ui-components-field.mjs +3 -0
  22. package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
  23. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +3 -0
  24. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
  25. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +3 -0
  26. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
  27. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +3 -0
  28. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
  29. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +3 -0
  30. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
  31. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +6 -0
  32. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
  33. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +3 -0
  34. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
  35. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +3 -0
  36. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
  37. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +250 -50
  38. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
  39. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +4 -0
  40. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
  41. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +3 -0
  42. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
  43. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +3 -0
  44. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
  45. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +89 -7
  46. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
  47. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +3 -0
  48. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
  49. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +3 -0
  50. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
  51. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +3 -0
  52. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
  53. package/fesm2022/testgorilla-tgo-ui-components-table.mjs +3 -0
  54. package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
  55. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +3 -0
  56. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
  57. package/mcp/catalog.json +1 -1
  58. package/package.json +1 -1
  59. package/types/testgorilla-tgo-ui-components-button.d.ts +32 -0
  60. package/types/testgorilla-tgo-ui-components-core.d.ts +1 -0
  61. package/types/testgorilla-tgo-ui-components-popover.d.ts +51 -5
  62. package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +59 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testgorilla/tgo-ui",
3
- "version": "12.2.0",
3
+ "version": "12.3.0",
4
4
  "license": "proprietary-license",
5
5
  "lint-staged": {
6
6
  "{projects,components}/**/*.ts": [
@@ -19,6 +19,8 @@ export type ButtonColor = 'primary' | 'secondary' | 'secondary-inverted' | 'ghos
19
19
  export type ButtonSize = 'big' | 'medium' | 'small';
20
20
  export type LinkUrlTarget = '' | '_self' | '_blank' | '_parent' | '_top';
21
21
  export type IconButtonSize = '24' | '32' | '40';
22
+ export type IconButtonShape = 'round' | 'square';
23
+ export type ButtonAriaHasPopup = 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid';
22
24
  export type ButtonType = 'button' | 'submit' | 'reset';
23
25
  export type ButtonState = 'hover' | 'pressed' | 'disabled' | 'default';
24
26
  export interface ButtonBadgeConfig {
@@ -213,6 +215,11 @@ export declare class ButtonComponent implements OnInit, AfterViewInit {
213
215
  * @memberof ButtonComponent
214
216
  */
215
217
  ariaPressed?: boolean;
218
+ /**
219
+ * The kind of popup the button opens, as `aria-haspopup`. Leave undefined when it opens none.
220
+ * @memberof ButtonComponent
221
+ */
222
+ ariaHasPopup?: ButtonAriaHasPopup;
216
223
  /**
217
224
  * A string representing the ARIA requirement for accessibility.
218
225
  * This attribute is used to indicate whether an input field is required for form submission.
@@ -253,6 +260,18 @@ export declare class ButtonComponent implements OnInit, AfterViewInit {
253
260
  * @memberof ButtonComponent
254
261
  */
255
262
  circular: boolean;
263
+ /**
264
+ * Keeps the label on one line with an ellipsis; a label that gets cut off is shown as the tooltip.
265
+ * @type {boolean}
266
+ * @memberof ButtonComponent
267
+ */
268
+ isSingleLineLabel: boolean;
269
+ /**
270
+ * `square` gives an `icon-button` rounded corners instead of a circle. Has no effect on other variants.
271
+ * @type {IconButtonShape}
272
+ * @memberof ButtonComponent
273
+ */
274
+ iconButtonShape: IconButtonShape;
256
275
  /**
257
276
  * Sets tooltip position
258
277
  *
@@ -429,6 +448,10 @@ export declare class ButtonComponent implements OnInit, AfterViewInit {
429
448
  "alias": "ariaPressed";
430
449
  "required": false;
431
450
  };
451
+ "ariaHasPopup": {
452
+ "alias": "ariaHasPopup";
453
+ "required": false;
454
+ };
432
455
  "ariaRequired": {
433
456
  "alias": "ariaRequired";
434
457
  "required": false;
@@ -453,6 +476,14 @@ export declare class ButtonComponent implements OnInit, AfterViewInit {
453
476
  "alias": "circular";
454
477
  "required": false;
455
478
  };
479
+ "isSingleLineLabel": {
480
+ "alias": "isSingleLineLabel";
481
+ "required": false;
482
+ };
483
+ "iconButtonShape": {
484
+ "alias": "iconButtonShape";
485
+ "required": false;
486
+ };
456
487
  "tooltipPosition": {
457
488
  "alias": "tooltipPosition";
458
489
  "required": false;
@@ -476,6 +507,7 @@ export declare class ButtonComponent implements OnInit, AfterViewInit {
476
507
  static ngAcceptInputType_preventDefault: unknown;
477
508
  static ngAcceptInputType_hasBackground: unknown;
478
509
  static ngAcceptInputType_circular: unknown;
510
+ static ngAcceptInputType_isSingleLineLabel: unknown;
479
511
  }
480
512
  export declare class ButtonComponentModule {
481
513
  static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponentModule, never>;
@@ -50,6 +50,7 @@ export declare class EllipseTextDirective implements OnInit {
50
50
  onChangeTextState: EventEmitter<boolean>;
51
51
  resize(): void;
52
52
  private readonly destroyRef;
53
+ private readonly document;
53
54
  constructor(el: ElementRef);
54
55
  ngOnInit(): void;
55
56
  static ɵfac: i0.ɵɵFactoryDeclaration<EllipseTextDirective, never>;
@@ -1,13 +1,30 @@
1
- import { HorizontalConnectionPos } from "@angular/cdk/overlay";
1
+ import { HorizontalConnectionPos, OverlayRef } from "@angular/cdk/overlay";
2
2
  import * as i0 from "@angular/core";
3
- import { OnDestroy, OnInit, TemplateRef } from "@angular/core";
3
+ import { DestroyRef, OnDestroy, OnInit, TemplateRef } from "@angular/core";
4
4
  import { CardSize } from "@testgorilla/tgo-ui/components/card";
5
+ import { Observable } from "rxjs";
5
6
  /** How the popover is opened: on hover of the anchor, or on click. */
6
7
  export type PopoverTrigger = 'hover' | 'click';
8
+ /** `end` opens beside the anchor (right in LTR), top-aligned, flipping to the other side when it does not fit. */
9
+ export type PopoverPlacement = 'below' | 'end';
10
+ export interface PopoverConfig {
11
+ placement?: PopoverPlacement;
12
+ /** Applies to `below` only. */
13
+ align?: HorizontalConnectionPos;
14
+ offset?: number;
15
+ isCard?: boolean;
16
+ cardSize?: CardSize;
17
+ ariaLabel?: string;
18
+ }
19
+ export interface PopoverOpenConfig extends PopoverConfig {
20
+ /** Closes the popover when it is destroyed; pass the `DestroyRef` of the view that owns the template. */
21
+ destroyRef?: DestroyRef;
22
+ }
7
23
  export declare class PopoverDirective implements OnInit, OnDestroy {
8
24
  uiPopover: import("@angular/core").InputSignal<TemplateRef<unknown>>;
9
25
  popoverOffset: import("@angular/core").InputSignal<number>;
10
26
  popoverAlign: import("@angular/core").InputSignal<HorizontalConnectionPos>;
27
+ popoverPlacement: import("@angular/core").InputSignal<PopoverPlacement>;
11
28
  popoverOpen: import("@angular/core").InputSignal<boolean>;
12
29
  popoverCard: import("@angular/core").InputSignal<boolean>;
13
30
  popoverCardSize: import("@angular/core").InputSignal<CardSize>;
@@ -17,7 +34,7 @@ export declare class PopoverDirective implements OnInit, OnDestroy {
17
34
  private readonly openState;
18
35
  /** Whether the popover is currently showing. Read it via `#ref="uiPopover"` or `viewChild(PopoverDirective)`. */
19
36
  readonly isOpen: import("@angular/core").Signal<boolean>;
20
- private readonly overlay;
37
+ private readonly popoverOverlay;
21
38
  private readonly elementRef;
22
39
  private readonly injector;
23
40
  private readonly ngZone;
@@ -35,9 +52,8 @@ export declare class PopoverDirective implements OnInit, OnDestroy {
35
52
  close(): void;
36
53
  /** Opens the popover when closed, closes it when open. */
37
54
  toggle(): void;
55
+ private config;
38
56
  private createOverlay;
39
- /** Click-triggered popovers dismiss on an outside pointer event or on Escape. */
40
- private listenForDismiss;
41
57
  private scheduleOpen;
42
58
  private cancelOpen;
43
59
  private scheduleClose;
@@ -61,6 +77,11 @@ export declare class PopoverDirective implements OnInit, OnDestroy {
61
77
  "required": false;
62
78
  "isSignal": true;
63
79
  };
80
+ "popoverPlacement": {
81
+ "alias": "popoverPlacement";
82
+ "required": false;
83
+ "isSignal": true;
84
+ };
64
85
  "popoverOpen": {
65
86
  "alias": "popoverOpen";
66
87
  "required": false;
@@ -92,4 +113,29 @@ export declare class PopoverDirective implements OnInit, OnDestroy {
92
113
  "isSignal": true;
93
114
  };
94
115
  }, {}, never, never, true, never>;
116
+ }
117
+ export declare class PopoverRef {
118
+ readonly anchor: HTMLElement;
119
+ private readonly overlayRef;
120
+ private readonly openState;
121
+ private readonly closedSubject$;
122
+ readonly isOpen: import("@angular/core").Signal<boolean>;
123
+ /** Emits once, however the popover closed. */
124
+ readonly closed$: Observable<void>;
125
+ private stopClosingOnDestroy?;
126
+ constructor(anchor: HTMLElement, overlayRef: OverlayRef, destroyRef?: DestroyRef);
127
+ close(): void;
128
+ }
129
+ /** Opens a popover against an anchor you do not own, with the same semantics as `popoverTrigger="click"`. */
130
+ export declare class PopoverService {
131
+ private readonly popoverOverlay;
132
+ private readonly injector;
133
+ private active;
134
+ /** Returns the open popover when `anchor` already has one; any other popover opened here closes first. */
135
+ open(anchor: HTMLElement, template: TemplateRef<unknown>, config?: PopoverOpenConfig): PopoverRef;
136
+ /** Closes the popover when `anchor` has one open (returning `null`), opens it otherwise. */
137
+ toggle(anchor: HTMLElement, template: TemplateRef<unknown>, config?: PopoverOpenConfig): PopoverRef | null;
138
+ private openRefFor;
139
+ static ɵfac: i0.ɵɵFactoryDeclaration<PopoverService, never>;
140
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
95
141
  }
@@ -25,12 +25,47 @@ export interface NavigationItem {
25
25
  text: string;
26
26
  url: string;
27
27
  badgeOptions?: ButtonBadgeConfig;
28
+ children?: NavigationChildItem[];
29
+ /** Controlled by the consumer: update it from `expandedChange`. */
30
+ isExpanded?: boolean;
31
+ /** Takes the chevron slot instead of the expand toggle, and a click on the row runs it instead of `navigate`. */
32
+ trailingAction?: NavigationTrailingAction;
33
+ /** Shows a blue dot at the end of the row and adds "New" to its accessible name. Defaults to `false`. */
34
+ isNew?: boolean;
35
+ }
36
+ export interface NavigationChildItem extends Omit<NavigationItem, 'icon'> {
37
+ icon?: IconName;
38
+ /** Takes the icon's place. */
39
+ status?: NavigationItemStatus;
40
+ }
41
+ export type NavigationStatusColor = 'success' | 'warning' | 'error' | 'neutral';
42
+ export interface NavigationItemStatus {
43
+ color: NavigationStatusColor;
44
+ /** Appended to the row's accessible name, so the status is not conveyed by colour alone. */
45
+ label: string;
46
+ }
47
+ export interface NavigationTrailingAction {
48
+ icon: IconName;
49
+ ariaLabel: string;
50
+ /** Set while the action's popover is open: drives `aria-expanded` and highlights the row. */
51
+ isExpanded?: boolean;
52
+ }
53
+ export interface NavigationExpandedChange {
54
+ id: string;
55
+ isExpanded: boolean;
56
+ }
57
+ export interface NavigationTrailingActionClick {
58
+ id: string;
59
+ anchor: HTMLElement;
60
+ /** `offset` for a `placement: 'end'` popover on `anchor` that opens just past the rail's edge. */
61
+ popoverOffset: number;
28
62
  }
29
63
  export interface NavigationAccount {
30
64
  name: string;
31
65
  email: string;
32
66
  menu: OverflowMenuButtonsType[];
33
67
  }
68
+ type NavigationNode = NavigationItem | NavigationChildItem;
34
69
  export declare const COLLAPSE_ANIMATION_MS = 180;
35
70
  export declare class SideNavigationComponent implements OnInit, OnDestroy {
36
71
  protected readonly avatarSize: typeof AvatarSize;
@@ -44,6 +79,8 @@ export declare class SideNavigationComponent implements OnInit, OnDestroy {
44
79
  readonly NAV: "SIDE_NAVIGATION.NAV_ARIA_LABEL";
45
80
  readonly ANNOUNCE_COLLAPSED: "SIDE_NAVIGATION.ANNOUNCE_COLLAPSED";
46
81
  readonly ANNOUNCE_EXPANDED: "SIDE_NAVIGATION.ANNOUNCE_EXPANDED";
82
+ readonly SUBMENU: "SIDE_NAVIGATION.SUBMENU_LABEL";
83
+ readonly NEW: "SIDE_NAVIGATION.NEW_LABEL";
47
84
  };
48
85
  private readonly breakpointObserver;
49
86
  private readonly liveAnnouncer;
@@ -68,9 +105,13 @@ export declare class SideNavigationComponent implements OnInit, OnDestroy {
68
105
  mobileCloseLabel: import("@angular/core").InputSignal<string | undefined>;
69
106
  /** Optional override; falls back to `SIDE_NAVIGATION.NAV_ARIA_LABEL` translation. */
70
107
  navAriaLabel: import("@angular/core").InputSignal<string | undefined>;
108
+ /** Shows each chevron's label, such as "Switch job", as a tooltip on hover. */
109
+ hasChevronTooltips: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
71
110
  isCollapsed: import("@angular/core").ModelSignal<boolean>;
72
111
  mainCtaClicked: import("@angular/core").OutputEmitterRef<void>;
73
112
  navigate: import("@angular/core").OutputEmitterRef<string>;
113
+ expandedChange: import("@angular/core").OutputEmitterRef<NavigationExpandedChange>;
114
+ trailingActionClicked: import("@angular/core").OutputEmitterRef<NavigationTrailingActionClick>;
74
115
  accountMenuSelected: import("@angular/core").OutputEmitterRef<string>;
75
116
  logoClicked: import("@angular/core").OutputEmitterRef<void>;
76
117
  isExpandingOrCollapsing: import("@angular/core").WritableSignal<boolean>;
@@ -78,6 +119,12 @@ export declare class SideNavigationComponent implements OnInit, OnDestroy {
78
119
  protected readonly trapFocus: import("@angular/core").Signal<boolean>;
79
120
  private collapseTimer;
80
121
  activeRoutesMap: import("@angular/core").Signal<Map<string, boolean>>;
122
+ /**
123
+ * Within a branch only the child holding the longest matching URL is followed, and the deepest match is the
124
+ * current page; top-level items stay independent so flat lists behave as before.
125
+ */
126
+ protected readonly highlightStates: import("@angular/core").Signal<Map<string, "active" | "ancestor">>;
127
+ protected readonly shouldShowLabels: import("@angular/core").Signal<boolean>;
81
128
  overflowMenuConfig: import("@angular/core").Signal<MenuConfig>;
82
129
  protected readonly toggleAriaLabelOverride: import("@angular/core").Signal<string | undefined>;
83
130
  protected readonly toggleAriaKey: import("@angular/core").Signal<"SIDE_NAVIGATION.COLLAPSE_LABEL" | "SIDE_NAVIGATION.EXPAND_LABEL">;
@@ -89,8 +136,11 @@ export declare class SideNavigationComponent implements OnInit, OnDestroy {
89
136
  announce?: boolean;
90
137
  }): void;
91
138
  onNavigateClick(id: string): void;
139
+ emitExpandedChange(item: NavigationNode): void;
140
+ emitTrailingAction(item: NavigationNode, event: Event): void;
92
141
  onSelectMenuItem($event: string): void;
93
142
  onEscapeKey(): void;
143
+ private allNavigation;
94
144
  private autoCloseDrawer;
95
145
  private observeViewportBreakpoint;
96
146
  private announceCollapseState;
@@ -168,6 +218,11 @@ export declare class SideNavigationComponent implements OnInit, OnDestroy {
168
218
  "required": false;
169
219
  "isSignal": true;
170
220
  };
221
+ "hasChevronTooltips": {
222
+ "alias": "hasChevronTooltips";
223
+ "required": false;
224
+ "isSignal": true;
225
+ };
171
226
  "isCollapsed": {
172
227
  "alias": "isCollapsed";
173
228
  "required": false;
@@ -177,6 +232,8 @@ export declare class SideNavigationComponent implements OnInit, OnDestroy {
177
232
  "isCollapsed": "isCollapsedChange";
178
233
  "mainCtaClicked": "mainCtaClicked";
179
234
  "navigate": "navigate";
235
+ "expandedChange": "expandedChange";
236
+ "trailingActionClicked": "trailingActionClicked";
180
237
  "accountMenuSelected": "accountMenuSelected";
181
238
  "logoClicked": "logoClicked";
182
239
  }, never, never, true, never>;
@@ -185,4 +242,5 @@ export declare class SideNavigationComponentModule {
185
242
  static ɵfac: i0.ɵɵFactoryDeclaration<SideNavigationComponentModule, never>;
186
243
  static ɵmod: i0.ɵɵNgModuleDeclaration<SideNavigationComponentModule, never, [typeof i1.A11yModule, typeof i2.CommonModule, typeof i3.UiTranslatePipe, typeof i4.ButtonComponentModule, typeof i5.AvatarComponentModule, typeof i6.IconComponentModule, typeof i7.LogoComponentModule, typeof i8.OverflowMenuComponentModule, typeof SideNavigationComponent], [typeof SideNavigationComponent]>;
187
244
  static ɵinj: i0.ɵɵInjectorDeclaration<SideNavigationComponentModule>;
188
- }
245
+ }
246
+ export {};