@pecb-ui/components 1.1.9 → 1.1.10

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/index.d.ts CHANGED
@@ -1038,21 +1038,20 @@ declare class RightModalComponent implements OnDestroy {
1038
1038
  ariaDescribedBy: _angular_core.InputSignal<string | undefined>;
1039
1039
  closed: _angular_core.OutputEmitterRef<void>;
1040
1040
  opened: _angular_core.OutputEmitterRef<void>;
1041
- private modalPanel;
1042
- private cleanupFocusTrap;
1043
- private cleanupBodyScroll;
1041
+ private readonly overlay;
1042
+ private readonly viewContainerRef;
1043
+ private modalTemplate;
1044
+ private overlayRef;
1045
+ private portal;
1046
+ private subscriptions;
1044
1047
  private previousActiveElement;
1045
- private currentlyOpen;
1046
1048
  constructor();
1047
1049
  ngOnDestroy(): void;
1048
- get modalClasses(): string[];
1049
1050
  get panelClasses(): string[];
1050
- onBackdropClick(event: MouseEvent): void;
1051
- onKeydown(event: KeyboardEvent): void;
1052
1051
  close(): void;
1053
- private onOpen;
1054
- private setupFocusTrap;
1055
- private cleanup;
1052
+ private openOverlay;
1053
+ private closeOverlay;
1054
+ private destroyOverlay;
1056
1055
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RightModalComponent, never>;
1057
1056
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RightModalComponent, "pecb-right-modal", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, { "isOpen": "isOpenChange"; "closed": "closed"; "opened": "opened"; }, never, ["[pecbRightModalHeader]", "[pecbRightModalContent]", "*", "[pecbRightModalFooter]"], true, never>;
1058
1057
  }
@@ -1114,7 +1113,7 @@ declare class SidebarComponent {
1114
1113
  }
1115
1114
 
1116
1115
  type ConfirmationIconType = 'success' | 'warning' | 'error' | 'info';
1117
- declare class ConfirmationComponent implements OnDestroy, AfterViewInit {
1116
+ declare class ConfirmationComponent implements OnDestroy {
1118
1117
  id: _angular_core.InputSignal<string>;
1119
1118
  /**
1120
1119
  * Whether the dialog is visible. Manages its own state internally —
@@ -1136,25 +1135,23 @@ declare class ConfirmationComponent implements OnDestroy, AfterViewInit {
1136
1135
  confirmed: _angular_core.OutputEmitterRef<void>;
1137
1136
  cancelled: _angular_core.OutputEmitterRef<void>;
1138
1137
  closed: _angular_core.OutputEmitterRef<void>;
1139
- dialogPanel: ElementRef<HTMLElement>;
1140
- private cleanupFocusTrap;
1141
- private cleanupBodyScroll;
1138
+ private readonly overlay;
1139
+ private readonly viewContainerRef;
1140
+ private dialogTemplate;
1141
+ private overlayRef;
1142
+ private portal;
1143
+ private subscriptions;
1142
1144
  private previousActiveElement;
1143
1145
  constructor();
1144
- ngAfterViewInit(): void;
1145
1146
  ngOnDestroy(): void;
1146
- get dialogClasses(): string[];
1147
1147
  get iconContainerClass(): string;
1148
1148
  get titleId(): string;
1149
1149
  get messageId(): string;
1150
- onBackdropClick(event: MouseEvent): void;
1151
- onKeydown(event: KeyboardEvent): void;
1152
1150
  onConfirm(): void;
1153
1151
  onCancel(): void;
1154
1152
  close(): void;
1155
- private onOpen;
1156
- private setupFocusTrap;
1157
- private cleanup;
1153
+ private openOverlay;
1154
+ private destroyOverlay;
1158
1155
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmationComponent, never>;
1159
1156
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmationComponent, "pecb-confirmation", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "confirmText": { "alias": "confirmText"; "required": false; "isSignal": true; }; "cancelText": { "alias": "cancelText"; "required": false; "isSignal": true; }; "iconType": { "alias": "iconType"; "required": false; "isSignal": true; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "ariaDescribedBy"; "required": false; "isSignal": true; }; }, { "isOpen": "isOpenChange"; "confirmed": "confirmed"; "cancelled": "cancelled"; "closed": "closed"; }, never, never, true, never>;
1160
1157
  }
@@ -1399,6 +1396,16 @@ declare class TooltipComponent {
1399
1396
  primaryCta: _angular_core.InputSignal<string | undefined>;
1400
1397
  secondaryCta: _angular_core.InputSignal<string | undefined>;
1401
1398
  showClose: _angular_core.InputSignal<boolean>;
1399
+ /**
1400
+ * Optional explicit width of the tooltip box (any CSS length, e.g. '330px',
1401
+ * '20rem'). Leave undefined to size to content.
1402
+ */
1403
+ width: _angular_core.InputSignal<string | undefined>;
1404
+ /**
1405
+ * Optional explicit height of the tooltip box (any CSS length, e.g. '120px').
1406
+ * Leave undefined to size to content.
1407
+ */
1408
+ height: _angular_core.InputSignal<string | undefined>;
1402
1409
  /**
1403
1410
  * Whether the tooltip is visible. Manages its own state internally —
1404
1411
  * no consumer binding required. Supports [(visible)] for controlled mode.
@@ -1418,7 +1425,7 @@ declare class TooltipComponent {
1418
1425
  get ptrBodyFill(): string;
1419
1426
  get hostClasses(): string;
1420
1427
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TooltipComponent, never>;
1421
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TooltipComponent, "pecb-tooltip", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "pointerPosition": { "alias": "pointerPosition"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "primaryCta": { "alias": "primaryCta"; "required": false; "isSignal": true; }; "secondaryCta": { "alias": "secondaryCta"; "required": false; "isSignal": true; }; "showClose": { "alias": "showClose"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; }, { "visible": "visibleChange"; "closed": "closed"; "primaryCtaClick": "primaryCtaClick"; "secondaryCtaClick": "secondaryCtaClick"; }, never, never, true, never>;
1428
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TooltipComponent, "pecb-tooltip", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "pointerPosition": { "alias": "pointerPosition"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "primaryCta": { "alias": "primaryCta"; "required": false; "isSignal": true; }; "secondaryCta": { "alias": "secondaryCta"; "required": false; "isSignal": true; }; "showClose": { "alias": "showClose"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; }, { "visible": "visibleChange"; "closed": "closed"; "primaryCtaClick": "primaryCtaClick"; "secondaryCtaClick": "secondaryCtaClick"; }, never, never, true, never>;
1422
1429
  }
1423
1430
 
1424
1431
  declare class TooltipDirective implements OnDestroy {
@@ -2413,12 +2420,28 @@ interface NotificationConfig {
2413
2420
  title?: string;
2414
2421
  /** Type of notification */
2415
2422
  type: NotificationType;
2423
+ /** Visual variant of the underlying `pecb-alert`. Defaults to `'banner'`. */
2424
+ variant?: AlertVariant;
2416
2425
  /** Duration in milliseconds (0 for persistent) */
2417
2426
  duration?: number;
2418
2427
  /** Whether the notification can be dismissed */
2419
2428
  dismissible?: boolean;
2420
2429
  /** Position on screen */
2421
2430
  position?: NotificationPosition;
2431
+ /** Label for the primary action button. Omit for no button. */
2432
+ primaryAction?: string;
2433
+ /** Label for the secondary action button. Omit for no button. */
2434
+ secondaryAction?: string;
2435
+ /**
2436
+ * Called when the primary action button is clicked. By default the toast is
2437
+ * dismissed afterwards; return `false` to keep it open.
2438
+ */
2439
+ onPrimaryAction?: () => boolean | void;
2440
+ /**
2441
+ * Called when the secondary action button is clicked. By default the toast is
2442
+ * dismissed afterwards; return `false` to keep it open.
2443
+ */
2444
+ onSecondaryAction?: () => boolean | void;
2422
2445
  /** Custom CSS class */
2423
2446
  customClass?: string;
2424
2447
  /** Unique identifier */
@@ -2427,17 +2450,17 @@ interface NotificationConfig {
2427
2450
  /**
2428
2451
  * Notification object with all properties
2429
2452
  */
2430
- interface Notification extends Required<Omit<NotificationConfig, 'title' | 'customClass'>> {
2453
+ interface Notification extends Required<Omit<NotificationConfig, 'title' | 'customClass' | 'variant' | 'primaryAction' | 'secondaryAction' | 'onPrimaryAction' | 'onSecondaryAction'>> {
2431
2454
  title?: string;
2432
2455
  customClass?: string;
2433
2456
  timestamp: Date;
2434
2457
  }
2435
2458
  /**
2436
- * A stateless, injectable notification service for displaying toast notifications.
2459
+ * An injectable, Toastr-style notification service.
2437
2460
  *
2438
- * This service provides a reactive way to manage notifications across the application.
2439
- * It uses RxJS Subjects to emit notification events that can be consumed by notification
2440
- * display components.
2461
+ * Calling any of the helpers renders a `pecb-alert` toast in a CDK overlay
2462
+ * stack on `<body>` no template wiring, host component, or module setup is
2463
+ * required. Just inject and call:
2441
2464
  *
2442
2465
  * @example
2443
2466
  * ```typescript
@@ -2445,14 +2468,11 @@ interface Notification extends Required<Omit<NotificationConfig, 'title' | 'cust
2445
2468
  *
2446
2469
  * @Component({...})
2447
2470
  * export class MyComponent {
2448
- * constructor(private notificationService: NotificationService) {}
2471
+ * private notify = inject(NotificationService);
2449
2472
  *
2450
- * showSuccess(): void {
2451
- * this.notificationService.success('Operation completed successfully!');
2452
- * }
2453
- *
2454
- * showError(): void {
2455
- * this.notificationService.error('An error occurred', 'Error Title');
2473
+ * save(): void {
2474
+ * this.notify.success('Saved!');
2475
+ * this.notify.error('Something went wrong', 'Error');
2456
2476
  * }
2457
2477
  * }
2458
2478
  * ```
@@ -2460,6 +2480,9 @@ interface Notification extends Required<Omit<NotificationConfig, 'title' | 'cust
2460
2480
  * @publicApi
2461
2481
  */
2462
2482
  declare class NotificationService {
2483
+ private readonly overlay;
2484
+ private readonly appRef;
2485
+ private readonly environmentInjector;
2463
2486
  private readonly notificationSubject;
2464
2487
  private readonly dismissSubject;
2465
2488
  private readonly clearSubject;
@@ -2467,17 +2490,17 @@ declare class NotificationService {
2467
2490
  private readonly defaultDuration;
2468
2491
  /** Default position for notifications */
2469
2492
  private readonly defaultPosition;
2470
- /**
2471
- * Observable stream of notifications
2472
- */
2493
+ /** Time to keep a toast mounted after dismiss so its leave animation can play. */
2494
+ private readonly leaveAnimationMs;
2495
+ /** One shared overlay (a vertical stack) per on-screen position. */
2496
+ private readonly stacks;
2497
+ /** All live toasts, keyed by their id. */
2498
+ private readonly toasts;
2499
+ /** @deprecated Notifications now render automatically; no need to subscribe. */
2473
2500
  get notifications$(): Observable<Notification>;
2474
- /**
2475
- * Observable stream of dismissed notification IDs
2476
- */
2501
+ /** @deprecated Notifications now render automatically; no need to subscribe. */
2477
2502
  get dismiss$(): Observable<string>;
2478
- /**
2479
- * Observable stream for clear all events
2480
- */
2503
+ /** @deprecated Notifications now render automatically; no need to subscribe. */
2481
2504
  get clear$(): Observable<void>;
2482
2505
  /**
2483
2506
  * Show a success notification
@@ -2522,6 +2545,12 @@ declare class NotificationService {
2522
2545
  * Clear all notifications
2523
2546
  */
2524
2547
  clearAll(): void;
2548
+ /** Get (or lazily create) the overlay stack for a screen position. */
2549
+ private getStack;
2550
+ /** Play the leave animation, then unmount the toast and tidy up its stack. */
2551
+ private remove;
2552
+ /** Dispose a position's overlay once it holds no more toasts. */
2553
+ private disposeStackIfEmpty;
2525
2554
  /**
2526
2555
  * Generate a unique notification ID
2527
2556
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pecb-ui/components",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Professional Angular UI Components Library with TypeScript and SCSS by PECB",
5
5
  "author": "PECB",
6
6
  "license": "MIT",