ngx-com 0.0.18 → 0.0.20

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 (48) hide show
  1. package/fesm2022/ngx-com-components-alert.mjs +346 -0
  2. package/fesm2022/ngx-com-components-alert.mjs.map +1 -0
  3. package/fesm2022/ngx-com-components-button.mjs +1 -1
  4. package/fesm2022/ngx-com-components-button.mjs.map +1 -1
  5. package/fesm2022/ngx-com-components-calendar.mjs +1267 -48
  6. package/fesm2022/ngx-com-components-calendar.mjs.map +1 -1
  7. package/fesm2022/ngx-com-components-card.mjs +1 -1
  8. package/fesm2022/ngx-com-components-card.mjs.map +1 -1
  9. package/fesm2022/ngx-com-components-carousel.mjs +708 -0
  10. package/fesm2022/ngx-com-components-carousel.mjs.map +1 -0
  11. package/fesm2022/ngx-com-components-checkbox.mjs +1 -1
  12. package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -1
  13. package/fesm2022/ngx-com-components-code-block.mjs +158 -0
  14. package/fesm2022/ngx-com-components-code-block.mjs.map +1 -0
  15. package/fesm2022/ngx-com-components-collapsible.mjs +1 -1
  16. package/fesm2022/ngx-com-components-collapsible.mjs.map +1 -1
  17. package/fesm2022/ngx-com-components-confirm.mjs +3 -3
  18. package/fesm2022/ngx-com-components-confirm.mjs.map +1 -1
  19. package/fesm2022/ngx-com-components-dialog.mjs +703 -0
  20. package/fesm2022/ngx-com-components-dialog.mjs.map +1 -0
  21. package/fesm2022/ngx-com-components-dropdown.mjs +18 -21
  22. package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
  23. package/fesm2022/ngx-com-components-item.mjs +1 -1
  24. package/fesm2022/ngx-com-components-item.mjs.map +1 -1
  25. package/fesm2022/ngx-com-components-paginator.mjs +3 -3
  26. package/fesm2022/ngx-com-components-paginator.mjs.map +1 -1
  27. package/fesm2022/ngx-com-components-radio.mjs +1 -1
  28. package/fesm2022/ngx-com-components-radio.mjs.map +1 -1
  29. package/fesm2022/ngx-com-components-segmented-control.mjs +1 -1
  30. package/fesm2022/ngx-com-components-segmented-control.mjs.map +1 -1
  31. package/fesm2022/ngx-com-components-switch.mjs +258 -0
  32. package/fesm2022/ngx-com-components-switch.mjs.map +1 -0
  33. package/fesm2022/ngx-com-components-table.mjs +631 -0
  34. package/fesm2022/ngx-com-components-table.mjs.map +1 -0
  35. package/fesm2022/ngx-com-components-tabs.mjs +2 -2
  36. package/fesm2022/ngx-com-components-tabs.mjs.map +1 -1
  37. package/fesm2022/ngx-com-components-toast.mjs +783 -0
  38. package/fesm2022/ngx-com-components-toast.mjs.map +1 -0
  39. package/package.json +29 -1
  40. package/types/ngx-com-components-alert.d.ts +166 -0
  41. package/types/ngx-com-components-calendar.d.ts +281 -5
  42. package/types/ngx-com-components-carousel.d.ts +281 -0
  43. package/types/ngx-com-components-code-block.d.ts +66 -0
  44. package/types/ngx-com-components-confirm.d.ts +2 -2
  45. package/types/ngx-com-components-dialog.d.ts +264 -0
  46. package/types/ngx-com-components-switch.d.ts +110 -0
  47. package/types/ngx-com-components-table.d.ts +377 -0
  48. package/types/ngx-com-components-toast.d.ts +217 -0
@@ -0,0 +1,281 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as i0 from '@angular/core';
3
+ import { ElementRef, TemplateRef, InputSignal, InputSignalWithTransform, ModelSignal, Signal, WritableSignal } from '@angular/core';
4
+
5
+ /** Template context for custom previous-button template. */
6
+ interface CarouselPrevContext {
7
+ /** Whether the carousel can navigate to the previous slide. */
8
+ $implicit: boolean;
9
+ /** Callback to navigate to the previous slide. */
10
+ prev: () => void;
11
+ }
12
+ /** Template context for custom next-button template. */
13
+ interface CarouselNextContext {
14
+ /** Whether the carousel can navigate to the next slide. */
15
+ $implicit: boolean;
16
+ /** Callback to navigate to the next slide. */
17
+ next: () => void;
18
+ }
19
+ /** Template context for custom pagination dot template. */
20
+ interface CarouselPaginationContext {
21
+ /** The page index (0-based). */
22
+ $implicit: number;
23
+ /** Whether this page is currently active. */
24
+ active: boolean;
25
+ /** Total number of pages. */
26
+ total: number;
27
+ /** Same as $implicit — the page index. */
28
+ index: number;
29
+ }
30
+
31
+ declare const carouselContainerVariants: () => string;
32
+ declare const carouselNavButtonVariants: (props?: {
33
+ position?: 'prev' | 'next';
34
+ }) => string;
35
+ type CarouselNavButtonVariants = VariantProps<typeof carouselNavButtonVariants>;
36
+ declare const carouselDotVariants: (props?: {
37
+ active?: boolean;
38
+ }) => string;
39
+ type CarouselDotVariants = VariantProps<typeof carouselDotVariants>;
40
+
41
+ /**
42
+ * Marks an element as a carousel slide item.
43
+ *
44
+ * Apply this directive to each direct child element that should be
45
+ * treated as a slide within `<com-carousel>`.
46
+ *
47
+ * @example
48
+ * ```html
49
+ * <com-carousel>
50
+ * <div comCarouselItem>Slide 1</div>
51
+ * <div comCarouselItem>Slide 2</div>
52
+ * </com-carousel>
53
+ * ```
54
+ */
55
+ declare class ComCarouselItem {
56
+ readonly elementRef: ElementRef<HTMLElement>;
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCarouselItem, never>;
58
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCarouselItem, "[comCarouselItem]", never, {}, {}, never, never, true, never>;
59
+ }
60
+
61
+ /**
62
+ * Template directive for a custom "previous" navigation button.
63
+ *
64
+ * The template receives a boolean context (`$implicit`) indicating
65
+ * whether the carousel can navigate backward.
66
+ *
67
+ * @example
68
+ * ```html
69
+ * <com-carousel>
70
+ * <div comCarouselItem>Slide 1</div>
71
+ * <ng-template comCarouselPrev let-canGo>
72
+ * <button [disabled]="!canGo">Back</button>
73
+ * </ng-template>
74
+ * </com-carousel>
75
+ * ```
76
+ */
77
+ declare class ComCarouselPrevTpl {
78
+ readonly templateRef: TemplateRef<CarouselPrevContext>;
79
+ static ngTemplateContextGuard(_dir: ComCarouselPrevTpl, _ctx: unknown): _ctx is CarouselPrevContext;
80
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCarouselPrevTpl, never>;
81
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCarouselPrevTpl, "ng-template[comCarouselPrev]", never, {}, {}, never, never, true, never>;
82
+ }
83
+
84
+ /**
85
+ * Template directive for a custom "next" navigation button.
86
+ *
87
+ * The template receives a boolean context (`$implicit`) indicating
88
+ * whether the carousel can navigate forward.
89
+ *
90
+ * @example
91
+ * ```html
92
+ * <com-carousel>
93
+ * <div comCarouselItem>Slide 1</div>
94
+ * <ng-template comCarouselNext let-canGo>
95
+ * <button [disabled]="!canGo">Forward</button>
96
+ * </ng-template>
97
+ * </com-carousel>
98
+ * ```
99
+ */
100
+ declare class ComCarouselNextTpl {
101
+ readonly templateRef: TemplateRef<CarouselNextContext>;
102
+ static ngTemplateContextGuard(_dir: ComCarouselNextTpl, _ctx: unknown): _ctx is CarouselNextContext;
103
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCarouselNextTpl, never>;
104
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCarouselNextTpl, "ng-template[comCarouselNext]", never, {}, {}, never, never, true, never>;
105
+ }
106
+
107
+ /**
108
+ * Template directive for custom pagination indicators.
109
+ *
110
+ * Rendered once per "page" in the carousel. The template receives
111
+ * a context with the page index, active state, and total count.
112
+ *
113
+ * @example
114
+ * ```html
115
+ * <com-carousel>
116
+ * <div comCarouselItem>Slide 1</div>
117
+ * <div comCarouselItem>Slide 2</div>
118
+ * <ng-template comCarouselPagination let-idx let-active="active">
119
+ * <span
120
+ * class="inline-block h-3 w-3 rounded-pill transition-colors"
121
+ * [class]="active ? 'bg-primary' : 'bg-muted'"
122
+ * ></span>
123
+ * </ng-template>
124
+ * </com-carousel>
125
+ * ```
126
+ */
127
+ declare class ComCarouselPaginationTpl {
128
+ readonly templateRef: TemplateRef<CarouselPaginationContext>;
129
+ static ngTemplateContextGuard(_dir: ComCarouselPaginationTpl, _ctx: unknown): _ctx is CarouselPaginationContext;
130
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCarouselPaginationTpl, never>;
131
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCarouselPaginationTpl, "ng-template[comCarouselPagination]", never, {}, {}, never, never, true, never>;
132
+ }
133
+
134
+ /**
135
+ * Carousel component — a horizontal slider that navigates content screens
136
+ * using percentage-based CSS `transform: translateX()`.
137
+ *
138
+ * Items are projected via `ng-content` and marked with `comCarouselItem`.
139
+ * Navigation is screen-based: each index step moves one full viewport of items.
140
+ * Supports multi-item views, auto-play, loop, touch/swipe, keyboard
141
+ * navigation, and custom templates for navigation and pagination.
142
+ *
143
+ * @tokens `--color-background`, `--color-foreground`, `--color-muted`,
144
+ * `--color-muted-hover`, `--color-primary`, `--color-border-subtle`,
145
+ * `--color-ring`, `--color-disabled`, `--color-disabled-foreground`
146
+ *
147
+ * @example Basic usage
148
+ * ```html
149
+ * <com-carousel>
150
+ * <div comCarouselItem>Slide 1</div>
151
+ * <div comCarouselItem>Slide 2</div>
152
+ * <div comCarouselItem>Slide 3</div>
153
+ * </com-carousel>
154
+ * ```
155
+ *
156
+ * @example Multiple items per view
157
+ * ```html
158
+ * <com-carousel [slidesPerView]="3">
159
+ * @for (product of products(); track product.id) {
160
+ * <com-card comCarouselItem>{{ product.name }}</com-card>
161
+ * }
162
+ * </com-carousel>
163
+ * ```
164
+ *
165
+ * @example Auto-play with loop
166
+ * ```html
167
+ * <com-carousel autoPlay loop [autoPlayInterval]="4000">
168
+ * <img comCarouselItem *ngFor="let img of images" [src]="img.url" [alt]="img.alt" />
169
+ * </com-carousel>
170
+ * ```
171
+ *
172
+ * @example Two-way index binding
173
+ * ```html
174
+ * <com-carousel [(index)]="currentSlide">
175
+ * <div comCarouselItem>A</div>
176
+ * <div comCarouselItem>B</div>
177
+ * </com-carousel>
178
+ * ```
179
+ *
180
+ * @example Custom navigation
181
+ * ```html
182
+ * <com-carousel>
183
+ * <div comCarouselItem>Slide 1</div>
184
+ * <ng-template comCarouselPrev let-canGo>
185
+ * <button [disabled]="!canGo">Back</button>
186
+ * </ng-template>
187
+ * <ng-template comCarouselNext let-canGo>
188
+ * <button [disabled]="!canGo">Forward</button>
189
+ * </ng-template>
190
+ * </com-carousel>
191
+ * ```
192
+ *
193
+ * @example Custom pagination
194
+ * ```html
195
+ * <com-carousel>
196
+ * <div comCarouselItem>Slide 1</div>
197
+ * <ng-template comCarouselPagination let-idx let-active="active">
198
+ * <span [class]="active ? 'bg-primary' : 'bg-muted'" class="h-3 w-3 rounded-pill inline-block"></span>
199
+ * </ng-template>
200
+ * </com-carousel>
201
+ * ```
202
+ */
203
+ declare class ComCarouselComponent {
204
+ private readonly destroyRef;
205
+ private readonly renderer;
206
+ private readonly platform;
207
+ private readonly hostEl;
208
+ /** Number of items visible at once. */
209
+ readonly slidesPerView: InputSignal<number>;
210
+ /** Wrap from last to first and vice versa. */
211
+ readonly loop: InputSignalWithTransform<boolean, unknown>;
212
+ /** Enable auto-advancing slides. */
213
+ readonly autoPlay: InputSignalWithTransform<boolean, unknown>;
214
+ /** Auto-play interval in milliseconds. */
215
+ readonly autoPlayInterval: InputSignal<number>;
216
+ /** Slide transition duration in milliseconds. */
217
+ readonly transitionDuration: InputSignal<number>;
218
+ /** Show prev/next navigation buttons. */
219
+ readonly showNavigation: InputSignalWithTransform<boolean, unknown>;
220
+ /** Show pagination dot indicators. */
221
+ readonly showPagination: InputSignalWithTransform<boolean, unknown>;
222
+ /** Accessible label for the carousel region. */
223
+ readonly ariaLabel: InputSignal<string>;
224
+ /** Two-way bindable current screen index. */
225
+ readonly index: ModelSignal<number>;
226
+ readonly items: Signal<readonly ComCarouselItem[]>;
227
+ readonly customPrev: Signal<ComCarouselPrevTpl | undefined>;
228
+ readonly customNext: Signal<ComCarouselNextTpl | undefined>;
229
+ readonly customPagination: Signal<ComCarouselPaginationTpl | undefined>;
230
+ readonly trackEl: Signal<ElementRef<HTMLElement> | undefined>;
231
+ private readonly paused;
232
+ readonly animating: WritableSignal<boolean>;
233
+ private autoPlayTimerId;
234
+ readonly totalSlides: Signal<number>;
235
+ /** Total number of screens (pages). */
236
+ readonly totalScreens: Signal<number>;
237
+ readonly maxIndex: Signal<number>;
238
+ /** Clamp index when items or slidesPerView changes. */
239
+ readonly clampedIndex: Signal<number>;
240
+ readonly canGoPrev: Signal<boolean>;
241
+ readonly canGoNext: Signal<boolean>;
242
+ readonly pages: Signal<number[]>;
243
+ /** Percentage-based translateX — each screen step moves by 100%. */
244
+ readonly translateX: Signal<string>;
245
+ /** Item width as a percentage string. */
246
+ private readonly itemWidth;
247
+ readonly ariaLiveMode: Signal<string>;
248
+ readonly containerClasses: Signal<string>;
249
+ readonly prevButtonClasses: Signal<string>;
250
+ readonly nextButtonClasses: Signal<string>;
251
+ readonly prevContext: Signal<CarouselPrevContext>;
252
+ readonly nextContext: Signal<CarouselNextContext>;
253
+ constructor();
254
+ /** Navigate to the next screen. */
255
+ next(): void;
256
+ /** Navigate to the previous screen. */
257
+ prev(): void;
258
+ /** Navigate to a specific page index. */
259
+ goToPage(pageIndex: number): void;
260
+ /** Get CVA classes for a pagination dot at the given index. */
261
+ getDotClasses(pageIndex: number): string;
262
+ /** Build template context for a custom pagination dot. */
263
+ getPaginationContext(pageIndex: number): CarouselPaginationContext;
264
+ /** Handle keyboard navigation on pagination dots. */
265
+ onPaginationKeydown(event: KeyboardEvent, currentIndex: number): void;
266
+ protected pauseAutoPlay(): void;
267
+ protected resumeAutoPlay(): void;
268
+ private clearAutoPlay;
269
+ private swipeCleanupFns;
270
+ private pointerStartX;
271
+ private pointerStartY;
272
+ private isSwiping;
273
+ private setupSwipe;
274
+ private cleanupSwipe;
275
+ private focusDotAt;
276
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCarouselComponent, never>;
277
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComCarouselComponent, "com-carousel", never, { "slidesPerView": { "alias": "slidesPerView"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "autoPlay": { "alias": "autoPlay"; "required": false; "isSignal": true; }; "autoPlayInterval": { "alias": "autoPlayInterval"; "required": false; "isSignal": true; }; "transitionDuration": { "alias": "transitionDuration"; "required": false; "isSignal": true; }; "showNavigation": { "alias": "showNavigation"; "required": false; "isSignal": true; }; "showPagination": { "alias": "showPagination"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; }, { "index": "indexChange"; }, ["items", "customPrev", "customNext", "customPagination"], ["[comCarouselItem]"], true, never>;
278
+ }
279
+
280
+ export { ComCarouselComponent, ComCarouselItem, ComCarouselNextTpl, ComCarouselPaginationTpl, ComCarouselPrevTpl, carouselContainerVariants, carouselDotVariants, carouselNavButtonVariants };
281
+ export type { CarouselDotVariants, CarouselNavButtonVariants, CarouselNextContext, CarouselPaginationContext, CarouselPrevContext };
@@ -0,0 +1,66 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InputSignal, OutputEmitterRef, WritableSignal, Signal } from '@angular/core';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ type CodeBlockVariant = 'filled' | 'outlined';
6
+ /**
7
+ * CVA variants for the code block container.
8
+ *
9
+ * @tokens `--color-muted`, `--color-foreground`,
10
+ * `--color-border`, `--color-border-subtle`,
11
+ * `--radius-card`, `--font-mono`
12
+ */
13
+ declare const codeBlockVariants: (props?: {
14
+ variant?: CodeBlockVariant;
15
+ }) => string;
16
+ type CodeBlockVariants = VariantProps<typeof codeBlockVariants>;
17
+
18
+ /**
19
+ * Code block component for displaying code snippets with a language label
20
+ * and copy-to-clipboard functionality.
21
+ *
22
+ * Renders plain monospace text in a styled container — no syntax highlighting.
23
+ * The header bar shows an optional language label and a copy button that
24
+ * provides visual feedback (checkmark icon for 2 seconds) after copying.
25
+ *
26
+ * @tokens `--color-muted`, `--color-muted-foreground`, `--color-muted-hover`,
27
+ * `--color-foreground`, `--color-border`, `--color-border-subtle`,
28
+ * `--color-ring`, `--color-success`,
29
+ * `--font-mono`, `--radius-card`
30
+ *
31
+ * @example Basic usage with language label
32
+ * ```html
33
+ * <com-code-block code="const x = 42;" language="TypeScript" />
34
+ * ```
35
+ *
36
+ * @example Outlined variant
37
+ * ```html
38
+ * <com-code-block [code]="htmlSnippet" language="HTML" variant="outlined" />
39
+ * ```
40
+ */
41
+ declare class ComCodeBlockComponent {
42
+ /** The raw code string to display. */
43
+ readonly code: InputSignal<string>;
44
+ /** Language label shown in the header (e.g. 'TypeScript', 'HTML'). */
45
+ readonly language: InputSignal<string | undefined>;
46
+ /** Visual variant. */
47
+ readonly variant: InputSignal<CodeBlockVariant>;
48
+ /** Consumer CSS classes — merged with variant classes. */
49
+ readonly userClass: InputSignal<string>;
50
+ /** Emitted when code is successfully copied to clipboard. */
51
+ readonly copied: OutputEmitterRef<void>;
52
+ /** @internal Tracks copy feedback state. */
53
+ protected readonly isCopied: WritableSignal<boolean>;
54
+ /** @internal Computed host element classes. */
55
+ protected readonly hostClasses: Signal<string>;
56
+ private readonly clipboard;
57
+ private readonly destroyRef;
58
+ private copyTimeoutId;
59
+ /** Copies the code to clipboard and shows feedback for 2 seconds. */
60
+ protected copyToClipboard(): void;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCodeBlockComponent, never>;
62
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComCodeBlockComponent, "com-code-block", ["comCodeBlock"], { "code": { "alias": "code"; "required": true; "isSignal": true; }; "language": { "alias": "language"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "copied": "copied"; }, never, never, true, never>;
63
+ }
64
+
65
+ export { ComCodeBlockComponent, codeBlockVariants };
66
+ export type { CodeBlockVariant, CodeBlockVariants };
@@ -31,7 +31,7 @@ interface ConfirmTemplateContext {
31
31
  * and emits `true` (confirmed) or `false` (cancelled) through its output.
32
32
  *
33
33
  * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,
34
- * `--color-foreground`, `--color-muted-foreground`, `--color-background`,
34
+ * `--color-foreground`, `--color-muted-foreground`, `--color-backdrop`,
35
35
  * `--shadow-lg`, `--radius-popover`
36
36
  *
37
37
  * @example Basic confirmation
@@ -126,7 +126,7 @@ declare class ComConfirm {
126
126
  /**
127
127
  * CVA variants for the confirmation panel backdrop.
128
128
  *
129
- * @tokens `--color-background`
129
+ * @tokens `--color-backdrop`
130
130
  */
131
131
  declare const confirmBackdropVariants: (props?: {
132
132
  visible?: boolean;
@@ -0,0 +1,264 @@
1
+ import { Observable } from 'rxjs';
2
+ import { OverlayRef } from '@angular/cdk/overlay';
3
+ import * as i0 from '@angular/core';
4
+ import { TemplateRef, OnInit, WritableSignal, InputSignal, InjectionToken, Provider } from '@angular/core';
5
+ import { ComponentType } from '@angular/cdk/portal';
6
+ import { VariantProps } from 'class-variance-authority';
7
+
8
+ /**
9
+ * Reference to an open dialog instance.
10
+ * Returned by `ComDialog.open()` for programmatic control.
11
+ */
12
+ declare class ComDialogRef<R = unknown> {
13
+ private readonly afterClosedSubject;
14
+ private readonly backdropClickSubject;
15
+ private closed;
16
+ /** @internal */
17
+ _overlayRef: OverlayRef | null;
18
+ /** @internal */
19
+ _closeFn: ((result?: R) => void) | null;
20
+ /**
21
+ * Close the dialog, optionally passing a result value.
22
+ */
23
+ close(result?: R): void;
24
+ /**
25
+ * Emits the result once after the dialog is fully closed and disposed.
26
+ */
27
+ afterClosed(): Observable<R | undefined>;
28
+ /**
29
+ * Emits each time the backdrop is clicked.
30
+ */
31
+ backdropClick(): Observable<MouseEvent>;
32
+ /**
33
+ * Proxies keydown events from the overlay.
34
+ */
35
+ keydownEvents(): Observable<KeyboardEvent>;
36
+ /** @internal Called by the service after exit animation completes. */
37
+ _notifyClosed(result?: R): void;
38
+ /** @internal Forward backdrop click from overlay. */
39
+ _notifyBackdropClick(event: MouseEvent): void;
40
+ }
41
+
42
+ /** Available dialog size variants. */
43
+ type ComDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
44
+ /** Configuration for opening a dialog. */
45
+ interface ComDialogConfig<D = unknown> {
46
+ /** Data to inject via COM_DIALOG_DATA. */
47
+ data?: D;
48
+ /** Dialog panel width variant. */
49
+ size?: ComDialogSize;
50
+ /** Prevent Escape and backdrop click from closing. */
51
+ disableClose?: boolean;
52
+ /** Show backdrop overlay. */
53
+ hasBackdrop?: boolean;
54
+ /** Additional CSS class on the backdrop. */
55
+ backdropClass?: string;
56
+ /** Additional CSS class on the container panel. */
57
+ panelClass?: string;
58
+ /** Where to send focus on open. */
59
+ autoFocus?: 'first-tabbable' | 'dialog' | false;
60
+ /** Return focus to trigger element on close. */
61
+ restoreFocus?: boolean;
62
+ /** Fallback aria-label if no comDialogTitle is projected. */
63
+ ariaLabel?: string;
64
+ }
65
+ /** Content that can be opened in a dialog. */
66
+ type ComDialogContent$1<T = unknown> = ComponentType<T> | TemplateRef<T>;
67
+ /** Template context when opening a TemplateRef dialog. */
68
+ interface ComDialogTemplateContext<R = unknown, D = unknown> {
69
+ $implicit: ComDialogRef<R>;
70
+ data: D;
71
+ }
72
+
73
+ /**
74
+ * Service for opening dialog modals imperatively.
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const dialog = inject(ComDialog);
79
+ *
80
+ * // Open a component
81
+ * const ref = dialog.open<boolean>(ConfirmComponent, { data: { id: 123 } });
82
+ * ref.afterClosed().subscribe(result => {
83
+ * if (result) performAction();
84
+ * });
85
+ *
86
+ * // Open a template
87
+ * dialog.open(templateRef, { size: 'sm' });
88
+ * ```
89
+ */
90
+ declare class ComDialog {
91
+ private readonly overlay;
92
+ private readonly injector;
93
+ private readonly destroyRef;
94
+ private readonly platformId;
95
+ private readonly document;
96
+ private readonly globalConfig;
97
+ private readonly openDialogs;
98
+ /**
99
+ * Open a dialog with the given component or template.
100
+ *
101
+ * @param content - The component class or TemplateRef to render inside the dialog.
102
+ * @param config - Optional dialog configuration.
103
+ * @returns A reference to the opened dialog.
104
+ */
105
+ open<R = unknown, D = unknown>(content: ComDialogContent$1, config?: ComDialogConfig<D>): ComDialogRef<R>;
106
+ /** Close all open dialogs. */
107
+ closeAll(): void;
108
+ /** Number of currently open dialogs. */
109
+ get openDialogCount(): number;
110
+ private resolveConfig;
111
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComDialog, never>;
112
+ static ɵprov: i0.ɵɵInjectableDeclaration<ComDialog>;
113
+ }
114
+
115
+ /**
116
+ * Marks an element as the dialog title. Sets up aria-labelledby
117
+ * binding on the dialog container.
118
+ *
119
+ * @example
120
+ * ```html
121
+ * <h2 comDialogTitle>Delete item</h2>
122
+ * ```
123
+ *
124
+ * @tokens `--color-foreground`
125
+ */
126
+ declare class ComDialogTitle implements OnInit {
127
+ private readonly containerRef;
128
+ /** Unique ID for aria-labelledby binding. */
129
+ readonly id: WritableSignal<string>;
130
+ /** Computed CSS classes. */
131
+ readonly classes: WritableSignal<string>;
132
+ ngOnInit(): void;
133
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComDialogTitle, never>;
134
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComDialogTitle, "[comDialogTitle]", ["comDialogTitle"], {}, {}, never, never, true, never>;
135
+ }
136
+
137
+ /**
138
+ * Marks an element as the dialog content area. Sets up aria-describedby
139
+ * binding on the dialog container.
140
+ *
141
+ * @example
142
+ * ```html
143
+ * <div comDialogContent>
144
+ * <p>Are you sure you want to delete this item?</p>
145
+ * </div>
146
+ * ```
147
+ *
148
+ * @tokens `--color-muted-foreground`
149
+ */
150
+ declare class ComDialogContent implements OnInit {
151
+ private readonly containerRef;
152
+ /** Unique ID for aria-describedby binding. */
153
+ readonly id: WritableSignal<string>;
154
+ /** Computed CSS classes. */
155
+ readonly classes: WritableSignal<string>;
156
+ ngOnInit(): void;
157
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComDialogContent, never>;
158
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComDialogContent, "[comDialogContent]", ["comDialogContent"], {}, {}, never, never, true, never>;
159
+ }
160
+
161
+ /**
162
+ * Marks an element as the dialog actions area (footer with buttons).
163
+ *
164
+ * @example
165
+ * ```html
166
+ * <div comDialogActions>
167
+ * <button comButton variant="outline" [comDialogClose]="false">Cancel</button>
168
+ * <button comButton [comDialogClose]="true">Confirm</button>
169
+ * </div>
170
+ * ```
171
+ */
172
+ declare class ComDialogActions {
173
+ /** Computed CSS classes. */
174
+ readonly classes: WritableSignal<string>;
175
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComDialogActions, never>;
176
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComDialogActions, "[comDialogActions]", ["comDialogActions"], {}, {}, never, never, true, never>;
177
+ }
178
+
179
+ /**
180
+ * Closes the nearest dialog when the host element is clicked.
181
+ * Optionally passes a result value.
182
+ *
183
+ * @example
184
+ * ```html
185
+ * <button comButton [comDialogClose]="false">Cancel</button>
186
+ * <button comButton [comDialogClose]="true">Confirm</button>
187
+ * ```
188
+ */
189
+ declare class ComDialogClose {
190
+ private readonly dialogRef;
191
+ /** The result value to pass when closing the dialog. */
192
+ readonly comDialogClose: InputSignal<unknown>;
193
+ protected onClick(): void;
194
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComDialogClose, never>;
195
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComDialogClose, "[comDialogClose]", ["comDialogClose"], { "comDialogClose": { "alias": "comDialogClose"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
196
+ }
197
+
198
+ /**
199
+ * Injection token for data passed to a dialog component.
200
+ *
201
+ * @example
202
+ * ```typescript
203
+ * readonly data = inject<MyData>(COM_DIALOG_DATA);
204
+ * ```
205
+ */
206
+ declare const COM_DIALOG_DATA: InjectionToken<unknown>;
207
+ /**
208
+ * Injection token for global dialog configuration defaults.
209
+ * @internal
210
+ */
211
+ declare const COM_DIALOG_CONFIG: InjectionToken<ComDialogConfig>;
212
+ /**
213
+ * Provides global dialog configuration defaults.
214
+ *
215
+ * @example
216
+ * ```typescript
217
+ * bootstrapApplication(AppComponent, {
218
+ * providers: [
219
+ * provideComDialogConfig({ size: 'lg', hasBackdrop: true }),
220
+ * ],
221
+ * });
222
+ * ```
223
+ */
224
+ declare function provideComDialogConfig(config: ComDialogConfig): Provider;
225
+
226
+ /**
227
+ * CVA variants for the dialog backdrop.
228
+ *
229
+ * @tokens `--color-backdrop`
230
+ */
231
+ declare const dialogBackdropVariants: (props?: {
232
+ visible?: boolean;
233
+ }) => string;
234
+ /**
235
+ * CVA variants for the dialog panel container.
236
+ *
237
+ * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,
238
+ * `--shadow-xl`, `--radius-overlay`
239
+ */
240
+ declare const dialogPanelVariants: (props?: {
241
+ size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
242
+ visible?: boolean;
243
+ }) => string;
244
+ /** Type helper for dialog panel variant props. */
245
+ type DialogPanelVariantProps = VariantProps<typeof dialogPanelVariants>;
246
+ /**
247
+ * CVA variants for the dialog title.
248
+ *
249
+ * @tokens `--color-foreground`
250
+ */
251
+ declare const dialogTitleVariants: () => string;
252
+ /**
253
+ * CVA variants for the dialog content area.
254
+ *
255
+ * @tokens `--color-muted-foreground`
256
+ */
257
+ declare const dialogContentVariants: () => string;
258
+ /**
259
+ * CVA variants for the dialog actions area.
260
+ */
261
+ declare const dialogActionsVariants: () => string;
262
+
263
+ export { COM_DIALOG_CONFIG, COM_DIALOG_DATA, ComDialog, ComDialogActions, ComDialogClose, ComDialogContent, ComDialogRef, ComDialogTitle, dialogActionsVariants, dialogBackdropVariants, dialogContentVariants, dialogPanelVariants, dialogTitleVariants, provideComDialogConfig };
264
+ export type { ComDialogConfig, ComDialogSize, ComDialogTemplateContext, DialogPanelVariantProps };