@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9

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 (101) hide show
  1. package/README.md +0 -1
  2. package/a11y/README.md +11 -5
  3. package/accordion/README.md +4 -2
  4. package/breadcrumb/README.md +262 -0
  5. package/collection/README.md +6 -0
  6. package/command-palette/README.md +227 -0
  7. package/data-grid-accordion/README.md +76 -2
  8. package/feedback/README.md +40 -0
  9. package/fesm2022/cngx-ui-a11y.mjs +189 -57
  10. package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-accordion.mjs +120 -36
  12. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-action-button.mjs +121 -56
  14. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
  16. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
  18. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-collection.mjs +204 -62
  20. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-command-palette.mjs +395 -119
  22. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-context-menu.mjs +209 -40
  24. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  28. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-feedback.mjs +1074 -460
  30. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  31. package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
  32. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  33. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  34. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  35. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  36. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  37. package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
  38. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  39. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  40. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  41. package/fesm2022/cngx-ui-paginator.mjs +553 -198
  42. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  43. package/fesm2022/cngx-ui-sidenav.mjs +344 -109
  44. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  45. package/fesm2022/cngx-ui-skeleton.mjs +4 -16
  46. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  47. package/fesm2022/cngx-ui-speak.mjs +107 -8
  48. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  49. package/fesm2022/cngx-ui-stat-card.mjs +146 -46
  50. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
  51. package/fesm2022/cngx-ui-stepper.mjs +234 -99
  52. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  53. package/fesm2022/cngx-ui-tabs.mjs +88 -25
  54. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  55. package/fesm2022/cngx-ui-timeline.mjs +98 -23
  56. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  57. package/fesm2022/cngx-ui-toc.mjs +101 -33
  58. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  59. package/fesm2022/cngx-ui.mjs +15 -20
  60. package/fesm2022/cngx-ui.mjs.map +1 -1
  61. package/mat-paginator/README.md +9 -2
  62. package/mat-tabs/README.md +30 -6
  63. package/mat-tabs/styles/mat-tabs.css +188 -42
  64. package/overlay/README.md +9 -4
  65. package/package.json +31 -7
  66. package/paginator/README.md +8 -4
  67. package/schematics/collection.json +9 -0
  68. package/schematics/ng-add/index.js +9 -0
  69. package/schematics/ng-add/schema.json +91 -0
  70. package/schematics/package.json +3 -0
  71. package/sidenav/README.md +33 -11
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +14 -2
  74. package/timeline/README.md +1 -1
  75. package/toc/README.md +4 -1
  76. package/types/cngx-ui-a11y.d.ts +121 -30
  77. package/types/cngx-ui-accordion.d.ts +100 -28
  78. package/types/cngx-ui-action-button.d.ts +44 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +167 -60
  80. package/types/cngx-ui-chart-panel.d.ts +122 -18
  81. package/types/cngx-ui-collection.d.ts +157 -55
  82. package/types/cngx-ui-command-palette.d.ts +297 -183
  83. package/types/cngx-ui-context-menu.d.ts +140 -10
  84. package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +605 -59
  87. package/types/cngx-ui-mat-accordion.d.ts +30 -1
  88. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  89. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  90. package/types/cngx-ui-mat-tabs.d.ts +250 -34
  91. package/types/cngx-ui-overlay.d.ts +56 -10
  92. package/types/cngx-ui-paginator.d.ts +425 -136
  93. package/types/cngx-ui-sidenav.d.ts +248 -74
  94. package/types/cngx-ui-skeleton.d.ts +6 -7
  95. package/types/cngx-ui-speak.d.ts +118 -5
  96. package/types/cngx-ui-stat-card.d.ts +117 -33
  97. package/types/cngx-ui-stepper.d.ts +88 -49
  98. package/types/cngx-ui-tabs.d.ts +6 -4
  99. package/types/cngx-ui-timeline.d.ts +35 -11
  100. package/types/cngx-ui-toc.d.ts +93 -16
  101. package/types/cngx-ui.d.ts +7 -4
@@ -97,10 +97,12 @@ declare const CNGX_TOC: InjectionToken<CngxTocContract>;
97
97
  * @relatedTo CngxScrollSpy, CngxTocRouterSync, CngxSidenav
98
98
  * <example-url>http://localhost:4200/#/ui/toc/basic/on-this-page-rail</example-url>
99
99
  * <example-url>http://localhost:4200/#/ui/toc/auto/heading-auto-discovery</example-url>
100
+ * @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.
100
101
  */
101
102
  declare class CngxToc implements CngxTocContract {
102
103
  private readonly doc;
103
104
  private readonly cfg;
105
+ private readonly ariaLabels;
104
106
  private readonly reducedMotion;
105
107
  private readonly isBrowser;
106
108
  /**
@@ -137,10 +139,10 @@ declare class CngxToc implements CngxTocContract {
137
139
  private readonly discovered;
138
140
  /** The outline actually rendered: the discovered headings when `[autoDiscover]` is on, else `[items]`. */
139
141
  protected readonly resolvedItems: Signal<readonly CngxTocItem[]>;
140
- /** Accessible name of the `nav` landmark, from the config cascade. */
142
+ /** Accessible name of the `nav` landmark, from the config cascade; follows a language switch. */
141
143
  protected readonly navLabel: Signal<string>;
142
144
  /**
143
- * Depth-first flat id list feeding `[cngxScrollSpy]`. `equal: idsEqual`
145
+ * Depth-first flat id list feeding `[cngxScrollSpy]`. `equal: arrayEqual`
144
146
  * keeps the reference stable across same-shape re-sets so a re-render does
145
147
  * not re-create the observer.
146
148
  */
@@ -276,6 +278,43 @@ declare class CngxTocItemSlot {
276
278
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxTocItemSlot, "ng-template[cngxTocItem]", ["cngxTocItem"], {}, {}, never, never, true, never>;
277
279
  }
278
280
 
281
+ /**
282
+ * The toc section of a {@link CngxLanguagePack}: the accessible names of
283
+ * `CngxToc`. It feeds the `ariaLabels` of `CNGX_TOC_CONFIG`; a key set through
284
+ * `withTocAriaLabels` still wins.
285
+ *
286
+ * @category ui/toc/i18n
287
+ * @since 0.1.0
288
+ * @relatedTo CNGX_TOC_CONFIG, withTocAriaLabels
289
+ */
290
+ interface CngxTocLanguageSection {
291
+ /** Accessible name of the `nav` landmark. */
292
+ readonly nav: string;
293
+ }
294
+ /**
295
+ * The English toc section: the single source of the toc's English copy. The
296
+ * `CNGX_TOC_CONFIG` labels default to it.
297
+ *
298
+ * @category ui/toc/i18n
299
+ * @since 0.1.0
300
+ * @relatedTo CNGX_TOC_CONFIG
301
+ */
302
+ declare const CNGX_TOC_LANGUAGE_EN: CngxTocLanguageSection;
303
+ declare module '@cngx/core/i18n' {
304
+ interface CngxLanguagePack {
305
+ readonly toc: CngxTocLanguageSection;
306
+ }
307
+ }
308
+
309
+ /**
310
+ * Accessible names the toc renders. A partial of the `toc` language section,
311
+ * declared once there; an unset key reads the section (English without a
312
+ * pack).
313
+ *
314
+ * @category ui/toc
315
+ * @since 0.1.0
316
+ */
317
+ type CngxTocAriaLabels = Partial<CngxTocLanguageSection>;
279
318
  /**
280
319
  * App-wide cascade for the table-of-contents organism's ARIA label, its
281
320
  * scroll behaviour, the `CngxScrollSpy` defaults it forwards, and the default
@@ -286,7 +325,8 @@ declare class CngxTocItemSlot {
286
325
  * 2. `provideTocConfigAt(...)` in a parent component's `viewProviders`
287
326
  * (component-scoped override).
288
327
  * 3. `provideTocConfig(...)` at the application root.
289
- * 4. Library defaults (English; merged in via `CNGX_TOC_DEFAULTS`).
328
+ * 4. Library defaults (`CNGX_TOC_DEFAULTS`; the names come from the `toc`
329
+ * section of the language pack).
290
330
  *
291
331
  * Every key is optional - partial overrides deep-merge with the library
292
332
  * defaults, so consumers declare only the keys they want to override.
@@ -298,12 +338,12 @@ interface CngxTocConfig {
298
338
  /**
299
339
  * ARIA-string fallback for the `nav` landmark. A per-instance
300
340
  * `[navLabel]`-equivalent binding is not exposed; the landmark name always
301
- * comes from this cascade, English by default.
341
+ * comes from this cascade, the `toc` section of the language pack by
342
+ * default. Accepts a `Signal` so the
343
+ * name follows a runtime language switch; read the resolved bundle through
344
+ * {@link injectTocAriaLabels}.
302
345
  */
303
- readonly ariaLabels?: {
304
- /** Accessible name of the `nav` landmark that wraps the link list. */
305
- readonly nav?: string;
306
- };
346
+ readonly ariaLabels?: CngxTocAriaLabels | Signal<CngxTocAriaLabels>;
307
347
  /**
308
348
  * Scroll behaviour used when a link is activated and the section is
309
349
  * brought into view. `'smooth'` by default; swapped to `'auto'` (instant)
@@ -335,6 +375,21 @@ interface CngxTocConfig {
335
375
  };
336
376
  }
337
377
 
378
+ /**
379
+ * Library defaults for the toc configuration cascade. Carries no copy: the
380
+ * `ariaLabels` defaults are the `toc` section of the language pack; single
381
+ * keys ride the `withTocAriaLabels` feature. The spy defaults (`rootMargin` / `threshold`) mirror
382
+ * `CngxScrollSpy`'s own input defaults so an un-configured toc tracks
383
+ * scrolling identically to a hand-wired spy.
384
+ *
385
+ * Exported for intra-lib consumers (`provideTocConfig` deep-merges with this
386
+ * base) but **NOT** re-exported from `public-api.ts` - downstream consumers
387
+ * reach the defaults via `inject(CNGX_TOC_CONFIG)` so `provideTocConfig` /
388
+ * `provideTocConfigAt` overrides take precedence.
389
+ *
390
+ * @internal
391
+ */
392
+ declare const CNGX_TOC_DEFAULTS: CngxTocConfig;
338
393
  /**
339
394
  * App-wide configuration cascade for the table-of-contents organism. Resolves
340
395
  * in priority order:
@@ -370,7 +425,7 @@ declare const CNGX_TOC_CONFIG: InjectionToken<CngxTocConfig>;
370
425
  */
371
426
  type CngxTocConfigFeature = {
372
427
  readonly kind: 'ariaLabels';
373
- readonly payload: NonNullable<CngxTocConfig['ariaLabels']>;
428
+ readonly payload: CngxTocAriaLabels | Signal<CngxTocAriaLabels>;
374
429
  } | {
375
430
  readonly kind: 'scrollBehavior';
376
431
  readonly payload: {
@@ -437,7 +492,8 @@ declare function provideTocConfigAt(...features: CngxTocConfigFeature[]): Provid
437
492
 
438
493
  /**
439
494
  * Override the toc's ARIA-string fallback - the accessible name of the `nav`
440
- * landmark that wraps the link list (default `'On this page'`).
495
+ * landmark that wraps the link list (default `'On this page'`). Pass a
496
+ * `Signal` to switch the language at runtime.
441
497
  *
442
498
  * ```ts
443
499
  * provideTocConfig(withTocAriaLabels({ nav: 'Auf dieser Seite' }));
@@ -446,7 +502,7 @@ declare function provideTocConfigAt(...features: CngxTocConfigFeature[]): Provid
446
502
  * @category ui/toc
447
503
  * @since 0.1.0
448
504
  */
449
- declare function withTocAriaLabels(payload: NonNullable<CngxTocConfig['ariaLabels']>): CngxTocConfigFeature;
505
+ declare function withTocAriaLabels(payload: CngxTocAriaLabels | Signal<CngxTocAriaLabels>): CngxTocConfigFeature;
450
506
  /**
451
507
  * Set the app-wide default scroll behaviour used when a link is activated.
452
508
  * `'smooth'` by default; the organism still swaps to `'auto'` at runtime
@@ -480,10 +536,20 @@ declare function withTocSpy(payload: NonNullable<CngxTocConfig['spy']>): CngxToc
480
536
  * `*cngxTocItem` slot and before the built-in plain-label rendering, so every
481
537
  * un-slotted toc renders the same custom item markup.
482
538
  *
539
+ * A `TemplateRef` exists only once a view renders, so it cannot go into
540
+ * `viewProviders` or the root providers. Build the scope from the rendered
541
+ * template and hand it to `ngTemplateOutlet`:
542
+ *
483
543
  * ```ts
484
- * @Component({
485
- * viewProviders: [provideTocConfigAt(withTocTemplates({ item: myItemTpl }))],
486
- * })
544
+ * private readonly injector = inject(Injector);
545
+ * private readonly itemTpl = viewChild.required<TemplateRef<CngxTocItemContext>>('tocItem');
546
+ * protected readonly tocScope = computed(() =>
547
+ * Injector.create({
548
+ * parent: this.injector,
549
+ * providers: [provideTocConfigAt(withTocTemplates({ item: this.itemTpl() }))],
550
+ * }),
551
+ * );
552
+ * // <ng-container *ngTemplateOutlet="tocTpl; injector: tocScope()" />
487
553
  * ```
488
554
  *
489
555
  * @category ui/toc
@@ -509,6 +575,17 @@ declare function withTocTemplates(payload: NonNullable<CngxTocConfig['templates'
509
575
  * @since 0.1.0
510
576
  */
511
577
  declare function injectTocConfig(): CngxTocConfig;
578
+ /**
579
+ * The resolved accessible names of the toc config in scope, every key the
580
+ * config leaves unset (also a key an override sets to `undefined`) filled from
581
+ * the `toc` section of the active pack, as a Signal that follows a runtime
582
+ * language switch. Runs in injection context; read it inside a `computed()`, a template
583
+ * or a handler.
584
+ *
585
+ * @category ui/toc
586
+ * @since 0.1.0
587
+ */
588
+ declare function injectTocAriaLabels(): Signal<Required<CngxTocAriaLabels>>;
512
589
 
513
- export { CNGX_TOC, CNGX_TOC_CONFIG, CngxToc, CngxTocItemSlot, CngxTocRouterSync, injectTocConfig, provideTocConfig, provideTocConfigAt, withTocAriaLabels, withTocScrollBehavior, withTocSpy, withTocTemplates };
514
- export type { CngxTocConfig, CngxTocConfigFeature, CngxTocContract, CngxTocItem, CngxTocItemContext };
590
+ export { CNGX_TOC, CNGX_TOC_CONFIG, CNGX_TOC_DEFAULTS, CNGX_TOC_LANGUAGE_EN, CngxToc, CngxTocItemSlot, CngxTocRouterSync, injectTocAriaLabels, injectTocConfig, provideTocConfig, provideTocConfigAt, withTocAriaLabels, withTocScrollBehavior, withTocSpy, withTocTemplates };
591
+ export type { CngxTocAriaLabels, CngxTocConfig, CngxTocConfigFeature, CngxTocContract, CngxTocItem, CngxTocItemContext, CngxTocLanguageSection };
@@ -8,10 +8,13 @@ export { CngxFailed, CngxPending, CngxSucceeded } from '@cngx/common/interactive
8
8
  /**
9
9
  * @cngx/ui
10
10
  *
11
- * UI components for cngx composable Angular extensions.
12
- * Secondary entry points:
13
- * @cngx/ui/layout – CngxStack, CngxGrid
14
- * @cngx/ui/overlay – CngxOverlay, CngxOverlayRef
11
+ * Organism layer of cngx: 26 secondary entry points (layout, overlay,
12
+ * feedback, stepper/mat-stepper, tabs/mat-tabs, accordion/mat-accordion,
13
+ * paginator/mat-paginator, sidenav, breadcrumb, timeline, toc,
14
+ * command-palette, context-menu, collection, stat-card, chart-panel,
15
+ * data-grid-accordion, empty-state, action-button, skeleton, speak, a11y).
16
+ * Import from the specific entry point; the root barrel keeps only a
17
+ * small backwards-compat set (see public-api.ts).
15
18
  */
16
19
  /** @internal - replaced at publish time, not part of consumer API. */
17
20
  declare const VERSION: _cngx_utils.Version;