ngx-com 0.0.1 → 0.0.4

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 (82) hide show
  1. package/fesm2022/ngx-com-components-avatar.mjs +772 -0
  2. package/fesm2022/ngx-com-components-avatar.mjs.map +1 -0
  3. package/fesm2022/ngx-com-components-badge.mjs +138 -0
  4. package/fesm2022/ngx-com-components-badge.mjs.map +1 -0
  5. package/fesm2022/ngx-com-components-button.mjs +146 -0
  6. package/fesm2022/ngx-com-components-button.mjs.map +1 -0
  7. package/fesm2022/ngx-com-components-calendar.mjs +5046 -0
  8. package/fesm2022/ngx-com-components-calendar.mjs.map +1 -0
  9. package/fesm2022/ngx-com-components-card.mjs +590 -0
  10. package/fesm2022/ngx-com-components-card.mjs.map +1 -0
  11. package/fesm2022/ngx-com-components-checkbox.mjs +344 -0
  12. package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -0
  13. package/fesm2022/ngx-com-components-collapsible.mjs +612 -0
  14. package/fesm2022/ngx-com-components-collapsible.mjs.map +1 -0
  15. package/fesm2022/ngx-com-components-confirm.mjs +562 -0
  16. package/fesm2022/ngx-com-components-confirm.mjs.map +1 -0
  17. package/fesm2022/ngx-com-components-dropdown-testing.mjs +255 -0
  18. package/fesm2022/ngx-com-components-dropdown-testing.mjs.map +1 -0
  19. package/fesm2022/ngx-com-components-dropdown.mjs +2692 -0
  20. package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -0
  21. package/fesm2022/ngx-com-components-empty-state.mjs +382 -0
  22. package/fesm2022/ngx-com-components-empty-state.mjs.map +1 -0
  23. package/fesm2022/ngx-com-components-form-field.mjs +924 -0
  24. package/fesm2022/ngx-com-components-form-field.mjs.map +1 -0
  25. package/fesm2022/ngx-com-components-icon.mjs +183 -0
  26. package/fesm2022/ngx-com-components-icon.mjs.map +1 -0
  27. package/fesm2022/ngx-com-components-item.mjs +578 -0
  28. package/fesm2022/ngx-com-components-item.mjs.map +1 -0
  29. package/fesm2022/ngx-com-components-menu.mjs +1200 -0
  30. package/fesm2022/ngx-com-components-menu.mjs.map +1 -0
  31. package/fesm2022/ngx-com-components-paginator.mjs +823 -0
  32. package/fesm2022/ngx-com-components-paginator.mjs.map +1 -0
  33. package/fesm2022/ngx-com-components-popover.mjs +901 -0
  34. package/fesm2022/ngx-com-components-popover.mjs.map +1 -0
  35. package/fesm2022/ngx-com-components-radio.mjs +621 -0
  36. package/fesm2022/ngx-com-components-radio.mjs.map +1 -0
  37. package/fesm2022/ngx-com-components-segmented-control.mjs +538 -0
  38. package/fesm2022/ngx-com-components-segmented-control.mjs.map +1 -0
  39. package/fesm2022/ngx-com-components-sort.mjs +368 -0
  40. package/fesm2022/ngx-com-components-sort.mjs.map +1 -0
  41. package/fesm2022/ngx-com-components-spinner.mjs +189 -0
  42. package/fesm2022/ngx-com-components-spinner.mjs.map +1 -0
  43. package/fesm2022/ngx-com-components-tabs.mjs +1522 -0
  44. package/fesm2022/ngx-com-components-tabs.mjs.map +1 -0
  45. package/fesm2022/ngx-com-components-tooltip.mjs +625 -0
  46. package/fesm2022/ngx-com-components-tooltip.mjs.map +1 -0
  47. package/fesm2022/ngx-com-components.mjs +17 -0
  48. package/fesm2022/ngx-com-components.mjs.map +1 -0
  49. package/fesm2022/ngx-com-tokens.mjs +12 -0
  50. package/fesm2022/ngx-com-tokens.mjs.map +1 -0
  51. package/fesm2022/ngx-com-utils.mjs +601 -0
  52. package/fesm2022/ngx-com-utils.mjs.map +1 -0
  53. package/fesm2022/ngx-com.mjs +9 -23
  54. package/fesm2022/ngx-com.mjs.map +1 -1
  55. package/package.json +105 -1
  56. package/types/ngx-com-components-avatar.d.ts +409 -0
  57. package/types/ngx-com-components-badge.d.ts +97 -0
  58. package/types/ngx-com-components-button.d.ts +69 -0
  59. package/types/ngx-com-components-calendar.d.ts +1665 -0
  60. package/types/ngx-com-components-card.d.ts +373 -0
  61. package/types/ngx-com-components-checkbox.d.ts +116 -0
  62. package/types/ngx-com-components-collapsible.d.ts +379 -0
  63. package/types/ngx-com-components-confirm.d.ts +160 -0
  64. package/types/ngx-com-components-dropdown-testing.d.ts +116 -0
  65. package/types/ngx-com-components-dropdown.d.ts +938 -0
  66. package/types/ngx-com-components-empty-state.d.ts +269 -0
  67. package/types/ngx-com-components-form-field.d.ts +531 -0
  68. package/types/ngx-com-components-icon.d.ts +94 -0
  69. package/types/ngx-com-components-item.d.ts +336 -0
  70. package/types/ngx-com-components-menu.d.ts +479 -0
  71. package/types/ngx-com-components-paginator.d.ts +265 -0
  72. package/types/ngx-com-components-popover.d.ts +309 -0
  73. package/types/ngx-com-components-radio.d.ts +258 -0
  74. package/types/ngx-com-components-segmented-control.d.ts +274 -0
  75. package/types/ngx-com-components-sort.d.ts +133 -0
  76. package/types/ngx-com-components-spinner.d.ts +120 -0
  77. package/types/ngx-com-components-tabs.d.ts +396 -0
  78. package/types/ngx-com-components-tooltip.d.ts +200 -0
  79. package/types/ngx-com-components.d.ts +12 -0
  80. package/types/ngx-com-tokens.d.ts +7 -0
  81. package/types/ngx-com-utils.d.ts +424 -0
  82. package/types/ngx-com.d.ts +10 -7
@@ -0,0 +1,379 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as i0 from '@angular/core';
3
+ import { TemplateRef, ModelSignal, InputSignalWithTransform, InputSignal, Signal, WritableSignal } from '@angular/core';
4
+
5
+ /**
6
+ * Context provided to the trigger template.
7
+ */
8
+ interface ComCollapsibleTriggerContext {
9
+ /** Current open state (alias for $implicit). */
10
+ $implicit: boolean;
11
+ /** Current open state. */
12
+ open: boolean;
13
+ /** Whether the collapsible is disabled. */
14
+ disabled: boolean;
15
+ /** Function to toggle the collapsible. */
16
+ toggle: () => void;
17
+ }
18
+ /**
19
+ * Context provided to the content template.
20
+ */
21
+ interface ComCollapsibleContentContext {
22
+ /** Current open state (alias for $implicit). */
23
+ $implicit: boolean;
24
+ /** Current open state. */
25
+ open: boolean;
26
+ }
27
+ /**
28
+ * Context provided to the icon template.
29
+ */
30
+ interface ComCollapsibleIconContext {
31
+ /** Current open state (alias for $implicit). */
32
+ $implicit: boolean;
33
+ /** Current open state. */
34
+ open: boolean;
35
+ }
36
+
37
+ /**
38
+ * Shell variant type for the collapsible container.
39
+ */
40
+ type CollapsibleVariant = 'card' | 'bordered' | 'flush' | 'ghost' | 'unstyled';
41
+ /**
42
+ * CVA variants for the collapsible shell (root directive).
43
+ *
44
+ * @tokens `--color-border`, `--color-background`, `--color-foreground`, `--shadow-xs`, `--radius-collapsible`
45
+ */
46
+ declare const collapsibleVariants: (props?: {
47
+ variant?: CollapsibleVariant;
48
+ }) => string;
49
+ type CollapsibleVariants = VariantProps<typeof collapsibleVariants>;
50
+
51
+ /**
52
+ * Trigger variant type for the collapsible trigger.
53
+ */
54
+ type CollapsibleTriggerVariant = 'ghost' | 'filled' | 'header' | 'unstyled';
55
+ /**
56
+ * Trigger size type.
57
+ */
58
+ type CollapsibleTriggerSize = 'sm' | 'default' | 'lg';
59
+ /**
60
+ * CVA variants for the collapsible trigger directive.
61
+ *
62
+ * @tokens `--color-foreground`, `--color-muted`, `--color-muted-foreground`, `--color-muted-hover`,
63
+ * `--color-ring`, `--color-disabled-foreground`, `--radius-collapsible`
64
+ */
65
+ declare const collapsibleTriggerVariants: (props?: {
66
+ variant?: CollapsibleTriggerVariant;
67
+ size?: CollapsibleTriggerSize;
68
+ }) => string;
69
+ type CollapsibleTriggerVariants = VariantProps<typeof collapsibleTriggerVariants>;
70
+
71
+ /**
72
+ * Directive to mark a template as the custom trigger layout template.
73
+ * Replaces the inner content of the trigger while preserving ARIA and keyboard handling.
74
+ *
75
+ * @example
76
+ * ```html
77
+ * <button comCollapsibleTrigger>
78
+ * <ng-template comCollapsibleTriggerTpl let-open let-toggle="toggle" let-disabled="disabled">
79
+ * <div class="flex items-center gap-3 w-full">
80
+ * <span class="h-2 w-2 rounded-full" [class]="open ? 'bg-success' : 'bg-muted'"></span>
81
+ * <span class="font-medium">Notifications</span>
82
+ * <svg class="com-collapsible-icon h-4 w-4" [attr.data-state]="open ? 'open' : 'closed'">
83
+ * <!-- chevron icon -->
84
+ * </svg>
85
+ * </div>
86
+ * </ng-template>
87
+ * </button>
88
+ * ```
89
+ */
90
+ declare class ComCollapsibleTriggerTpl {
91
+ /** Reference to the template. */
92
+ readonly templateRef: TemplateRef<ComCollapsibleTriggerContext>;
93
+ /**
94
+ * Static type guard for template type checking.
95
+ * Enables type-safe access to context properties in templates.
96
+ */
97
+ static ngTemplateContextGuard(_dir: ComCollapsibleTriggerTpl, ctx: unknown): ctx is ComCollapsibleTriggerContext;
98
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCollapsibleTriggerTpl, never>;
99
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCollapsibleTriggerTpl, "ng-template[comCollapsibleTriggerTpl]", never, {}, {}, never, never, true, never>;
100
+ }
101
+
102
+ /**
103
+ * Directive to mark a template as the custom content chrome template.
104
+ * Wraps the content with custom chrome (headers, footers, padding).
105
+ * The grid animation still applies on the host.
106
+ *
107
+ * @example
108
+ * ```html
109
+ * <com-collapsible-content>
110
+ * <ng-template comCollapsibleContentTpl let-open="open">
111
+ * <div class="border-t border-border">
112
+ * <div class="p-4 space-y-3">
113
+ * <!-- Content here -->
114
+ * </div>
115
+ * <div class="flex justify-end gap-2 px-4 py-3 border-t border-border-subtle bg-muted">
116
+ * <button>Reset</button>
117
+ * <button>Apply</button>
118
+ * </div>
119
+ * </div>
120
+ * </ng-template>
121
+ * </com-collapsible-content>
122
+ * ```
123
+ */
124
+ declare class ComCollapsibleContentTpl {
125
+ /** Reference to the template. */
126
+ readonly templateRef: TemplateRef<ComCollapsibleContentContext>;
127
+ /**
128
+ * Static type guard for template type checking.
129
+ * Enables type-safe access to context properties in templates.
130
+ */
131
+ static ngTemplateContextGuard(_dir: ComCollapsibleContentTpl, ctx: unknown): ctx is ComCollapsibleContentContext;
132
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCollapsibleContentTpl, never>;
133
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCollapsibleContentTpl, "ng-template[comCollapsibleContentTpl]", never, {}, {}, never, never, true, never>;
134
+ }
135
+
136
+ /**
137
+ * Directive to mark a template as the custom icon template.
138
+ * Replaces only the chevron icon inside the default trigger layout.
139
+ *
140
+ * @example
141
+ * ```html
142
+ * <button comCollapsibleTrigger>
143
+ * Settings
144
+ * <ng-template comCollapsibleIcon let-open="open">
145
+ * <span class="text-muted-foreground text-xs">{{ open ? '▲' : '▼' }}</span>
146
+ * </ng-template>
147
+ * </button>
148
+ * ```
149
+ */
150
+ declare class ComCollapsibleIconTpl {
151
+ /** Reference to the template. */
152
+ readonly templateRef: TemplateRef<ComCollapsibleIconContext>;
153
+ /**
154
+ * Static type guard for template type checking.
155
+ * Enables type-safe access to context properties in templates.
156
+ */
157
+ static ngTemplateContextGuard(_dir: ComCollapsibleIconTpl, ctx: unknown): ctx is ComCollapsibleIconContext;
158
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCollapsibleIconTpl, never>;
159
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCollapsibleIconTpl, "ng-template[comCollapsibleIcon]", never, {}, {}, never, never, true, never>;
160
+ }
161
+
162
+ /**
163
+ * Structural directive for lazy content rendering.
164
+ * Content is only instantiated on first expand, preserving state on subsequent toggles.
165
+ *
166
+ * @example
167
+ * ```html
168
+ * <com-collapsible-content>
169
+ * <ng-template comCollapsibleLazy>
170
+ * <app-heavy-chart [data]="chartData()" />
171
+ * </ng-template>
172
+ * </com-collapsible-content>
173
+ * ```
174
+ */
175
+ declare class ComCollapsibleLazy {
176
+ /** Reference to the template. */
177
+ readonly templateRef: TemplateRef<void>;
178
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCollapsibleLazy, never>;
179
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCollapsibleLazy, "ng-template[comCollapsibleLazy]", never, {}, {}, never, never, true, never>;
180
+ }
181
+
182
+ /**
183
+ * Root collapsible directive — manages state and provides shell styling.
184
+ *
185
+ * Works as a DI anchor for child directives (trigger, content).
186
+ * Exposes programmatic control via template reference.
187
+ *
188
+ * @tokens `--color-border`, `--color-background`, `--color-foreground`, `--shadow-xs`
189
+ *
190
+ * @example Basic usage
191
+ * ```html
192
+ * <div comCollapsible variant="card">
193
+ * <button comCollapsibleTrigger>Section Title</button>
194
+ * <com-collapsible-content>
195
+ * <div class="p-4">Content here.</div>
196
+ * </com-collapsible-content>
197
+ * </div>
198
+ * ```
199
+ *
200
+ * @example Two-way binding with external control
201
+ * ```html
202
+ * <div comCollapsible [(open)]="sectionOpen" #section="comCollapsible">
203
+ * <button comCollapsibleTrigger>Advanced</button>
204
+ * <com-collapsible-content>...</com-collapsible-content>
205
+ * </div>
206
+ * <button (click)="section.toggle()">Toggle externally</button>
207
+ * ```
208
+ */
209
+ declare class ComCollapsible {
210
+ /** Unique ID for the collapsible instance. */
211
+ private readonly id;
212
+ /** ID for the trigger element (used for aria-labelledby). */
213
+ readonly triggerId: string;
214
+ /** ID for the content panel (used for aria-controls). */
215
+ readonly contentId: string;
216
+ /** Two-way bound open state. */
217
+ readonly open: ModelSignal<boolean>;
218
+ /** Disables the collapsible, preventing state changes. */
219
+ readonly disabled: InputSignalWithTransform<boolean, unknown>;
220
+ /** Shell preset variant. */
221
+ readonly variant: InputSignal<CollapsibleVariant>;
222
+ /** Consumer CSS classes — merged with variant classes. */
223
+ readonly userClass: InputSignal<string>;
224
+ /** @internal Computed host class from CVA + consumer overrides. */
225
+ protected readonly computedClass: Signal<string>;
226
+ /** Returns the current open state. */
227
+ isOpen(): boolean;
228
+ /** Returns the current disabled state. */
229
+ isDisabled(): boolean;
230
+ /** Toggles the open state (if not disabled). */
231
+ toggle(): void;
232
+ /** Expands the collapsible (if not disabled). */
233
+ expand(): void;
234
+ /** Collapses the collapsible (if not disabled). */
235
+ collapse(): void;
236
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCollapsible, never>;
237
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComCollapsible, "[comCollapsible]", ["comCollapsible"], { "open": { "alias": "open"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, never, true, never>;
238
+ }
239
+
240
+ /**
241
+ * Collapsible trigger component — handles toggle interaction, ARIA, keyboard, and template rendering.
242
+ *
243
+ * Uses attribute selector so it can be applied to `<button>` or any focusable element.
244
+ * Injects the parent `ComCollapsible` directive to access state.
245
+ * Supports custom trigger layout via `comCollapsibleTriggerTpl` and custom icon via `comCollapsibleIcon`.
246
+ *
247
+ * @tokens `--color-foreground`, `--color-muted`, `--color-muted-foreground`, `--color-muted-hover`,
248
+ * `--color-ring`, `--color-disabled-foreground`
249
+ *
250
+ * @example Default trigger with auto icon
251
+ * ```html
252
+ * <button comCollapsibleTrigger>Section Title</button>
253
+ * ```
254
+ *
255
+ * @example Without icon
256
+ * ```html
257
+ * <button comCollapsibleTrigger [showIcon]="false">Section Title</button>
258
+ * ```
259
+ *
260
+ * @example With custom icon
261
+ * ```html
262
+ * <button comCollapsibleTrigger>
263
+ * Settings
264
+ * <ng-template comCollapsibleIcon let-open="open">
265
+ * <span class="text-xs text-muted-foreground">{{ open ? '▲' : '▼' }}</span>
266
+ * </ng-template>
267
+ * </button>
268
+ * ```
269
+ *
270
+ * @example Full trigger layout override
271
+ * ```html
272
+ * <button comCollapsibleTrigger>
273
+ * <ng-template comCollapsibleTriggerTpl let-open let-toggle="toggle">
274
+ * <div class="flex items-center gap-3 w-full">
275
+ * <span class="h-2 w-2 rounded-full" [class]="open ? 'bg-success' : 'bg-muted'"></span>
276
+ * <span class="font-medium">Notifications</span>
277
+ * <svg class="com-collapsible-icon h-4 w-4" [attr.data-state]="open ? 'open' : 'closed'">
278
+ * <!-- chevron -->
279
+ * </svg>
280
+ * </div>
281
+ * </ng-template>
282
+ * </button>
283
+ * ```
284
+ */
285
+ declare class ComCollapsibleTrigger {
286
+ /** Parent collapsible directive (provides state). */
287
+ protected readonly collapsible: ComCollapsible;
288
+ /** Custom trigger layout template (replaces inner content). */
289
+ protected readonly triggerTpl: Signal<ComCollapsibleTriggerTpl | undefined>;
290
+ /** Custom icon template (replaces default chevron). */
291
+ protected readonly iconTpl: Signal<ComCollapsibleIconTpl | undefined>;
292
+ /** Trigger preset variant. */
293
+ readonly variant: InputSignal<CollapsibleTriggerVariant>;
294
+ /** Trigger size. */
295
+ readonly size: InputSignal<CollapsibleTriggerSize>;
296
+ /** Show/hide the toggle icon. */
297
+ readonly showIcon: InputSignalWithTransform<boolean, unknown>;
298
+ /** Consumer CSS classes — merged with variant classes. */
299
+ readonly userClass: InputSignal<string>;
300
+ /** @internal Computed host class from CVA + consumer overrides. */
301
+ protected readonly computedClass: Signal<string>;
302
+ /** Context for trigger template. */
303
+ readonly triggerContext: Signal<ComCollapsibleTriggerContext>;
304
+ /** Context for icon template. */
305
+ readonly iconContext: Signal<ComCollapsibleIconContext>;
306
+ /** @internal */
307
+ protected onClick(event: Event): void;
308
+ /** @internal */
309
+ protected onKeydown(event: Event): void;
310
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCollapsibleTrigger, never>;
311
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComCollapsibleTrigger, "[comCollapsibleTrigger]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, ["triggerTpl", "iconTpl"], ["*"], true, never>;
312
+ }
313
+
314
+ /**
315
+ * Collapsible content component — animated panel with region role.
316
+ *
317
+ * Uses CSS grid technique for smooth height animation without JS measurement.
318
+ * Supports lazy rendering via `comCollapsibleLazy` directive.
319
+ *
320
+ * @tokens None (structural only — styling is applied via templates or consumer classes)
321
+ *
322
+ * @example Basic usage
323
+ * ```html
324
+ * <com-collapsible-content>
325
+ * <div class="p-4">Content here.</div>
326
+ * </com-collapsible-content>
327
+ * ```
328
+ *
329
+ * @example With custom duration
330
+ * ```html
331
+ * <com-collapsible-content [duration]="300">
332
+ * <div class="p-4">Slower animation.</div>
333
+ * </com-collapsible-content>
334
+ * ```
335
+ *
336
+ * @example With content chrome template
337
+ * ```html
338
+ * <com-collapsible-content>
339
+ * <ng-template comCollapsibleContentTpl let-open="open">
340
+ * <div class="border-t border-border p-4">
341
+ * <!-- Content with custom chrome -->
342
+ * </div>
343
+ * </ng-template>
344
+ * </com-collapsible-content>
345
+ * ```
346
+ *
347
+ * @example Lazy content
348
+ * ```html
349
+ * <com-collapsible-content>
350
+ * <ng-template comCollapsibleLazy>
351
+ * <app-heavy-component />
352
+ * </ng-template>
353
+ * </com-collapsible-content>
354
+ * ```
355
+ */
356
+ declare class ComCollapsibleContent {
357
+ /** Parent collapsible directive (provides state). */
358
+ protected readonly collapsible: ComCollapsible;
359
+ /** Custom content chrome template. */
360
+ protected readonly contentTpl: Signal<ComCollapsibleContentTpl | undefined>;
361
+ /** Lazy content template. */
362
+ protected readonly lazyTpl: Signal<ComCollapsibleLazy | undefined>;
363
+ /** Track if collapsible has ever been opened (for lazy rendering). */
364
+ protected readonly hasBeenOpened: WritableSignal<boolean>;
365
+ /** Transition duration in milliseconds. */
366
+ readonly duration: InputSignal<number>;
367
+ /** Consumer CSS classes for the inner wrapper. */
368
+ readonly userClass: InputSignal<string>;
369
+ /** @internal Computed inner wrapper class. */
370
+ protected readonly innerClass: Signal<string>;
371
+ /** Context for content template. */
372
+ readonly templateContext: Signal<ComCollapsibleContentContext>;
373
+ constructor();
374
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComCollapsibleContent, never>;
375
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComCollapsibleContent, "com-collapsible-content", never, { "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, ["contentTpl", "lazyTpl"], ["*"], true, never>;
376
+ }
377
+
378
+ export { ComCollapsible, ComCollapsibleContent, ComCollapsibleContentTpl, ComCollapsibleIconTpl, ComCollapsibleLazy, ComCollapsibleTrigger, ComCollapsibleTriggerTpl, collapsibleTriggerVariants, collapsibleVariants };
379
+ export type { CollapsibleTriggerSize, CollapsibleTriggerVariant, CollapsibleTriggerVariants, CollapsibleVariant, CollapsibleVariants, ComCollapsibleContentContext, ComCollapsibleIconContext, ComCollapsibleTriggerContext };
@@ -0,0 +1,160 @@
1
+ import * as i0 from '@angular/core';
2
+ import { WritableSignal, InputSignal, InputSignalWithTransform, TemplateRef, OutputEmitterRef } from '@angular/core';
3
+
4
+ /**
5
+ * Color variant for the confirm button styling.
6
+ */
7
+ type ConfirmColor = 'primary' | 'warn';
8
+ /**
9
+ * Context provided to custom confirmation templates.
10
+ */
11
+ interface ConfirmTemplateContext {
12
+ /** The confirmation message. */
13
+ $implicit: string;
14
+ /** The dialog title, if provided. */
15
+ title: string | undefined;
16
+ /** Function to confirm the action. */
17
+ confirm: () => void;
18
+ /** Function to cancel the action. */
19
+ cancel: () => void;
20
+ /** Whether an async operation is in progress. */
21
+ loading: boolean;
22
+ /** Function to set the loading state. */
23
+ setLoading: (value: boolean) => void;
24
+ }
25
+
26
+ /**
27
+ * Confirmation directive — intercepts clicks and displays a confirmation panel
28
+ * before allowing the action to proceed.
29
+ *
30
+ * The directive acts as an output gate: it captures clicks, shows confirmation UI,
31
+ * and emits `true` (confirmed) or `false` (cancelled) through its output.
32
+ *
33
+ * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,
34
+ * `--color-foreground`, `--color-muted-foreground`, `--color-background`,
35
+ * `--shadow-lg`, `--radius-popover`
36
+ *
37
+ * @example Basic confirmation
38
+ * ```html
39
+ * <button comButton (comConfirm)="onDelete($event)" confirmMessage="Delete this item?">
40
+ * Delete
41
+ * </button>
42
+ * ```
43
+ *
44
+ * @example Destructive action with warn styling
45
+ * ```html
46
+ * <button comButton color="warn"
47
+ * (comConfirm)="onPermanentDelete($event)"
48
+ * confirmTitle="Permanent Deletion"
49
+ * confirmMessage="This action cannot be undone."
50
+ * confirmLabel="Delete Forever"
51
+ * confirmColor="warn">
52
+ * Delete Permanently
53
+ * </button>
54
+ * ```
55
+ *
56
+ * @example Custom template
57
+ * ```html
58
+ * <button comButton (comConfirm)="onAction($event)" [confirmTpl]="customTpl">
59
+ * Action
60
+ * </button>
61
+ *
62
+ * <ng-template #customTpl let-message let-confirm="confirm" let-cancel="cancel">
63
+ * <div class="flex flex-col gap-4">
64
+ * <p>{{ message }}</p>
65
+ * <div class="flex justify-end gap-2">
66
+ * <button comButton variant="ghost" (click)="cancel()">Cancel</button>
67
+ * <button comButton (click)="confirm()">Confirm</button>
68
+ * </div>
69
+ * </div>
70
+ * </ng-template>
71
+ * ```
72
+ */
73
+ declare class ComConfirm {
74
+ private readonly overlay;
75
+ private readonly elementRef;
76
+ private readonly viewContainerRef;
77
+ private readonly injector;
78
+ private readonly destroyRef;
79
+ private readonly platformId;
80
+ private overlayRef;
81
+ private panelInstance;
82
+ private readonly titleId;
83
+ private readonly descriptionId;
84
+ /** Whether the confirmation panel is currently open. */
85
+ protected readonly isOpen: WritableSignal<boolean>;
86
+ /** The confirmation message to display. */
87
+ readonly confirmMessage: InputSignal<string>;
88
+ /** Optional title for the confirmation dialog. */
89
+ readonly confirmTitle: InputSignal<string | undefined>;
90
+ /** Label for the confirm button. */
91
+ readonly confirmLabel: InputSignal<string>;
92
+ /** Label for the cancel button. */
93
+ readonly cancelLabel: InputSignal<string>;
94
+ /** Color variant for the confirm button. */
95
+ readonly confirmColor: InputSignal<ConfirmColor>;
96
+ /** When true, clicks pass through without showing confirmation. */
97
+ readonly confirmDisabled: InputSignalWithTransform<boolean, unknown>;
98
+ /** Whether to show a backdrop behind the panel. */
99
+ readonly confirmBackdrop: InputSignalWithTransform<boolean, unknown>;
100
+ /** Custom template for the panel content. */
101
+ readonly confirmTpl: InputSignal<TemplateRef<ConfirmTemplateContext> | undefined>;
102
+ /**
103
+ * Emits `true` when confirmed, `false` when cancelled or navigated away.
104
+ * This is the main directive output — acts as an output gate for the action.
105
+ */
106
+ readonly comConfirm: OutputEmitterRef<boolean>;
107
+ private readonly panelConfig;
108
+ constructor();
109
+ /** Programmatically open the confirmation dialog. */
110
+ open(): void;
111
+ /** Programmatically close the confirmation dialog (emits false). */
112
+ close(): void;
113
+ protected onTriggerClick(event: Event): void;
114
+ private createOverlay;
115
+ private attachPanel;
116
+ private handleConfirm;
117
+ private handleCancel;
118
+ private closePanel;
119
+ private handleDetachment;
120
+ private disposeOverlay;
121
+ private returnFocusToTrigger;
122
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComConfirm, never>;
123
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComConfirm, "[comConfirm]", ["comConfirm"], { "confirmMessage": { "alias": "confirmMessage"; "required": false; "isSignal": true; }; "confirmTitle": { "alias": "confirmTitle"; "required": false; "isSignal": true; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; "isSignal": true; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; "isSignal": true; }; "confirmColor": { "alias": "confirmColor"; "required": false; "isSignal": true; }; "confirmDisabled": { "alias": "confirmDisabled"; "required": false; "isSignal": true; }; "confirmBackdrop": { "alias": "confirmBackdrop"; "required": false; "isSignal": true; }; "confirmTpl": { "alias": "confirmTpl"; "required": false; "isSignal": true; }; }, { "comConfirm": "comConfirm"; }, never, never, true, never>;
124
+ }
125
+
126
+ /**
127
+ * CVA variants for the confirmation panel backdrop.
128
+ *
129
+ * @tokens `--color-background`
130
+ */
131
+ declare const confirmBackdropVariants: (props?: {
132
+ visible?: boolean;
133
+ }) => string;
134
+ /**
135
+ * CVA variants for the confirmation panel container.
136
+ *
137
+ * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-lg`, `--radius-popover`
138
+ */
139
+ declare const confirmPanelVariants: (props?: {
140
+ visible?: boolean;
141
+ }) => string;
142
+ /**
143
+ * CVA variants for the confirmation panel title.
144
+ *
145
+ * @tokens `--color-foreground`
146
+ */
147
+ declare const confirmTitleVariants: () => string;
148
+ /**
149
+ * CVA variants for the confirmation panel message.
150
+ *
151
+ * @tokens `--color-muted-foreground`
152
+ */
153
+ declare const confirmMessageVariants: () => string;
154
+ /**
155
+ * CVA variants for the confirmation panel footer.
156
+ */
157
+ declare const confirmFooterVariants: () => string;
158
+
159
+ export { ComConfirm, confirmBackdropVariants, confirmFooterVariants, confirmMessageVariants, confirmPanelVariants, confirmTitleVariants };
160
+ export type { ConfirmColor, ConfirmTemplateContext };
@@ -0,0 +1,116 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, TestKey } from '@angular/cdk/testing';
2
+
3
+ /** Harness filters for ComDropdownHarness. */
4
+ interface ComDropdownHarnessFilters extends BaseHarnessFilters {
5
+ /** Filter by the dropdown's placeholder text. */
6
+ placeholder?: string | RegExp;
7
+ /** Filter by whether the dropdown is disabled. */
8
+ disabled?: boolean;
9
+ /** Filter by whether the dropdown is open. */
10
+ open?: boolean;
11
+ }
12
+ /** Harness filters for ComDropdownOptionHarness. */
13
+ interface ComDropdownOptionHarnessFilters extends BaseHarnessFilters {
14
+ /** Filter by the option's text. */
15
+ text?: string | RegExp;
16
+ /** Filter by whether the option is selected. */
17
+ selected?: boolean;
18
+ /** Filter by whether the option is disabled. */
19
+ disabled?: boolean;
20
+ }
21
+ /**
22
+ * Harness for interacting with a dropdown option in tests.
23
+ */
24
+ declare class ComDropdownOptionHarness extends ComponentHarness {
25
+ static hostSelector: string;
26
+ private readonly optionElement;
27
+ /**
28
+ * Gets a HarnessPredicate for matching dropdown options.
29
+ * @param options Filter options.
30
+ */
31
+ static with(options?: ComDropdownOptionHarnessFilters): HarnessPredicate<ComDropdownOptionHarness>;
32
+ /** Gets the option's text content. */
33
+ getText(): Promise<string>;
34
+ /** Whether the option is currently selected. */
35
+ isSelected(): Promise<boolean>;
36
+ /** Whether the option is disabled. */
37
+ isDisabled(): Promise<boolean>;
38
+ /** Whether the option is active (keyboard focused). */
39
+ isActive(): Promise<boolean>;
40
+ /** Clicks the option to select it. */
41
+ click(): Promise<void>;
42
+ /** Hovers over the option. */
43
+ hover(): Promise<void>;
44
+ }
45
+ /**
46
+ * Harness for interacting with a ComDropdown in tests.
47
+ */
48
+ declare class ComDropdownHarness extends ComponentHarness {
49
+ static hostSelector: string;
50
+ private readonly trigger;
51
+ private readonly panel;
52
+ private readonly searchInput;
53
+ private readonly clearButton;
54
+ /**
55
+ * Gets a HarnessPredicate for matching dropdowns.
56
+ * @param options Filter options.
57
+ */
58
+ static with(options?: ComDropdownHarnessFilters): HarnessPredicate<ComDropdownHarness>;
59
+ /** Gets the dropdown's trigger button text. */
60
+ getTriggerText(): Promise<string>;
61
+ /** Whether the dropdown is currently open. */
62
+ isOpen(): Promise<boolean>;
63
+ /** Whether the dropdown is disabled. */
64
+ isDisabled(): Promise<boolean>;
65
+ /** Whether the dropdown has a value selected. */
66
+ hasValue(): Promise<boolean>;
67
+ /** Opens the dropdown if it's closed. */
68
+ open(): Promise<void>;
69
+ /** Closes the dropdown if it's open. */
70
+ close(): Promise<void>;
71
+ /** Clicks the dropdown trigger. */
72
+ click(): Promise<void>;
73
+ /** Clears the current selection. */
74
+ clear(): Promise<void>;
75
+ /** Sends keyboard input to the dropdown. */
76
+ sendKeys(...keys: (string | TestKey)[]): Promise<void>;
77
+ /** Gets all options in the dropdown. */
78
+ getOptions(filters?: ComDropdownOptionHarnessFilters): Promise<ComDropdownOptionHarness[]>;
79
+ /** Gets an option by its text. */
80
+ getOption(text: string | RegExp): Promise<ComDropdownOptionHarness | null>;
81
+ /** Selects an option by its text. */
82
+ selectOption(text: string | RegExp): Promise<void>;
83
+ /** Gets the currently selected option(s). */
84
+ getSelectedOptions(): Promise<ComDropdownOptionHarness[]>;
85
+ /** Whether the dropdown has a search input. */
86
+ isSearchable(): Promise<boolean>;
87
+ /** Gets the current search query. */
88
+ getSearchQuery(): Promise<string>;
89
+ /** Types in the search input. */
90
+ search(query: string): Promise<void>;
91
+ /** Clears the search input. */
92
+ clearSearch(): Promise<void>;
93
+ /** Gets the number of visible options. */
94
+ getOptionsCount(): Promise<number>;
95
+ /** Gets all option texts. */
96
+ getOptionTexts(): Promise<string[]>;
97
+ /** Navigates to an option using keyboard. */
98
+ navigateToOption(direction: 'up' | 'down', times?: number): Promise<void>;
99
+ /** Selects the currently active option. */
100
+ selectActiveOption(): Promise<void>;
101
+ /** Gets the ID of the active descendant. */
102
+ getActiveDescendantId(): Promise<string | null>;
103
+ /** Gets the panel ID. */
104
+ getPanelId(): Promise<string | null>;
105
+ /** Gets the aria-controls value from the trigger. */
106
+ getAriaControls(): Promise<string | null>;
107
+ /** Focuses the dropdown trigger. */
108
+ focus(): Promise<void>;
109
+ /** Blurs the dropdown trigger. */
110
+ blur(): Promise<void>;
111
+ /** Whether the dropdown trigger is focused. */
112
+ isFocused(): Promise<boolean>;
113
+ }
114
+
115
+ export { ComDropdownHarness, ComDropdownOptionHarness };
116
+ export type { ComDropdownHarnessFilters, ComDropdownOptionHarnessFilters };