@cngx/ui 0.1.0-rc.8 → 0.3.0

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 (108) hide show
  1. package/README.md +118 -59
  2. package/action-button/README.md +170 -53
  3. package/breadcrumb/README.md +5 -6
  4. package/collection/README.md +1 -1
  5. package/command-palette/README.md +9 -5
  6. package/data-grid-accordion/README.md +1 -1
  7. package/empty-state/README.md +2 -3
  8. package/feedback/README.md +1 -1
  9. package/fesm2022/cngx-ui-a11y.mjs +13 -23
  10. package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-accordion.mjs +55 -60
  12. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-action-button.mjs +220 -339
  14. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-breadcrumb.mjs +100 -80
  16. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-chart-panel.mjs +18 -31
  18. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-collection.mjs +28 -34
  20. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-command-palette.mjs +29 -51
  22. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-context-menu.mjs +138 -89
  24. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-data-grid-accordion.mjs +135 -77
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-empty-state.mjs +17 -44
  28. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-feedback.mjs +648 -495
  30. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  31. package/fesm2022/cngx-ui-layout.mjs +17 -13
  32. package/fesm2022/cngx-ui-layout.mjs.map +1 -1
  33. package/fesm2022/cngx-ui-mat-accordion.mjs +6 -7
  34. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  35. package/fesm2022/cngx-ui-mat-paginator.mjs +5 -9
  36. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  37. package/fesm2022/cngx-ui-mat-stepper.mjs +6 -9
  38. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  39. package/fesm2022/cngx-ui-mat-tabs.mjs +315 -134
  40. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  41. package/fesm2022/cngx-ui-nav-rail.mjs +440 -0
  42. package/fesm2022/cngx-ui-nav-rail.mjs.map +1 -0
  43. package/fesm2022/cngx-ui-overlay.mjs +9 -10
  44. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  45. package/fesm2022/cngx-ui-paginator.mjs +212 -188
  46. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  47. package/fesm2022/cngx-ui-sidenav.mjs +872 -721
  48. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  49. package/fesm2022/cngx-ui-skeleton.mjs +17 -19
  50. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  51. package/fesm2022/cngx-ui-speak.mjs +21 -74
  52. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  53. package/fesm2022/cngx-ui-stat-card.mjs +39 -62
  54. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
  55. package/fesm2022/cngx-ui-stepper.mjs +259 -130
  56. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  57. package/fesm2022/cngx-ui-tabs.mjs +148 -50
  58. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  59. package/fesm2022/cngx-ui-timeline.mjs +48 -32
  60. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  61. package/fesm2022/cngx-ui-toc.mjs +59 -48
  62. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  63. package/fesm2022/cngx-ui.mjs +5 -5
  64. package/fesm2022/cngx-ui.mjs.map +1 -1
  65. package/mat-tabs/README.md +57 -19
  66. package/mat-tabs/styles/mat-tabs.css +285 -163
  67. package/nav-rail/README.md +325 -0
  68. package/package.json +37 -8
  69. package/paginator/README.md +10 -0
  70. package/schematics/collection.json +9 -0
  71. package/schematics/ng-add/index.js +9 -0
  72. package/schematics/ng-add/schema.json +96 -0
  73. package/schematics/package.json +3 -0
  74. package/sidenav/README.md +150 -55
  75. package/skeleton/README.md +1 -1
  76. package/speak/README.md +1 -2
  77. package/stepper/README.md +20 -5
  78. package/tabs/README.md +13 -0
  79. package/timeline/README.md +1 -1
  80. package/toc/README.md +1 -1
  81. package/types/cngx-ui-a11y.d.ts +20 -38
  82. package/types/cngx-ui-accordion.d.ts +46 -71
  83. package/types/cngx-ui-action-button.d.ts +113 -151
  84. package/types/cngx-ui-breadcrumb.d.ts +60 -85
  85. package/types/cngx-ui-chart-panel.d.ts +22 -40
  86. package/types/cngx-ui-collection.d.ts +30 -43
  87. package/types/cngx-ui-command-palette.d.ts +40 -64
  88. package/types/cngx-ui-context-menu.d.ts +109 -48
  89. package/types/cngx-ui-data-grid-accordion.d.ts +50 -75
  90. package/types/cngx-ui-empty-state.d.ts +18 -8
  91. package/types/cngx-ui-feedback.d.ts +275 -292
  92. package/types/cngx-ui-layout.d.ts +4 -12
  93. package/types/cngx-ui-mat-accordion.d.ts +5 -5
  94. package/types/cngx-ui-mat-paginator.d.ts +4 -10
  95. package/types/cngx-ui-mat-stepper.d.ts +5 -10
  96. package/types/cngx-ui-mat-tabs.d.ts +86 -89
  97. package/types/cngx-ui-nav-rail.d.ts +416 -0
  98. package/types/cngx-ui-overlay.d.ts +4 -13
  99. package/types/cngx-ui-paginator.d.ts +186 -161
  100. package/types/cngx-ui-sidenav.d.ts +557 -437
  101. package/types/cngx-ui-skeleton.d.ts +7 -13
  102. package/types/cngx-ui-speak.d.ts +40 -24
  103. package/types/cngx-ui-stat-card.d.ts +45 -36
  104. package/types/cngx-ui-stepper.d.ts +205 -84
  105. package/types/cngx-ui-tabs.d.ts +104 -28
  106. package/types/cngx-ui-timeline.d.ts +31 -51
  107. package/types/cngx-ui-toc.d.ts +43 -54
  108. package/types/cngx-ui.d.ts +1 -1
@@ -10,8 +10,7 @@ import { InjectionToken, Signal, OutputRef, TemplateRef, EnvironmentProviders, P
10
10
  * the document for headings in this release (see the deferred auto-discovery
11
11
  * phase).
12
12
  *
13
- * @category ui/toc
14
- * @since 0.1.0
13
+ * @since 0.3.0
15
14
  */
16
15
  interface CngxTocItem {
17
16
  /** Section element id this entry links to and scrolls into view. */
@@ -28,8 +27,7 @@ interface CngxTocItem {
28
27
  * `aria-current` state; `depth` is the zero-based nesting level for
29
28
  * indentation-aware custom markup.
30
29
  *
31
- * @category ui/toc
32
- * @since 0.1.0
30
+ * @since 0.3.0
33
31
  */
34
32
  interface CngxTocItemContext {
35
33
  /** The item being rendered (`let-item`). */
@@ -52,8 +50,7 @@ interface CngxTocItemContext {
52
50
  * rail owns the state (`activeId`, `scrollTo`) and the collaborator consumes
53
51
  * it, so the toc *provides* the token and the sync directive *injects* it.
54
52
  *
55
- * @category ui/toc
56
- * @since 0.1.0
53
+ * @since 0.3.0
57
54
  * @relatedTo CngxToc, CngxTocRouterSync
58
55
  */
59
56
  interface CngxTocContract {
@@ -69,8 +66,7 @@ interface CngxTocContract {
69
66
  * `{ provide: CNGX_TOC, useExisting: CngxToc }`, so a collaborator injects the
70
67
  * narrow {@link CngxTocContract} instead of the concrete class.
71
68
  *
72
- * @category ui/toc
73
- * @since 0.1.0
69
+ * @since 0.3.0
74
70
  * @relatedTo CngxToc, CngxTocRouterSync
75
71
  */
76
72
  declare const CNGX_TOC: InjectionToken<CngxTocContract>;
@@ -89,21 +85,20 @@ declare const CNGX_TOC: InjectionToken<CngxTocContract>;
89
85
  * a required input. The spy resolves its targets through `getElementById`, so
90
86
  * its host placement is irrelevant to its function.
91
87
  *
92
- * @category ui/toc
93
- * @docsKind primary
94
88
  * @wcag AA
95
89
  * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc.component.ts
96
- * @since 0.1.0
90
+ * @since 0.3.0
97
91
  * @relatedTo CngxScrollSpy, CngxTocRouterSync, CngxSidenav
98
- * <example-url>http://localhost:4200/#/ui/toc/basic/on-this-page-rail</example-url>
99
- * <example-url>http://localhost:4200/#/ui/toc/auto/heading-auto-discovery</example-url>
92
+ * <example-url>/#/ui/toc/basic/on-this-page-rail</example-url>
93
+ * <example-url>/#/ui/toc/auto/heading-auto-discovery</example-url>
100
94
  * @slot cngxTocItem Replaces the plain label inside each item's link at every depth, ahead of CNGX_TOC_CONFIG.templates.item; gets the item as $implicit, plus active and the zero-based depth.
95
+ * @axis level organism
101
96
  */
102
97
  declare class CngxToc implements CngxTocContract {
103
98
  private readonly doc;
104
99
  private readonly cfg;
105
100
  private readonly ariaLabels;
106
- private readonly reducedMotion;
101
+ private readonly motion;
107
102
  private readonly isBrowser;
108
103
  /**
109
104
  * The outline to render. Tree-shaped; nested `children` become sub-lists.
@@ -165,8 +160,8 @@ declare class CngxToc implements CngxTocContract {
165
160
  protected readonly resolvedItemTpl: Signal<_angular_core.TemplateRef<_cngx_ui_toc.CngxTocItemContext> | null>;
166
161
  /**
167
162
  * Scroll the section with this id into view and move focus to it. Honours
168
- * `prefers-reduced-motion` - the configured `scrollBehavior` is swapped for
169
- * `'auto'` (instant) whenever reduced motion is requested. A visual-only
163
+ * reduced motion (the in-app `CNGX_MOTION` pick or the OS query) - the
164
+ * configured `scrollBehavior` is swapped for `'auto'` (instant). A visual-only
170
165
  * jump is a silent state change for screen-reader users, so focus follows
171
166
  * the scroll (Pillar 2).
172
167
  */
@@ -230,12 +225,11 @@ declare class CngxToc implements CngxTocContract {
230
225
  * otherwise outlive route changes. Without `@angular/router` the directive
231
226
  * dev-warns once and no-ops.
232
227
  *
233
- * @category ui/toc
234
- * @docsKind primary
235
228
  * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc-router-sync.directive.ts
236
- * @since 0.1.0
229
+ * @since 0.3.0
237
230
  * @relatedTo CngxToc, CNGX_TOC
238
- * <example-url>http://localhost:4200/#/ui/toc/router/fragment-deep-link</example-url>
231
+ * <example-url>/#/ui/toc/router/fragment-deep-link</example-url>
232
+ * @axis level organism
239
233
  */
240
234
  declare class CngxTocRouterSync {
241
235
  private readonly toc;
@@ -265,11 +259,10 @@ declare class CngxTocRouterSync {
265
259
  * rule; the selector stays `cngxTocItem`, which is what consumers write.
266
260
  * Resolves ahead of `CNGX_TOC_CONFIG.templates.item` and the built-in label.
267
261
  *
268
- * @category ui/toc
269
262
  * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc-item-slot.ts
270
- * @since 0.1.0
263
+ * @since 0.3.0
271
264
  * @relatedTo CngxToc
272
- * <example-url>http://localhost:4200/#/ui/toc/slots/custom-item-template</example-url>
265
+ * <example-url>/#/ui/toc/slots/custom-item-template</example-url>
273
266
  */
274
267
  declare class CngxTocItemSlot {
275
268
  readonly templateRef: TemplateRef<CngxTocItemContext>;
@@ -283,8 +276,7 @@ declare class CngxTocItemSlot {
283
276
  * `CngxToc`. It feeds the `ariaLabels` of `CNGX_TOC_CONFIG`; a key set through
284
277
  * `withTocAriaLabels` still wins.
285
278
  *
286
- * @category ui/toc/i18n
287
- * @since 0.1.0
279
+ * @since 0.3.0
288
280
  * @relatedTo CNGX_TOC_CONFIG, withTocAriaLabels
289
281
  */
290
282
  interface CngxTocLanguageSection {
@@ -295,8 +287,7 @@ interface CngxTocLanguageSection {
295
287
  * The English toc section: the single source of the toc's English copy. The
296
288
  * `CNGX_TOC_CONFIG` labels default to it.
297
289
  *
298
- * @category ui/toc/i18n
299
- * @since 0.1.0
290
+ * @since 0.3.0
300
291
  * @relatedTo CNGX_TOC_CONFIG
301
292
  */
302
293
  declare const CNGX_TOC_LANGUAGE_EN: CngxTocLanguageSection;
@@ -311,8 +302,7 @@ declare module '@cngx/core/i18n' {
311
302
  * declared once there; an unset key reads the section (English without a
312
303
  * pack).
313
304
  *
314
- * @category ui/toc
315
- * @since 0.1.0
305
+ * @since 0.3.0
316
306
  */
317
307
  type CngxTocAriaLabels = Partial<CngxTocLanguageSection>;
318
308
  /**
@@ -331,8 +321,7 @@ type CngxTocAriaLabels = Partial<CngxTocLanguageSection>;
331
321
  * Every key is optional - partial overrides deep-merge with the library
332
322
  * defaults, so consumers declare only the keys they want to override.
333
323
  *
334
- * @category ui/toc
335
- * @since 0.1.0
324
+ * @since 0.3.0
336
325
  */
337
326
  interface CngxTocConfig {
338
327
  /**
@@ -405,9 +394,8 @@ declare const CNGX_TOC_DEFAULTS: CngxTocConfig;
405
394
  * `bootstrapApplication` providers (root cascade) or `provideTocConfigAt(...)`
406
395
  * in a component's `viewProviders` (sub-tree cascade).
407
396
  *
408
- * @category ui/toc
409
397
  * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/config/toc.config.defaults.ts
410
- * @since 0.1.0
398
+ * @since 0.3.0
411
399
  */
412
400
  declare const CNGX_TOC_CONFIG: InjectionToken<CngxTocConfig>;
413
401
 
@@ -420,8 +408,7 @@ declare const CNGX_TOC_CONFIG: InjectionToken<CngxTocConfig>;
420
408
  * `CngxBreadcrumbConfigFeature` so the consumer's mental model is one across
421
409
  * feature areas.
422
410
  *
423
- * @category ui/toc
424
- * @since 0.1.0
411
+ * @since 0.3.0
425
412
  */
426
413
  type CngxTocConfigFeature = {
427
414
  readonly kind: 'ariaLabels';
@@ -463,8 +450,7 @@ type CngxTocConfigFeature = {
463
450
  * });
464
451
  * ```
465
452
  *
466
- * @category ui/toc
467
- * @since 0.1.0
453
+ * @since 0.3.0
468
454
  */
469
455
  declare function provideTocConfig(...features: CngxTocConfigFeature[]): EnvironmentProviders;
470
456
  /**
@@ -485,8 +471,7 @@ declare function provideTocConfig(...features: CngxTocConfigFeature[]): Environm
485
471
  * class Guide {}
486
472
  * ```
487
473
  *
488
- * @category ui/toc
489
- * @since 0.1.0
474
+ * @since 0.3.0
490
475
  */
491
476
  declare function provideTocConfigAt(...features: CngxTocConfigFeature[]): Provider[];
492
477
 
@@ -499,8 +484,7 @@ declare function provideTocConfigAt(...features: CngxTocConfigFeature[]): Provid
499
484
  * provideTocConfig(withTocAriaLabels({ nav: 'Auf dieser Seite' }));
500
485
  * ```
501
486
  *
502
- * @category ui/toc
503
- * @since 0.1.0
487
+ * @since 0.3.0
504
488
  */
505
489
  declare function withTocAriaLabels(payload: CngxTocAriaLabels | Signal<CngxTocAriaLabels>): CngxTocConfigFeature;
506
490
  /**
@@ -513,8 +497,7 @@ declare function withTocAriaLabels(payload: CngxTocAriaLabels | Signal<CngxTocAr
513
497
  * provideTocConfig(withTocScrollBehavior('auto'));
514
498
  * ```
515
499
  *
516
- * @category ui/toc
517
- * @since 0.1.0
500
+ * @since 0.3.0
518
501
  */
519
502
  declare function withTocScrollBehavior(scrollBehavior: NonNullable<CngxTocConfig['scrollBehavior']>): CngxTocConfigFeature;
520
503
  /**
@@ -527,8 +510,7 @@ declare function withTocScrollBehavior(scrollBehavior: NonNullable<CngxTocConfig
527
510
  * provideTocConfig(withTocSpy({ rootMargin: '-80px 0px 0px 0px' }));
528
511
  * ```
529
512
  *
530
- * @category ui/toc
531
- * @since 0.1.0
513
+ * @since 0.3.0
532
514
  */
533
515
  declare function withTocSpy(payload: NonNullable<CngxTocConfig['spy']>): CngxTocConfigFeature;
534
516
  /**
@@ -536,14 +518,23 @@ declare function withTocSpy(payload: NonNullable<CngxTocConfig['spy']>): CngxToc
536
518
  * `*cngxTocItem` slot and before the built-in plain-label rendering, so every
537
519
  * un-slotted toc renders the same custom item markup.
538
520
  *
521
+ * A `TemplateRef` exists only once a view renders, so it cannot go into
522
+ * `viewProviders` or the root providers. Build the scope from the rendered
523
+ * template and hand it to `ngTemplateOutlet`:
524
+ *
539
525
  * ```ts
540
- * @Component({
541
- * viewProviders: [provideTocConfigAt(withTocTemplates({ item: myItemTpl }))],
542
- * })
526
+ * private readonly injector = inject(Injector);
527
+ * private readonly itemTpl = viewChild.required<TemplateRef<CngxTocItemContext>>('tocItem');
528
+ * protected readonly tocScope = computed(() =>
529
+ * Injector.create({
530
+ * parent: this.injector,
531
+ * providers: [provideTocConfigAt(withTocTemplates({ item: this.itemTpl() }))],
532
+ * }),
533
+ * );
534
+ * // <ng-container *ngTemplateOutlet="tocTpl; injector: tocScope()" />
543
535
  * ```
544
536
  *
545
- * @category ui/toc
546
- * @since 0.1.0
537
+ * @since 0.3.0
547
538
  */
548
539
  declare function withTocTemplates(payload: NonNullable<CngxTocConfig['templates']>): CngxTocConfigFeature;
549
540
 
@@ -561,8 +552,7 @@ declare function withTocTemplates(payload: NonNullable<CngxTocConfig['templates'
561
552
  * }
562
553
  * ```
563
554
  *
564
- * @category ui/toc
565
- * @since 0.1.0
555
+ * @since 0.3.0
566
556
  */
567
557
  declare function injectTocConfig(): CngxTocConfig;
568
558
  /**
@@ -572,8 +562,7 @@ declare function injectTocConfig(): CngxTocConfig;
572
562
  * language switch. Runs in injection context; read it inside a `computed()`, a template
573
563
  * or a handler.
574
564
  *
575
- * @category ui/toc
576
- * @since 0.1.0
565
+ * @since 0.3.0
577
566
  */
578
567
  declare function injectTocAriaLabels(): Signal<Required<CngxTocAriaLabels>>;
579
568
 
@@ -6,7 +6,7 @@ export * from '@cngx/ui/speak';
6
6
  export { CngxFailed, CngxPending, CngxSucceeded } from '@cngx/common/interactive';
7
7
 
8
8
  /**
9
- * @cngx/ui
9
+ * `@cngx/ui`
10
10
  *
11
11
  * Organism layer of cngx: 26 secondary entry points (layout, overlay,
12
12
  * feedback, stepper/mat-stepper, tabs/mat-tabs, accordion/mat-accordion,