@cngx/common 0.0.1-rc.0 → 0.1.0-rc.1

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 (61) hide show
  1. package/a11y/README.md +13 -16
  2. package/card/README.md +2 -21
  3. package/chart/README.md +5 -8
  4. package/data/README.md +45 -47
  5. package/dialog/README.md +12 -15
  6. package/display/README.md +5 -9
  7. package/fesm2022/cngx-common-a11y.mjs +164 -51
  8. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  9. package/fesm2022/cngx-common-card.mjs +157 -69
  10. package/fesm2022/cngx-common-card.mjs.map +1 -1
  11. package/fesm2022/cngx-common-chart.mjs +389 -92
  12. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  13. package/fesm2022/cngx-common-data.mjs +311 -151
  14. package/fesm2022/cngx-common-data.mjs.map +1 -1
  15. package/fesm2022/cngx-common-dialog.mjs +167 -29
  16. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  17. package/fesm2022/cngx-common-display.mjs +445 -110
  18. package/fesm2022/cngx-common-display.mjs.map +1 -1
  19. package/fesm2022/cngx-common-interactive.mjs +2059 -435
  20. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  21. package/fesm2022/cngx-common-layout.mjs +188 -31
  22. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  23. package/fesm2022/cngx-common-popover.mjs +711 -90
  24. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  25. package/fesm2022/cngx-common-stepper.mjs +1479 -73
  26. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  27. package/fesm2022/cngx-common-tabs.mjs +1144 -85
  28. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  29. package/fesm2022/cngx-common.mjs +2 -2
  30. package/fesm2022/cngx-common.mjs.map +1 -1
  31. package/interactive/README.md +5 -5
  32. package/layout/README.md +2 -2
  33. package/package.json +7 -6
  34. package/popover/README.md +8 -34
  35. package/stepper/README.md +69 -8
  36. package/tabs/README.md +6 -6
  37. package/theming/components/cngx-async.css +74 -0
  38. package/theming/components/cngx-backdrop.css +73 -0
  39. package/theming/components/cngx-badge.css +340 -0
  40. package/theming/components/cngx-bottom-sheet.css +201 -0
  41. package/theming/components/cngx-button-toggle.css +99 -0
  42. package/theming/components/cngx-dialog.css +358 -0
  43. package/theming/components/cngx-divider.css +145 -0
  44. package/theming/components/cngx-listbox.css +220 -0
  45. package/theming/components/cngx-menu.css +371 -0
  46. package/theming/components/cngx-ripple.css +116 -0
  47. package/theming/components/cngx-tooltip.css +265 -0
  48. package/theming/system-tokens.css +24 -0
  49. package/types/cngx-common-a11y.d.ts +159 -38
  50. package/types/cngx-common-card.d.ts +137 -22
  51. package/types/cngx-common-chart.d.ts +337 -40
  52. package/types/cngx-common-data.d.ts +277 -45
  53. package/types/cngx-common-dialog.d.ts +162 -22
  54. package/types/cngx-common-display.d.ts +422 -78
  55. package/types/cngx-common-interactive.d.ts +1880 -305
  56. package/types/cngx-common-layout.d.ts +191 -28
  57. package/types/cngx-common-popover.d.ts +632 -87
  58. package/types/cngx-common-stepper.d.ts +1360 -45
  59. package/types/cngx-common-tabs.d.ts +1139 -56
  60. package/types/cngx-common.d.ts +1 -1
  61. package/README.md +0 -18
@@ -3,18 +3,22 @@ import { TemplateRef } from '@angular/core';
3
3
  import * as i1 from '@cngx/common/a11y';
4
4
  import { CngxAsyncState } from '@cngx/core/utils';
5
5
 
6
- /** Reason why a card grid is empty — drives empty-state template selection. */
6
+ /**
7
+ * Reason why a card grid is empty — drives empty-state template selection.
8
+ *
9
+ * @category common/card
10
+ */
7
11
  type EmptyReason = 'first-use' | 'no-results' | 'cleared';
8
12
 
9
13
  /**
10
14
  * Semantic card component that adapts its host element role based on the `as` input.
11
15
  *
12
16
  * Three archetypes:
13
- * - `'article'` (default) — display card, no primary action
14
- * - `'button'` — the entire card is a clickable button
15
- * - `'link'` — the entire card is a navigation link
17
+ * - `'article'` (default) - display card, no primary action
18
+ * - `'button'` - the entire card is a clickable button
19
+ * - `'link'` - the entire card is a navigation link
16
20
  *
17
- * The host element **is** the semantic element — no inner wrapper.
21
+ * The host element **is** the semantic element - no inner wrapper.
18
22
  * This eliminates double focus rings and wrapper problems for screen readers.
19
23
  *
20
24
  * ### Action card with selection
@@ -31,6 +35,19 @@ type EmptyReason = 'first-use' | 'no-results' | 'cleared';
31
35
  * <img cngxCardMedia alt="Photo" />
32
36
  * </cngx-card>
33
37
  * ```
38
+ *
39
+ * @category common/card
40
+ * @docsKind primary
41
+ * @wcag AA
42
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card.component.ts
43
+ * @since 0.1.0
44
+ * @relatedTo CngxCardGrid, CngxCardHeader, CngxCardBody, CngxCardFooter, CngxCardSkeleton
45
+ * <example-url>http://localhost:4200/#/common/card/card-with-disclosure-expand-collapse</example-url>
46
+ * <example-url>http://localhost:4200/#/common/card/card-with-expandable-text</example-url>
47
+
48
+ * <example-url>http://localhost:4200/#/common/card/card-with-speak-badge</example-url>
49
+ * <example-url>http://localhost:4200/#/common/card/disabled-with-reason</example-url>
50
+
34
51
  */
35
52
  declare class CngxCard {
36
53
  private readonly uid;
@@ -60,7 +77,7 @@ declare class CngxCard {
60
77
  /**
61
78
  * @internal Tabindex management.
62
79
  * When inside a CngxRovingTabindex parent (e.g. CngxCardGrid), the roving
63
- * controller manages tabindex via CngxRovingItem — card does not set its own.
80
+ * controller manages tabindex via CngxRovingItem - card does not set its own.
64
81
  * When standalone, interactive cards get tabindex="0".
65
82
  */
66
83
  protected readonly hostTabindex: _angular_core.Signal<0 | null>;
@@ -68,7 +85,7 @@ declare class CngxCard {
68
85
  protected readonly disabledReasonId: string;
69
86
  /** @internal */
70
87
  protected readonly liveRegionId: string;
71
- /** @internal IDs for `aria-describedby` — always present, aria-hidden controls what SR reads. */
88
+ /** @internal IDs for `aria-describedby` - always present, aria-hidden controls what SR reads. */
72
89
  protected readonly describedByIds: _angular_core.Signal<string>;
73
90
  /** @internal SR live announcement for state changes. */
74
91
  protected readonly liveAnnouncement: _angular_core.Signal<"Loading" | "Selected" | "Deselected" | "">;
@@ -85,7 +102,7 @@ declare class CngxCard {
85
102
  /**
86
103
  * Structural slot directive for the card header region.
87
104
  *
88
- * Must be placed on a native `<header>` element — the selector enforces
105
+ * Must be placed on a native `<header>` element - the selector enforces
89
106
  * semantic correctness at compile time.
90
107
  *
91
108
  * ```html
@@ -95,6 +112,12 @@ declare class CngxCard {
95
112
  * </header>
96
113
  * </cngx-card>
97
114
  * ```
115
+ *
116
+ * @category common/card
117
+ * @wcag AA
118
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-header.directive.ts
119
+ * @since 0.1.0
120
+ * @relatedTo CngxCard, CngxCardTitle, CngxCardSubtitle, CngxCardFooter
98
121
  */
99
122
  declare class CngxCardHeader {
100
123
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardHeader, never>;
@@ -115,6 +138,11 @@ declare class CngxCardHeader {
115
138
  * </header>
116
139
  * </cngx-card>
117
140
  * ```
141
+ *
142
+ * @category common/card
143
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-title.directive.ts
144
+ * @since 0.1.0
145
+ * @relatedTo CngxCard, CngxCardHeader, CngxCardSubtitle
118
146
  */
119
147
  declare class CngxCardTitle {
120
148
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardTitle, never>;
@@ -122,7 +150,7 @@ declare class CngxCardTitle {
122
150
  }
123
151
 
124
152
  /**
125
- * Marks an element as the card's subtitle — secondary text below the title.
153
+ * Marks an element as the card's subtitle - secondary text below the title.
126
154
  *
127
155
  * ```html
128
156
  * <cngx-card>
@@ -132,6 +160,11 @@ declare class CngxCardTitle {
132
160
  * </header>
133
161
  * </cngx-card>
134
162
  * ```
163
+ *
164
+ * @category common/card
165
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-subtitle.directive.ts
166
+ * @since 0.1.0
167
+ * @relatedTo CngxCard, CngxCardHeader, CngxCardTitle
135
168
  */
136
169
  declare class CngxCardSubtitle {
137
170
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardSubtitle, never>;
@@ -146,6 +179,11 @@ declare class CngxCardSubtitle {
146
179
  * <div cngxCardBody>Main content here</div>
147
180
  * </cngx-card>
148
181
  * ```
182
+ *
183
+ * @category common/card
184
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-body.directive.ts
185
+ * @since 0.1.0
186
+ * @relatedTo CngxCard, CngxCardHeader, CngxCardFooter
149
187
  */
150
188
  declare class CngxCardBody {
151
189
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardBody, never>;
@@ -163,6 +201,14 @@ declare class CngxCardBody {
163
201
  * <img cngxCardMedia [decorative]="false" alt="Photo of patient" />
164
202
  * </cngx-card>
165
203
  * ```
204
+ *
205
+ * @category common/card
206
+ * @wcag AA
207
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-media.directive.ts
208
+ * @since 0.1.0
209
+ * @relatedTo CngxCard, CngxCardHeader, CngxCardBody
210
+ * <example-url>http://localhost:4200/#/common/card/card-with-image</example-url>
211
+
166
212
  */
167
213
  declare class CngxCardMedia {
168
214
  /** Whether this media is purely decorative (hidden from SR). */
@@ -176,7 +222,7 @@ declare class CngxCardMedia {
176
222
  /**
177
223
  * Structural slot directive for the card footer region.
178
224
  *
179
- * Must be placed on a native `<footer>` element — the selector enforces
225
+ * Must be placed on a native `<footer>` element - the selector enforces
180
226
  * semantic correctness at compile time.
181
227
  *
182
228
  * ```html
@@ -184,6 +230,13 @@ declare class CngxCardMedia {
184
230
  * <footer cngxCardFooter>Footer content</footer>
185
231
  * </cngx-card>
186
232
  * ```
233
+ *
234
+ * @category common/card
235
+ * @wcag AA
236
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-footer.directive.ts
237
+ * @since 0.1.0
238
+ * @relatedTo CngxCard, CngxCardHeader, CngxCardActions, CngxCardTimestamp
239
+ * <example-url>http://localhost:4200/#/common/card/title-subtitle-footer</example-url>
187
240
  */
188
241
  declare class CngxCardFooter {
189
242
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardFooter, never>;
@@ -204,6 +257,12 @@ declare class CngxCardFooter {
204
257
  * </div>
205
258
  * </cngx-card>
206
259
  * ```
260
+ *
261
+ * @category common/card
262
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-actions.directive.ts
263
+ * @since 0.1.0
264
+ * @relatedTo CngxCard, CngxCardFooter, CngxCardBody
265
+ * <example-url>http://localhost:4200/#/common/card/action-card-with-selection</example-url>
207
266
  */
208
267
  declare class CngxCardActions {
209
268
  /** Horizontal alignment of actions. */
@@ -213,23 +272,45 @@ declare class CngxCardActions {
213
272
  }
214
273
 
215
274
  /**
216
- * Positions a badge element at a corner of its parent card.
217
- *
218
- * Typically used for status indicators (P-badges, notification dots)
219
- * that float in the card's top-right corner.
275
+ * Positions a badge element at a corner of its parent card and projects
276
+ * intent + size variants onto the host class so a bare element renders
277
+ * a usable pill without any inline styles.
220
278
  *
221
279
  * ```html
222
280
  * <cngx-card>
223
- * <cngx-status-badge cngxCardBadge status="pending" variant="dot" />
281
+ * <span cngxCardBadge position="top-end" intent="danger" size="md">P</span>
224
282
  * <header cngxCardHeader>Pflegeplan</header>
225
283
  * </cngx-card>
226
284
  * ```
285
+ *
286
+ * Empty content collapses to a fixed-diameter dot via `:empty` (status
287
+ * indicator pattern). Theme via the `--cngx-card-badge-*` tokens on
288
+ * `card.component.css`; fallbacks chain through `--cngx-badge-*` then
289
+ * the foundation palette.
290
+ *
291
+ * @category common/card
292
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-badge.directive.ts
293
+ * @since 0.1.0
294
+ * @relatedTo CngxCard, CngxCardAccent, CngxCardHeader
295
+ * <example-url>http://localhost:4200/#/common/card/card-with-badge</example-url>
227
296
  */
228
297
  declare class CngxCardBadge {
229
298
  /** Corner position using logical properties. */
230
299
  readonly position: _angular_core.InputSignal<"top-start" | "top-end" | "bottom-start" | "bottom-end">;
300
+ /**
301
+ * Tone of the badge surface. Resolves to
302
+ * `--cngx-card-badge-<intent>-bg` / `-color`; cascades through
303
+ * `--cngx-badge-<intent>-bg` then `--cngx-color-<system>`.
304
+ */
305
+ readonly intent: _angular_core.InputSignal<"primary" | "danger" | "warning" | "success" | "neutral">;
306
+ /**
307
+ * Pill diameter and font-size. Empty content always renders as a
308
+ * fixed dot at the `sm` token regardless of this input (`:empty`
309
+ * fallback for status indicators).
310
+ */
311
+ readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
231
312
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardBadge, never>;
232
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardBadge, "[cngxCardBadge]", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
313
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardBadge, "[cngxCardBadge]", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; "intent": { "alias": "intent"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
233
314
  }
234
315
 
235
316
  /**
@@ -237,7 +318,7 @@ declare class CngxCardBadge {
237
318
  *
238
319
  * Renders as a colored top border + tinted background to communicate
239
320
  * status visually. Differentiates by both color and border width
240
- * (not just color — WCAG 1.4.1).
321
+ * (not just color - WCAG 1.4.1).
241
322
  *
242
323
  * ```html
243
324
  * <cngx-card cngxCardAccent="warning">
@@ -246,10 +327,17 @@ declare class CngxCardBadge {
246
327
  * </header>
247
328
  * </cngx-card>
248
329
  * ```
330
+ *
331
+ * @category common/card
332
+ * @wcag AA
333
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-accent.directive.ts
334
+ * @since 0.1.0
335
+ * @relatedTo CngxCard, CngxCardBadge, CngxCardHeader
336
+ * <example-url>http://localhost:4200/#/common/card/severity-accent</example-url>
249
337
  */
250
338
  declare class CngxCardAccent {
251
339
  /** Severity level controlling the accent color. */
252
- readonly severity: _angular_core.InputSignal<"info" | "success" | "warning" | "danger" | "neutral">;
340
+ readonly severity: _angular_core.InputSignal<"danger" | "warning" | "success" | "neutral" | "info">;
253
341
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardAccent, never>;
254
342
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardAccent, "[cngxCardAccent]", never, { "severity": { "alias": "cngxCardAccent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
255
343
  }
@@ -270,6 +358,13 @@ declare class CngxCardAccent {
270
358
  * }
271
359
  * </cngx-card>
272
360
  * ```
361
+ *
362
+ * @category common/card
363
+ * @wcag AA
364
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-skeleton.component.ts
365
+ * @since 0.1.0
366
+ * @relatedTo CngxCard, CngxCardBody, CngxCardMedia
367
+ * <example-url>http://localhost:4200/#/common/card/loading-state</example-url>
273
368
  */
274
369
  declare class CngxCardSkeleton {
275
370
  /** Number of body text lines to show. */
@@ -298,6 +393,11 @@ declare class CngxCardSkeleton {
298
393
  * </ng-template>
299
394
  * </cngx-card-grid>
300
395
  * ```
396
+ *
397
+ * @category common/card
398
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-grid-empty.directive.ts
399
+ * @since 0.1.0
400
+ * @relatedTo CngxCardGrid
301
401
  */
302
402
  declare class CngxCardGridEmpty {
303
403
  /** Empty-state reason this template handles. Omit for a default fallback. */
@@ -312,7 +412,7 @@ declare class CngxCardGridEmpty {
312
412
  * Responsive card grid layout with intrinsic sizing, keyboard navigation,
313
413
  * and reason-based empty-state template selection.
314
414
  *
315
- * Uses CSS Grid with `auto-fill` + `minmax` for intrinsic responsiveness —
415
+ * Uses CSS Grid with `auto-fill` + `minmax` for intrinsic responsiveness -
316
416
  * no breakpoint management required.
317
417
  *
318
418
  * Keyboard navigation is provided by `CngxRovingTabindex` as a host directive.
@@ -340,13 +440,23 @@ declare class CngxCardGridEmpty {
340
440
  * </ng-template>
341
441
  * </cngx-card-grid>
342
442
  * ```
443
+ *
444
+ * @category common/card
445
+ * @docsKind primary
446
+ * @wcag AA
447
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-grid.component.ts
448
+ * @since 0.1.0
449
+ * @relatedTo CngxCard, CngxCardGridEmpty, CngxRovingTabindex, CngxAsyncState
450
+ * <example-url>http://localhost:4200/#/common/card/card-grid/basic-grid</example-url>
451
+ * <example-url>http://localhost:4200/#/common/card/card-grid/density-variants</example-url>
452
+ * <example-url>http://localhost:4200/#/common/card/card-grid/empty-state-with-reason</example-url>
343
453
  */
344
454
  declare class CngxCardGrid {
345
455
  /** Minimum card width for the CSS Grid `minmax()` function. */
346
456
  readonly minWidth: _angular_core.InputSignal<string>;
347
457
  /** Gap between grid items. */
348
458
  readonly gap: _angular_core.InputSignal<string>;
349
- /** Grid density level — controls gap and card padding via CSS custom properties. */
459
+ /** Grid density level - controls gap and card padding via CSS custom properties. */
350
460
  readonly density: _angular_core.InputSignal<"compact" | "default" | "comfortable">;
351
461
  /** Whether the grid should have `role="list"`. Requires `role="listitem"` on each card. */
352
462
  readonly semanticList: _angular_core.InputSignal<boolean>;
@@ -355,10 +465,10 @@ declare class CngxCardGrid {
355
465
  * empty-state template. When omitted, the grid is a pure layout tool.
356
466
  */
357
467
  readonly items: _angular_core.InputSignal<readonly unknown[] | undefined>;
358
- /** Reason why items are empty — selects the matching `cngxCardGridEmpty` template. */
468
+ /** Reason why items are empty - selects the matching `cngxCardGridEmpty` template. */
359
469
  readonly emptyReason: _angular_core.InputSignal<EmptyReason | undefined>;
360
470
  /**
361
- * Bind an async state — drives loading and empty from a single source.
471
+ * Bind an async state - drives loading and empty from a single source.
362
472
  * When set, `isLoading` derives from `state.isFirstLoad()` and
363
473
  * `empty` derives from `state.isEmpty()` (overrides `[items]`).
364
474
  */
@@ -390,6 +500,11 @@ declare class CngxCardGrid {
390
500
  * </footer>
391
501
  * </cngx-card>
392
502
  * ```
503
+ *
504
+ * @category common/card
505
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/card/card-timestamp.component.ts
506
+ * @since 0.1.0
507
+ * @relatedTo CngxCard, CngxCardFooter
393
508
  */
394
509
  declare class CngxCardTimestamp {
395
510
  private readonly locale;