@cngx/ui 0.0.1-rc.0 → 0.1.0-rc.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 (60) hide show
  1. package/README.md +22 -48
  2. package/action-button/README.md +9 -11
  3. package/empty-state/README.md +11 -26
  4. package/feedback/README.md +3 -3
  5. package/fesm2022/cngx-ui-action-button.mjs +30 -26
  6. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  7. package/fesm2022/cngx-ui-empty-state.mjs +26 -21
  8. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  9. package/fesm2022/cngx-ui-feedback.mjs +498 -261
  10. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-layout.mjs +32 -5
  12. package/fesm2022/cngx-ui-layout.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-mat-stepper.mjs +79 -104
  14. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-mat-tabs.mjs +111 -83
  16. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-material.mjs +14 -3
  18. package/fesm2022/cngx-ui-material.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-overlay.mjs +22 -3
  20. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-sidenav.mjs +107 -28
  22. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-skeleton.mjs +61 -20
  24. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-speak.mjs +14 -5
  26. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-stepper.mjs +484 -161
  28. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-tabs.mjs +75 -39
  30. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  31. package/fesm2022/cngx-ui.mjs +2 -1
  32. package/fesm2022/cngx-ui.mjs.map +1 -1
  33. package/layout/README.md +9 -44
  34. package/mat-stepper/README.md +7 -10
  35. package/mat-tabs/README.md +13 -13
  36. package/mat-tabs/styles/mat-tabs.css +339 -213
  37. package/material/README.md +19 -19
  38. package/overlay/README.md +11 -11
  39. package/package.json +5 -4
  40. package/sidenav/README.md +4 -19
  41. package/skeleton/README.md +3 -17
  42. package/speak/README.md +15 -15
  43. package/stepper/README.md +139 -5
  44. package/tabs/README.md +4 -4
  45. package/theming/system-tokens.css +29 -0
  46. package/types/cngx-ui-action-button.d.ts +28 -13
  47. package/types/cngx-ui-empty-state.d.ts +21 -9
  48. package/types/cngx-ui-feedback.d.ts +437 -121
  49. package/types/cngx-ui-layout.d.ts +38 -8
  50. package/types/cngx-ui-mat-stepper.d.ts +58 -43
  51. package/types/cngx-ui-mat-tabs.d.ts +122 -72
  52. package/types/cngx-ui-material.d.ts +12 -1
  53. package/types/cngx-ui-overlay.d.ts +25 -4
  54. package/types/cngx-ui-sidenav.d.ts +106 -12
  55. package/types/cngx-ui-skeleton.d.ts +62 -8
  56. package/types/cngx-ui-speak.d.ts +10 -2
  57. package/types/cngx-ui-stepper.d.ts +280 -56
  58. package/types/cngx-ui-tabs.d.ts +38 -10
  59. package/types/cngx-ui.d.ts +1 -0
  60. package/speak/speak-button-theme.scss +0 -78
@@ -1,10 +1,22 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
 
3
- /** Main-axis direction for {@link CngxStack}. */
3
+ /**
4
+ * Main-axis direction for {@link CngxStack}.
5
+ *
6
+ * @category ui/layout
7
+ */
4
8
  type StackDirection = 'row' | 'column';
5
- /** Cross-axis alignment for {@link CngxStack}. */
9
+ /**
10
+ * Cross-axis alignment for {@link CngxStack}.
11
+ *
12
+ * @category ui/layout
13
+ */
6
14
  type StackAlign = 'start' | 'center' | 'end' | 'stretch';
7
- /** Spacing scale for {@link CngxStack}. Maps to `--cngx-gap-*` tokens. */
15
+ /**
16
+ * Spacing scale for {@link CngxStack}. Maps to `--cngx-gap-*` tokens.
17
+ *
18
+ * @category ui/layout
19
+ */
8
20
  type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
21
  /**
10
22
  * Composable flex-based stack layout component.
@@ -17,6 +29,12 @@ type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
17
29
  * <div>Item 1</div>
18
30
  * <div>Item 2</div>
19
31
  * </cngx-stack>
32
+ *
33
+ * @category ui/layout
34
+ * @docsKind primary
35
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/layout/stack.component.ts
36
+ * @since 0.1.0
37
+ * @relatedTo CngxGrid
20
38
  */
21
39
  declare class CngxStack {
22
40
  /** Flex direction of the stack. */
@@ -35,15 +53,27 @@ declare class CngxStack {
35
53
 
36
54
  /**
37
55
  * Composable CSS grid layout component.
56
+ ``` html
57
+ <cngx-grid columns="3" gap="16px">
58
+ <div>Cell 1</div>
59
+ <div>Cell 2</div>
60
+ </cngx-grid>
61
+ ```
62
+ * `columns` accepts either a positive integer for the
63
+ * `repeat(N, 1fr)` shortcut or any `grid-template-columns` value
64
+ * (`"200px 1fr"`, `"repeat(auto-fit, minmax(120px, 1fr))"`).
65
+ * Bare attribute syntax works for both forms: `columns="3"` and
66
+ * `[columns]="3"` produce identical output.
38
67
  *
39
- * <cngx-grid columns="3" gap="16px">
40
- * <div>Cell 1</div>
41
- * <div>Cell 2</div>
42
- * </cngx-grid>
68
+ * @category ui/layout
69
+ * @docsKind primary
70
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/layout/grid.component.ts
71
+ * @since 0.1.0
72
+ * @relatedTo CngxStack
43
73
  */
44
74
  declare class CngxGrid {
45
75
  /** Number of equal columns, or a custom `grid-template-columns` value. */
46
- readonly columns: _angular_core.InputSignal<string | number>;
76
+ readonly columns: _angular_core.InputSignalWithTransform<string | number, string | number>;
47
77
  /** CSS gap between cells. */
48
78
  readonly gap: _angular_core.InputSignal<string>;
49
79
  /** @internal */
@@ -6,7 +6,7 @@ import { MatStepper, MatStep } from '@angular/material/stepper';
6
6
 
7
7
  /**
8
8
  * Material-twin stepper organism. Wraps `<mat-stepper>` and shares
9
- * the `CngxStepperPresenter` brain with `<cngx-stepper>` — Material
9
+ * the `CngxStepperPresenter` brain with `<cngx-stepper>` - Material
10
10
  * consumers gain the commit-action lifecycle, router sync, and error
11
11
  * aggregation.
12
12
  *
@@ -16,9 +16,19 @@ import { MatStepper, MatStep } from '@angular/material/stepper';
16
16
  *
17
17
  * Material owns keyboard nav and focus on `MatStepperHeader`, so the
18
18
  * organism does NOT compose `CngxRovingTabindex` /
19
- * `CngxFocusRestore`. Group nodes flatten — `<mat-stepper>` does not
20
- * support nesting — with the depth preserved as a `data-step-depth`
19
+ * `CngxFocusRestore`. Group nodes flatten - `<mat-stepper>` does not
20
+ * support nesting - with the depth preserved as a `data-step-depth`
21
21
  * hint on the rendered label.
22
+ *
23
+ * @playground Bridge instrumentation ./examples/bridge/bridge-example.component.ts
24
+ *
25
+ * @category ui/mat-stepper
26
+ * @docsKind primary
27
+ * @wcag AA
28
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/mat-stepper.component.ts
29
+ * @since 0.1.0
30
+ * @relatedTo CngxMatStepperBridge, CngxStepperPresenter, CngxStep
31
+ * <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/mat-stepper-footer</example-url>
22
32
  */
23
33
  declare class CngxMatStepper implements CngxStepPanelHost {
24
34
  protected readonly presenter: i1.CngxStepperHost;
@@ -34,10 +44,9 @@ declare class CngxMatStepper implements CngxStepPanelHost {
34
44
  * Consumer-projected `<ng-template matStepperIcon>` templates,
35
45
  * forwarded into `MatStepper._iconOverrides` from the
36
46
  * `afterNextRender` patch below. `<ng-content>` projection cannot
37
- * reach Material's `@ContentChildren(MatStepperIcon)` — content-init
47
+ * reach Material's `@ContentChildren(MatStepperIcon)` - content-init
38
48
  * resolves the inner query before the wrapper's projection lands.
39
- * `_iconOverrides` is a Material-internal slot;
40
- * `tabs-accepted-debt §5`.
49
+ * `_iconOverrides` is a Material-internal slot.
41
50
  */
42
51
  private readonly stepperIcons;
43
52
  /**
@@ -48,7 +57,7 @@ declare class CngxMatStepper implements CngxStepPanelHost {
48
57
  */
49
58
  private readonly stepDirectiveById;
50
59
  /**
51
- * Step-only flat projection — `<mat-step>` does not nest, so
60
+ * Step-only flat projection - `<mat-step>` does not nest, so
52
61
  * groups collapse into the same level. Memoised via
53
62
  * `flatStepsEqual` so consumers (`stepLabel`, panel `@for`,
54
63
  * `stepLabelContextFor`) don't re-walk on shape-stable
@@ -56,10 +65,10 @@ declare class CngxMatStepper implements CngxStepPanelHost {
56
65
  * `CngxStepper.stepsOnly`.
57
66
  */
58
67
  protected readonly stepsOnly: Signal<readonly CngxStepNode[]>;
59
- /** Material orientation literal — narrows our `'horizontal'|'vertical'` to its own union. */
68
+ /** Material orientation literal - narrows our `'horizontal'|'vertical'` to its own union. */
60
69
  protected readonly matOrientation: Signal<"horizontal" | "vertical">;
61
70
  protected stepIndexOf(node: CngxStepNode): number;
62
- /** Editability rule — non-linear lets every step click; linear only past completed. */
71
+ /** Editability rule - non-linear lets every step click; linear only past completed. */
63
72
  protected isEditable(node: CngxStepNode): boolean;
64
73
  protected hasError(node: CngxStepNode): boolean;
65
74
  protected isCompleted(node: CngxStepNode): boolean;
@@ -84,12 +93,12 @@ declare class CngxMatStepper implements CngxStepPanelHost {
84
93
  protected stepContentContextFor(node: CngxStepNode): CngxStepContentContext;
85
94
  constructor();
86
95
  static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatStepper, never>;
87
- static ɵcmp: i0.ɵɵComponentDeclaration<CngxMatStepper, "cngx-mat-stepper", ["cngxMatStepper"], {}, {}, ["stepDirectives", "stepperIcons"], never, true, [{ directive: typeof i1.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; "orientation": "orientation"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }]>;
96
+ static ɵcmp: i0.ɵɵComponentDeclaration<CngxMatStepper, "cngx-mat-stepper", ["cngxMatStepper"], {}, {}, ["stepDirectives", "stepperIcons"], ["cngx-stepper-footer, [cngxStepperFooter]"], true, [{ directive: typeof i1.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; "orientation": "orientation"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }]>;
88
97
  }
89
98
 
90
99
  /**
91
100
  * Attaches to an existing `<mat-stepper>` and bridges it to a
92
- * {@link CngxStepperPresenter} — consumers gain the commit-action
101
+ * {@link CngxStepperPresenter} - consumers gain the commit-action
93
102
  * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` /
94
103
  * `<cngx-banner-on />` compose as children), and the step-handle
95
104
  * registry from one attribute.
@@ -101,8 +110,14 @@ declare class CngxMatStepper implements CngxStepPanelHost {
101
110
  * with the wrapper's `cngxMatStepper`.
102
111
  *
103
112
  * Topology mirrors `[cngxMatTabs]`: Material is the host, cngx is
104
- * the instrumentation layer. `stepper-accepted-debt §1`'s blocker
105
- * applies to adoption, not this direction.
113
+ * the instrumentation layer.
114
+ *
115
+ * @category ui/mat-stepper
116
+ * @docsKind primary
117
+ * @wcag AA
118
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/mat-stepper.directive.ts
119
+ * @since 0.1.0
120
+ * @relatedTo CngxMatStepper, CngxStepperPresenter, CngxMatTabs
106
121
  */
107
122
  declare class CngxMatStepperBridge {
108
123
  private readonly matStepper;
@@ -131,65 +146,63 @@ interface CngxMatStepHandleSetup {
131
146
  * Translates a Material `MatStep` into a cngx
132
147
  * {@link CngxStepRegistration}.
133
148
  *
134
- * - `id` — always a fresh `idSeed()` value. Mirrors the tabs
149
+ * - `id` - always a fresh `idSeed()` value. Mirrors the tabs
135
150
  * instrumentation handle: a label-keyed id would collide when
136
151
  * two steps share a label.
137
- * - `kind` — fixed at `'step'`. The instrumentation path does not
152
+ * - `kind` - fixed at `'step'`. The instrumentation path does not
138
153
  * project nested `<mat-step>` groups (Material's stepper has no
139
154
  * group-of-steps concept; group-aware semantics belong to the
140
155
  * `<cngx-stepper>` thin-wrapper organism).
141
- * - `label` — snapshot signal resolved through a four-tier fallback at
156
+ * - `label` - snapshot signal resolved through a four-tier fallback at
142
157
  * registration time so cngx-side phrases (announcements,
143
158
  * `aria-label` composition, telemetry) never read empty when
144
159
  * Material consumers project a `<ng-template matStepLabel>`:
145
- * 1. `MatStep.label` when it is a plain string — the canonical
160
+ * 1. `MatStep.label` when it is a plain string - the canonical
146
161
  * shape and the only one that emits a runtime change Material
147
162
  * itself observes.
148
- * 2. `MatStep.ariaLabel` when the consumer set the input —
163
+ * 2. `MatStep.ariaLabel` when the consumer set the input -
149
164
  * designed exactly as the substitute for template labels.
150
165
  * 3. Static-text read from `MatStep.stepLabel.template` via a
151
166
  * throwaway detached `EmbeddedViewRef` ({@link readMatStepLabelTemplateText}).
152
167
  * Captures literal `matStepLabel` markup; dynamic interpolation
153
168
  * bails through to (4).
154
- * 4. `Step <id>` — deterministic, derived from the cngx handle
169
+ * 4. `Step <id>` - deterministic, derived from the cngx handle
155
170
  * id. Always non-empty.
156
- * Phase-2 limitation: runtime label changes do not propagate. CDK's
157
- * `CdkStep` does not expose a `_stateChanges` Subject analogous to
158
- * `MatTab._stateChanges`, so cngx cannot re-trigger the snapshot
159
- * when Material flips the input later. Tracked under
160
- * `stepper-accepted-debt §4` alongside the matStepperIcon
161
- * forwarding limitations — both surface the same Material-internal
162
- * coupling family typed in
163
- * `MaterialPrivateSurfaces.CompletedOverrideSource` (see Phase 6.1).
164
- * - `disabled` — fixed `false`. Material owns step gating via
171
+ * Documented limitation: runtime label changes do not propagate.
172
+ * CDK's `CdkStep` does not expose a `_stateChanges` Subject
173
+ * analogous to `MatTab._stateChanges`, so cngx cannot re-trigger
174
+ * the snapshot when Material flips the input later. Surface the
175
+ * same Material-internal coupling family typed in
176
+ * `MaterialPrivateSurfaces.CompletedOverrideSource`.
177
+ * - `disabled` - fixed `false`. Material owns step gating via
165
178
  * `linear` + `editable` + `completed`; surfacing a cngx-side
166
179
  * `disabled` would duplicate Material's own click-time enforcement
167
180
  * and is ignored by `<mat-stepper>` itself.
168
- * - `state` — `computed()` over `MatStep.hasError` / `MatStep.completed`.
169
- * `CdkStep.completed`'s getter reads `_completedOverride()` — a
181
+ * - `state` - `computed()` over `MatStep.hasError` / `MatStep.completed`.
182
+ * `CdkStep.completed`'s getter reads `_completedOverride()` - a
170
183
  * `WritableSignal<boolean | null>` typed in
171
184
  * `MaterialPrivateSurfaces.CompletedOverrideSource`. The cngx
172
185
  * computed transitively tracks that signal through the getter and
173
186
  * re-fires whenever Material flips completion. `hasError` is a
174
- * plain property setter on `CdkStep`, NOT a Signal — a `hasError`
187
+ * plain property setter on `CdkStep`, NOT a Signal - a `hasError`
175
188
  * write that is not paired with a `completed` change does not
176
189
  * re-trigger this computed. In practice Material wizards write the
177
190
  * two together (`step.hasError = true; step.completed = false` in
178
191
  * error-handler patterns and inside Material's own error-state
179
192
  * matchers) so the limitation is benign for the documented usage
180
- * pattern. Tracked under `stepper-accepted-debt §4` as the
181
- * `_completedOverride` re-fire contract; the Re-Eval Trigger fires
182
- * when Material exposes a public `_stateChanges`-equivalent Subject
183
- * on `CdkStep` OR a consumer issue confirms an unpaired-`hasError`
184
- * write reaches production.
185
- * - `errorAggregator` — points at the shared
193
+ * pattern.
194
+ * - `errorAggregator` - points at the shared
186
195
  * {@link NO_ERROR_AGGREGATOR} constant.
196
+ *
197
+ * @category ui/mat-stepper
187
198
  */
188
199
  declare function createMatStepHandle(matStep: MatStep, idSeed: () => string): CngxMatStepHandleSetup;
189
200
  /**
190
201
  * Factory signature for {@link createMatStepHandle}. The DI token
191
202
  * {@link CNGX_MAT_STEP_HANDLE_FACTORY} resolves to a function with
192
- * this exact shape — overrides match it identically.
203
+ * this exact shape - overrides match it identically.
204
+ *
205
+ * @category ui/mat-stepper
193
206
  */
194
207
  type CngxMatStepHandleFactory = typeof createMatStepHandle;
195
208
  /**
@@ -199,12 +212,12 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
199
212
  *
200
213
  * Symmetric with the tabs sibling
201
214
  * `CNGX_MAT_TAB_HANDLE_FACTORY` and with `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`
202
- * — every Material-bridge logic block ships the same swap surface so
215
+ * - every Material-bridge logic block ships the same swap surface so
203
216
  * consumers can layer telemetry, alternate id strategies, or
204
217
  * test-environment id keying via `providers` / `viewProviders`
205
218
  * without forking the directive.
206
219
  *
207
- * Override capability — the swap surface separates **handle shape**
220
+ * Override capability - the swap surface separates **handle shape**
208
221
  * (factory body) from **id keying** (the supplied `idSeed` closure).
209
222
  * The directive constructs `idSeed` as `() => nextUid('cngx-mat-step-')`
210
223
  * and hands it to the factory as a default suggestion; an override is
@@ -212,9 +225,6 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
212
225
  * deterministic-test / consumer-domain id strategy. Both axes are
213
226
  * independently swappable from one DI seam.
214
227
  *
215
- * Tracked-debt: ships under family-uniformity staging (single
216
- * in-package consumer today). See `stepper-accepted-debt §7`.
217
- *
218
228
  * ```ts
219
229
  * providers: [
220
230
  * {
@@ -227,6 +237,11 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
227
237
  * },
228
238
  * ]
229
239
  * ```
240
+ *
241
+ * @category ui/mat-stepper
242
+ * @wcag AA
243
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/material-bridge/handle.ts
244
+ * @since 0.1.0
230
245
  */
231
246
  declare const CNGX_MAT_STEP_HANDLE_FACTORY: InjectionToken<typeof createMatStepHandle>;
232
247