@cngx/ui 0.1.0-rc.6 → 0.1.0-rc.8

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 (102) hide show
  1. package/README.md +112 -1
  2. package/a11y/README.md +87 -0
  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 +224 -0
  7. package/context-menu/README.md +98 -0
  8. package/data-grid-accordion/README.md +103 -2
  9. package/feedback/README.md +42 -0
  10. package/fesm2022/cngx-ui-a11y.mjs +452 -0
  11. package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
  12. package/fesm2022/cngx-ui-accordion.mjs +116 -38
  13. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  14. package/fesm2022/cngx-ui-action-button.mjs +115 -50
  15. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  16. package/fesm2022/cngx-ui-breadcrumb.mjs +181 -96
  17. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  18. package/fesm2022/cngx-ui-chart-panel.mjs +586 -0
  19. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-collection.mjs +207 -66
  21. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  22. package/fesm2022/cngx-ui-command-palette.mjs +1281 -0
  23. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
  24. package/fesm2022/cngx-ui-context-menu.mjs +857 -0
  25. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -111
  27. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  28. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  29. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  30. package/fesm2022/cngx-ui-feedback.mjs +1095 -521
  31. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  32. package/fesm2022/cngx-ui-layout.mjs +18 -9
  33. package/fesm2022/cngx-ui-layout.mjs.map +1 -1
  34. package/fesm2022/cngx-ui-mat-accordion.mjs +84 -16
  35. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  36. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  37. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  38. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  39. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  40. package/fesm2022/cngx-ui-mat-tabs.mjs +370 -203
  41. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  42. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  43. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  44. package/fesm2022/cngx-ui-paginator.mjs +501 -182
  45. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  46. package/fesm2022/cngx-ui-sidenav.mjs +327 -106
  47. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  48. package/fesm2022/cngx-ui-skeleton.mjs +22 -21
  49. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  50. package/fesm2022/cngx-ui-speak.mjs +107 -8
  51. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  52. package/fesm2022/cngx-ui-stat-card.mjs +718 -0
  53. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
  54. package/fesm2022/cngx-ui-stepper.mjs +217 -76
  55. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  56. package/fesm2022/cngx-ui-tabs.mjs +40 -19
  57. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  58. package/fesm2022/cngx-ui-timeline.mjs +548 -0
  59. package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
  60. package/fesm2022/cngx-ui-toc.mjs +748 -0
  61. package/fesm2022/cngx-ui-toc.mjs.map +1 -0
  62. package/fesm2022/cngx-ui.mjs +16 -21
  63. package/fesm2022/cngx-ui.mjs.map +1 -1
  64. package/mat-accordion/README.md +1 -1
  65. package/mat-paginator/README.md +9 -2
  66. package/mat-tabs/styles/mat-tabs.css +29 -27
  67. package/overlay/README.md +9 -4
  68. package/package.json +32 -1
  69. package/paginator/README.md +8 -4
  70. package/sidenav/README.md +33 -11
  71. package/skeleton/README.md +2 -0
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +15 -3
  74. package/timeline/README.md +350 -0
  75. package/toc/README.md +186 -0
  76. package/types/cngx-ui-a11y.d.ts +394 -0
  77. package/types/cngx-ui-accordion.d.ts +100 -30
  78. package/types/cngx-ui-action-button.d.ts +47 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +159 -58
  80. package/types/cngx-ui-chart-panel.d.ts +382 -0
  81. package/types/cngx-ui-collection.d.ts +159 -58
  82. package/types/cngx-ui-command-palette.d.ts +565 -0
  83. package/types/cngx-ui-context-menu.d.ts +559 -0
  84. package/types/cngx-ui-data-grid-accordion.d.ts +344 -51
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +664 -73
  87. package/types/cngx-ui-layout.d.ts +8 -3
  88. package/types/cngx-ui-mat-accordion.d.ts +32 -4
  89. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  90. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  91. package/types/cngx-ui-mat-tabs.d.ts +218 -23
  92. package/types/cngx-ui-overlay.d.ts +56 -10
  93. package/types/cngx-ui-paginator.d.ts +416 -132
  94. package/types/cngx-ui-sidenav.d.ts +248 -74
  95. package/types/cngx-ui-skeleton.d.ts +18 -7
  96. package/types/cngx-ui-speak.d.ts +118 -5
  97. package/types/cngx-ui-stat-card.d.ts +411 -0
  98. package/types/cngx-ui-stepper.d.ts +81 -29
  99. package/types/cngx-ui-tabs.d.ts +22 -6
  100. package/types/cngx-ui-timeline.d.ts +495 -0
  101. package/types/cngx-ui-toc.d.ts +581 -0
  102. package/types/cngx-ui.d.ts +8 -5
@@ -1,11 +1,33 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Type, EnvironmentProviders } from '@angular/core';
2
+ import { Signal, Type, EnvironmentProviders } from '@angular/core';
3
3
  import { OverlayRef, OverlayConfig } from '@angular/cdk/overlay';
4
4
  import * as rxjs from 'rxjs';
5
5
 
6
+ /**
7
+ * Construction-time options for a {@link CngxOverlayRef}. Set by
8
+ * {@link CngxOverlay.open}, not by consumers.
9
+ *
10
+ * @category ui/overlay
11
+ */
12
+ interface CngxOverlayRefConfig {
13
+ /**
14
+ * When `true`, neither Escape nor a backdrop click closes the overlay - the
15
+ * only way out is a programmatic `close()`. Default `false`.
16
+ */
17
+ readonly disableClose?: boolean;
18
+ /**
19
+ * Element focus returns to when the overlay closes - captured at open time,
20
+ * before the overlay steals focus. `null` skips restoration.
21
+ */
22
+ readonly restoreFocusTo?: HTMLElement | null;
23
+ }
6
24
  /**
7
25
  * Typed wrapper around a CDK OverlayRef that exposes a close result stream.
8
26
  *
27
+ * Closes on Escape and on a backdrop click (unless `disableClose`), restores
28
+ * focus to the element that opened it, and surfaces its open state as a signal
29
+ * beside the RxJS `afterClosed$`.
30
+ *
9
31
  * @category ui/overlay
10
32
  * @docsKind primary
11
33
  * @wcag AA
@@ -18,19 +40,38 @@ declare class CngxOverlayRef<R = unknown> {
18
40
  private readonly _afterClosed;
19
41
  /** Emits once with the close result when the overlay is dismissed, then completes. */
20
42
  readonly afterClosed$: rxjs.Observable<R | undefined>;
21
- constructor(cdkRef: OverlayRef);
22
- /** Closes the overlay, emitting `result` on `afterClosed$`, then disposes the CDK ref. */
43
+ private readonly openState;
44
+ /**
45
+ * `true` while the overlay is open, `false` once closed. The signal view of
46
+ * the lifecycle beside {@link afterClosed$} - bind it in a template without
47
+ * an `async` pipe.
48
+ */
49
+ readonly isOpen: Signal<boolean>;
50
+ private readonly restoreFocusTo;
51
+ constructor(cdkRef: OverlayRef, config?: CngxOverlayRefConfig);
52
+ /**
53
+ * Closes the overlay, emitting `result` on `afterClosed$`, disposing the CDK
54
+ * ref, and restoring focus. Idempotent - a second call (e.g. Escape after a
55
+ * scope teardown already closed it) is a no-op.
56
+ */
23
57
  close(result?: R): void;
24
58
  }
25
59
 
26
60
  /**
27
- * Config accepted by {@link CngxOverlay.open}. Partial alias of CDK's
28
- * {@link OverlayConfig} - every field is optional and falls back to
29
- * the CDK overlay default.
61
+ * Config accepted by {@link CngxOverlay.open}. A partial of CDK's
62
+ * {@link OverlayConfig} - every field is optional and falls back to the CDK
63
+ * overlay default - plus `disableClose`, a cngx addition that turns off the
64
+ * Escape / backdrop dismiss affordances.
30
65
  *
31
66
  * @category ui/overlay
32
67
  */
33
- type CngxOverlayConfig = Partial<OverlayConfig>;
68
+ type CngxOverlayConfig = Partial<OverlayConfig> & {
69
+ /**
70
+ * When `true`, Escape and backdrop clicks do not close the overlay; only a
71
+ * programmatic `close()` does. Default `false`.
72
+ */
73
+ readonly disableClose?: boolean;
74
+ };
34
75
  /**
35
76
  * Thin service over CDK Overlay that returns a typed CngxOverlayRef.
36
77
  *
@@ -54,14 +95,19 @@ type CngxOverlayConfig = Partial<OverlayConfig>;
54
95
  declare class CngxOverlay {
55
96
  private readonly overlay;
56
97
  private readonly injector;
98
+ private readonly document;
99
+ private readonly openRefs;
100
+ constructor();
57
101
  /**
58
102
  * Opens `component` in a CDK overlay panel and returns a typed ref.
59
103
  *
60
- * Defaults to a centered, backdropped panel. Merge `config` to override
61
- * position strategy, scroll strategy, or any other CDK `OverlayConfig` option.
104
+ * Defaults to a centered, backdropped panel that closes on Escape or a
105
+ * backdrop click; pass `disableClose` to opt out. Focus returns to the
106
+ * element that was focused at open time. Merge `config` to override position
107
+ * strategy, scroll strategy, or any other CDK `OverlayConfig` option.
62
108
  *
63
109
  * @param component Component class to attach as a portal.
64
- * @param config CDK overlay configuration overrides.
110
+ * @param config Overlay configuration overrides (CDK options + `disableClose`).
65
111
  */
66
112
  open<C, R = unknown>(component: Type<C>, config?: CngxOverlayConfig): CngxOverlayRef<R>;
67
113
  static ɵfac: i0.ɵɵFactoryDeclaration<CngxOverlay, never>;