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,336 @@
1
+ import * as i0 from '@angular/core';
2
+ import { TemplateRef, InputSignal, InputSignalWithTransform, Signal } from '@angular/core';
3
+ import { AvatarSize, AvatarColor } from 'ngx-com/components/avatar';
4
+ import { IconSize } from 'ngx-com/components/icon';
5
+ import { VariantProps } from 'class-variance-authority';
6
+
7
+ /**
8
+ * Marker directive for projecting custom leading content into a com-item.
9
+ *
10
+ * When this directive is present, it completely replaces the default
11
+ * leading visual (which would otherwise be a com-avatar with an icon).
12
+ * Use this for custom avatars (with images or initials), bare icons,
13
+ * custom images, or any other leading visual.
14
+ *
15
+ * @example Custom avatar with image
16
+ * ```html
17
+ * <com-item title="Jane Doe" description="jane@example.com">
18
+ * <ng-template comItemLeading>
19
+ * <com-avatar src="/photos/jane.jpg" name="Jane Doe" size="sm" />
20
+ * </ng-template>
21
+ * </com-item>
22
+ * ```
23
+ *
24
+ * @example Avatar stack
25
+ * ```html
26
+ * <com-item title="3 collaborators">
27
+ * <ng-template comItemLeading>
28
+ * <div class="flex -space-x-2">
29
+ * <com-avatar name="A" size="xs" variant="outline" />
30
+ * <com-avatar name="B" size="xs" variant="outline" />
31
+ * </div>
32
+ * </ng-template>
33
+ * </com-item>
34
+ * ```
35
+ */
36
+ declare class ComItemLeading {
37
+ readonly templateRef: TemplateRef<void>;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComItemLeading, never>;
39
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComItemLeading, "ng-template[comItemLeading]", never, {}, {}, never, never, true, never>;
40
+ }
41
+ /**
42
+ * Marker directive for projecting custom title content into a com-item.
43
+ *
44
+ * When this directive is present, it replaces the `title` input with
45
+ * rich projected content. Use this when the title needs formatting,
46
+ * links, or other custom markup.
47
+ *
48
+ * @example Title with link
49
+ * ```html
50
+ * <com-item icon="link">
51
+ * <ng-template comItemTitle>
52
+ * <a href="/docs/api" class="hover:underline">API Documentation</a>
53
+ * </ng-template>
54
+ * </com-item>
55
+ * ```
56
+ */
57
+ declare class ComItemTitle {
58
+ readonly templateRef: TemplateRef<void>;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComItemTitle, never>;
60
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComItemTitle, "ng-template[comItemTitle]", never, {}, {}, never, never, true, never>;
61
+ }
62
+ /**
63
+ * Marker directive for projecting inline suffix content after the title.
64
+ *
65
+ * Content appears on the same line as the title, immediately after it.
66
+ * Use this for badges, tags, status indicators, or other inline metadata.
67
+ *
68
+ * @example Badge suffix
69
+ * ```html
70
+ * <com-item title="My BP datasource" description="View and manage configuration">
71
+ * <ng-template comItemSuffix>
72
+ * <span class="inline-flex items-center gap-1 rounded-pill border border-primary/30 bg-primary-subtle px-2 py-0.5 text-xs font-medium text-primary">
73
+ * Bluetooth
74
+ * </span>
75
+ * </ng-template>
76
+ * </com-item>
77
+ * ```
78
+ */
79
+ declare class ComItemSuffix {
80
+ readonly templateRef: TemplateRef<void>;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComItemSuffix, never>;
82
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComItemSuffix, "ng-template[comItemSuffix]", never, {}, {}, never, never, true, never>;
83
+ }
84
+ /**
85
+ * Marker directive for projecting custom description content into a com-item.
86
+ *
87
+ * When this directive is present, it replaces the `description` input
88
+ * with rich projected content. Use this when the description needs
89
+ * formatting, code snippets, or other custom markup.
90
+ *
91
+ * @example Description with code
92
+ * ```html
93
+ * <com-item title="API Key" icon="key">
94
+ * <ng-template comItemDescription>
95
+ * <code class="text-xs font-mono text-muted-foreground">sk-abc...xyz</code>
96
+ * <span class="text-xs text-muted-foreground"> · Created 3 days ago</span>
97
+ * </ng-template>
98
+ * </com-item>
99
+ * ```
100
+ */
101
+ declare class ComItemDescription {
102
+ readonly templateRef: TemplateRef<void>;
103
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComItemDescription, never>;
104
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComItemDescription, "ng-template[comItemDescription]", never, {}, {}, never, never, true, never>;
105
+ }
106
+ /**
107
+ * Marker directive for projecting trailing content into a com-item.
108
+ *
109
+ * Content appears at the far right edge of the item. Use this for
110
+ * action buttons, navigation chevrons, toggles, timestamps, or
111
+ * any other trailing content.
112
+ *
113
+ * @example Trailing chevron
114
+ * ```html
115
+ * <com-item title="Settings" icon="settings" [interactive]="true">
116
+ * <ng-template comItemTrailing>
117
+ * <com-icon name="chevron-right" size="sm" color="muted" />
118
+ * </ng-template>
119
+ * </com-item>
120
+ * ```
121
+ *
122
+ * @example Trailing action button
123
+ * ```html
124
+ * <com-item title="API Key" icon="key">
125
+ * <ng-template comItemTrailing>
126
+ * <button class="text-sm text-primary hover:text-primary-hover">Revoke</button>
127
+ * </ng-template>
128
+ * </com-item>
129
+ * ```
130
+ */
131
+ declare class ComItemTrailing {
132
+ readonly templateRef: TemplateRef<void>;
133
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComItemTrailing, never>;
134
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ComItemTrailing, "ng-template[comItemTrailing]", never, {}, {}, never, never, true, never>;
135
+ }
136
+
137
+ /** Item size variants. */
138
+ type ItemSize = 'sm' | 'md' | 'lg';
139
+ /** Item density variants. */
140
+ type ItemDensity = 'compact' | 'default' | 'comfortable';
141
+ /**
142
+ * CVA variants for the item container (host element).
143
+ *
144
+ * @tokens `--color-primary-subtle`, `--color-muted`, `--color-ring`
145
+ */
146
+ declare const itemVariants: (props?: {
147
+ size?: ItemSize;
148
+ density?: ItemDensity;
149
+ interactive?: boolean;
150
+ active?: boolean;
151
+ disabled?: boolean;
152
+ }) => string;
153
+ /** Title classes keyed by item size. */
154
+ declare const ITEM_TITLE_CLASSES: Record<ItemSize, string>;
155
+ /** Description classes keyed by item size. */
156
+ declare const ITEM_DESCRIPTION_CLASSES: Record<ItemSize, string>;
157
+ /** Avatar size mapping keyed by item size. */
158
+ declare const ITEM_AVATAR_SIZES: Record<ItemSize, AvatarSize>;
159
+ /** Icon size mapping keyed by item size (for icon inside avatar). */
160
+ declare const ITEM_ICON_SIZES: Record<ItemSize, IconSize>;
161
+ type ItemVariants = VariantProps<typeof itemVariants>;
162
+
163
+ /**
164
+ * Item component — a universal compound display element that shows a leading
165
+ * visual alongside a title, an optional description, and optional trailing content.
166
+ *
167
+ * Works in all these contexts:
168
+ * - List rows (device lists, settings menus, search results)
169
+ * - Page/section headers
170
+ * - Dropdown menu items
171
+ * - Table cells
172
+ * - Card headers
173
+ * - Nav items
174
+ *
175
+ * **Anatomy:**
176
+ * ```
177
+ * ┌─────────────────────────────────────────────────────────┐
178
+ * │ ┌───────┐ │
179
+ * │ │com- │ Title text · [inline suffix] [TRAILING] │
180
+ * │ │avatar │ Description text (secondary) │
181
+ * │ └───────┘ │
182
+ * └─────────────────────────────────────────────────────────┘
183
+ * ```
184
+ *
185
+ * Five content zones:
186
+ * 1. **Leading visual** — optional. Default: `com-avatar` with `shape="rounded"` + `variant="soft"`.
187
+ * Override via `comItemLeading` directive.
188
+ * 2. **Title** — primary text. Required (via input or projection).
189
+ * 3. **Inline suffix** — same line as title, after it. For badges, tags, status dots.
190
+ * 4. **Description** — secondary text below title. Optional.
191
+ * 5. **Trailing** — far-right aligned. Actions, chevrons, timestamps.
192
+ *
193
+ * @tokens `--color-primary-subtle`, `--color-muted`, `--color-muted-foreground`,
194
+ * `--color-foreground`, `--color-ring`
195
+ *
196
+ * @example Simplest — text only, no icon
197
+ * ```html
198
+ * <com-item title="Select all" />
199
+ * ```
200
+ *
201
+ * @example Icon + title + description (most common)
202
+ * ```html
203
+ * <com-item
204
+ * title="Dexcom G7"
205
+ * description="109123c2d2194bffe519b03ceb51730d5064f9de46c54c4e..."
206
+ * icon="smartphone"
207
+ * />
208
+ * ```
209
+ *
210
+ * @example Icon with different color
211
+ * ```html
212
+ * <com-item title="Warning detected" icon="alert-triangle" iconColor="warn" />
213
+ * <com-item title="Active" icon="check-circle" iconColor="accent" />
214
+ * ```
215
+ *
216
+ * @example Page header with badge suffix (size lg)
217
+ * ```html
218
+ * <com-item
219
+ * title="My BP datasource"
220
+ * description="View and manage datasource configuration"
221
+ * size="lg"
222
+ * >
223
+ * <ng-template comItemSuffix>
224
+ * <span class="inline-flex items-center gap-1 rounded-pill border border-primary/30 bg-primary-subtle px-2 py-0.5 text-xs font-medium text-primary">
225
+ * <com-icon name="bluetooth" size="xs" /> Bluetooth
226
+ * </span>
227
+ * </ng-template>
228
+ * </com-item>
229
+ * ```
230
+ *
231
+ * @example Custom leading — user avatar with image
232
+ * ```html
233
+ * <com-item title="Jane Doe" description="jane@example.com">
234
+ * <ng-template comItemLeading>
235
+ * <com-avatar src="/photos/jane.jpg" name="Jane Doe" size="sm" />
236
+ * </ng-template>
237
+ * </com-item>
238
+ * ```
239
+ *
240
+ * @example Interactive list item with trailing chevron
241
+ * ```html
242
+ * <com-item
243
+ * title="Bluetooth Settings"
244
+ * description="Manage paired devices"
245
+ * icon="bluetooth"
246
+ * [interactive]="true"
247
+ * (click)="openSettings()"
248
+ * >
249
+ * <ng-template comItemTrailing>
250
+ * <com-icon name="chevron-right" size="sm" color="muted" />
251
+ * </ng-template>
252
+ * </com-item>
253
+ * ```
254
+ *
255
+ * @example Compact density — dropdown menu
256
+ * ```html
257
+ * @for (option of options; track option.value) {
258
+ * <com-item
259
+ * [title]="option.label"
260
+ * [icon]="option.icon"
261
+ * density="compact"
262
+ * [interactive]="true"
263
+ * [active]="option.value === selected()"
264
+ * (click)="select(option)"
265
+ * />
266
+ * }
267
+ * ```
268
+ *
269
+ * @example Rich description via projection
270
+ * ```html
271
+ * <com-item title="API Key" icon="key">
272
+ * <ng-template comItemDescription>
273
+ * <code class="text-xs font-mono text-muted-foreground">sk-abc...xyz</code>
274
+ * <span class="text-xs text-muted-foreground"> · Created 3 days ago</span>
275
+ * </ng-template>
276
+ * <ng-template comItemTrailing>
277
+ * <button class="text-sm text-primary hover:text-primary-hover">Revoke</button>
278
+ * </ng-template>
279
+ * </com-item>
280
+ * ```
281
+ *
282
+ * @example Disabled
283
+ * ```html
284
+ * <com-item
285
+ * title="Enterprise Features"
286
+ * description="Available on Enterprise plan"
287
+ * icon="crown"
288
+ * [disabled]="true"
289
+ * />
290
+ * ```
291
+ */
292
+ declare class ComItem {
293
+ /** Primary text. Required unless using comItemTitle directive. */
294
+ readonly title: InputSignal<string | undefined>;
295
+ /** Secondary text below the title. */
296
+ readonly description: InputSignal<string | undefined>;
297
+ /** Lucide icon name — renders inside a com-avatar container. */
298
+ readonly icon: InputSignal<string | undefined>;
299
+ /** Color variant passed to the leading com-avatar. */
300
+ readonly iconColor: InputSignal<AvatarColor>;
301
+ /** Size variant affecting typography and spacing. */
302
+ readonly size: InputSignal<ItemSize>;
303
+ /** Density variant affecting vertical padding. */
304
+ readonly density: InputSignal<ItemDensity>;
305
+ /** Enables hover/active/focus states. */
306
+ readonly interactive: InputSignalWithTransform<boolean, unknown>;
307
+ /** Shows selected/active highlight. */
308
+ readonly active: InputSignalWithTransform<boolean, unknown>;
309
+ /** Dims and disables pointer events. */
310
+ readonly disabled: InputSignalWithTransform<boolean, unknown>;
311
+ /** Truncates title and description text. */
312
+ readonly truncate: InputSignalWithTransform<boolean, unknown>;
313
+ protected readonly leadingDirective: Signal<ComItemLeading | undefined>;
314
+ protected readonly titleDirective: Signal<ComItemTitle | undefined>;
315
+ protected readonly suffixDirective: Signal<ComItemSuffix | undefined>;
316
+ protected readonly descriptionDirective: Signal<ComItemDescription | undefined>;
317
+ protected readonly trailingDirective: Signal<ComItemTrailing | undefined>;
318
+ /** Resolved icon color (handles 'auto' → 'primary' for items since there's no name). */
319
+ protected readonly resolvedIconColor: Signal<AvatarColor>;
320
+ /** Avatar size mapped from item size. */
321
+ protected readonly avatarSize: Signal<AvatarSize>;
322
+ /** Icon size mapped from item size. */
323
+ protected readonly iconSize: Signal<IconSize>;
324
+ /** Title typography classes based on size. */
325
+ protected readonly titleClasses: Signal<string>;
326
+ /** Description typography classes based on size. */
327
+ protected readonly descriptionClasses: Signal<string>;
328
+ /** Host element classes from CVA. */
329
+ protected readonly hostClasses: Signal<string>;
330
+ protected onKeyboardActivate(event: Event): void;
331
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComItem, never>;
332
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComItem, "com-item", ["comItem"], { "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconColor": { "alias": "iconColor"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "truncate": { "alias": "truncate"; "required": false; "isSignal": true; }; }, {}, ["leadingDirective", "titleDirective", "suffixDirective", "descriptionDirective", "trailingDirective"], never, true, never>;
333
+ }
334
+
335
+ export { ComItem, ComItemDescription, ComItemLeading, ComItemSuffix, ComItemTitle, ComItemTrailing, ITEM_AVATAR_SIZES, ITEM_DESCRIPTION_CLASSES, ITEM_ICON_SIZES, ITEM_TITLE_CLASSES, itemVariants };
336
+ export type { ItemDensity, ItemSize, ItemVariants };