@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,233 +1,359 @@
1
- /*
2
- * @cngx/ui/mat-tabs — Material-themed sticky-error skin.
1
+ /**
2
+ * @overview
3
+ * Material-themed sticky-error skin for `[cngxMatTabs]`. The
4
+ * directive applies modifier classes onto Material's
5
+ * `<button>.mat-mdc-tab` elements and the trailing-edge molecule
6
+ * wrapper; this stylesheet paints them. Tokens stay under the
7
+ * Material-bridge namespace (`--cngx-mat-tab-*` / `--cngx-mat-tabs-
8
+ * more-*`) - no `--cngx-color-*` fallbacks because the Material
9
+ * design system owns the canonical theme. Shipped as a standalone
10
+ * stylesheet asset (consumer imports once in their global
11
+ * stylesheet) because Angular only allows `styleUrl` on
12
+ * `@Component`, not on `@Directive`.
3
13
  *
4
- * Applied imperatively by `[cngxMatTabs]` (via Renderer2) onto the
5
- * `<button>.mat-mdc-tab` element whose index matches
6
- * `presenter.lastFailedIndex()`. The class persists until the user
7
- * successfully re-picks the failed target OR programmatically
8
- * dismisses via `clearLastFailed()`.
14
+ * **State modifiers**
9
15
  *
10
- * Themed via `--mat-sys-error` by default with `--cngx-mat-tab-error-*`
11
- * consumer overrides. Three-tier fallback: consumer override →
12
- * Material design token → hard-coded `#c62828`.
16
+ * - `.cngx-mat-tab--error` - rejected commit; tinted color, outline
17
+ * ring, font-weight bump. Specificity bump `.mat-mdc-tab.cngx-
18
+ * mat-tab--error` is load-bearing - Material 21's `.mdc-tab` sets
19
+ * `outline: none` at (0,1,0)
20
+ * - `.cngx-mat-tab--error` + `.mat-mdc-tab-disabled` - fades the
21
+ * rejection signal so it does not pass for a healthy disabled tab
22
+ * - `.cngx-mat-tab--has-errors` - form-validation errors present;
23
+ * renders a `::before` red disc with an `!` glyph at the trailing
24
+ * corner. Distinct semantic from `--error` and the two coexist
25
+ * - `.cngx-mat-tab--error.cngx-mat-tab--has-errors` - co-occurrence;
26
+ * shifts the has-errors glyph inward via
27
+ * `--cngx-mat-tab-has-errors-glyph-offset-stacked` so the two
28
+ * signals do not merge
13
29
  *
14
- * No animation: `tabs-accepted-debt §3` covers the cngx-native pulse
15
- * keyframe limitation; the Material variant ships no pulse for the
16
- * same architectural reason (avoids competing with Material's
17
- * existing ink-bar transition + ripple). Re-evaluate when ≥1 consumer
18
- * issue requests a pulse OR a sibling cngx feature adopts a shared
19
- * `createPulseOnEdge` factory the Material variant can compose
20
- * against.
30
+ * **Trailing-edge overflow**
21
31
  *
22
- * Shipped as a standalone stylesheet asset (NOT folded into JS via
23
- * `styleUrls` — Angular only honours `styleUrls` on `@Component`,
24
- * not on `@Directive`). Consumer imports once in their global
25
- * stylesheet — Material-ecosystem prebuilt-themes pattern.
32
+ * `.cngx-mat-tabs-more` wraps the dynamically-mounted
33
+ * `<cngx-tab-overflow>` molecule that `[cngxMatTabs]` appends into
34
+ * `.mat-mdc-tab-header`. The wrapper:
35
+ *
36
+ * - drives the molecule's component-API cascade vars
37
+ * (`--cngx-tab-overflow-bg`, `--cngx-tab-overflow-button-bg`) so
38
+ * the trigger fades into the page surface
39
+ * - collapses to zero layout space when the inner trigger button is
40
+ * hidden (= no clipped tabs) via `:has()`
41
+ *
42
+ * **Inheritance**
43
+ *
44
+ * - `--cngx-mat-tab-error-color` -> `--mat-sys-error`
45
+ * - `--cngx-mat-tab-has-errors-color` -> `--mat-sys-error`
46
+ * - `--cngx-mat-tab-has-errors-glyph-color` -> `--mat-sys-on-error`
47
+ * - `--cngx-mat-tabs-more-bg` -> `--mat-app-background-color`
48
+ *
49
+ * **Dark mode**
50
+ *
51
+ * Three hooks deepen the trailing-edge wrapper background and its
52
+ * gradient-fade shadow so the molecule blends into a dark page
53
+ * surface rather than into a white-on-dark seam:
54
+ *
55
+ * - `prefers-color-scheme: dark`
56
+ * - `[data-color-scheme="dark"]`
57
+ * - `.dark` class
26
58
  */
27
59
 
28
- /*
29
- * Specificity bump to `.mat-mdc-tab.cngx-mat-tab--error` (0,2,0) is
30
- * load-bearing — Material 21's `.mdc-tab` rule (0,1,0) sets
31
- * `outline: none` to suppress the browser's default focus outline,
32
- * and ships those styles inline via the component decorator. Since
33
- * the component-scoped CSS is injected into `<head>` AFTER the
34
- * `angular.json` global styles when the component first renders,
35
- * a same-specificity rule loses the cascade — `outline` would be
36
- * stripped and only `color` / `font-weight` would land. Mirrors
37
- * the same bump on `.mat-mdc-tab.cngx-mat-tab--has-errors::before`
38
- * below.
39
- */
40
- .mat-mdc-tab.cngx-mat-tab--error {
41
- color: var(--cngx-mat-tab-error-color, var(--mat-sys-error, #c62828));
42
- outline: var(--cngx-mat-tab-error-outline, 2px solid currentColor);
43
- outline-offset: var(--cngx-mat-tab-error-outline-offset, 1px);
44
- font-weight: var(--cngx-mat-tab-error-font-weight, 600);
45
- }
60
+ @layer cngx.tokens {
61
+ /**
62
+ * Text + outline color of a rejected tab. Falls back to
63
+ * `--mat-sys-error`.
64
+ * @group State / Error
65
+ */
66
+ @property --cngx-mat-tab-error-color {
67
+ syntax: '<color>';
68
+ inherits: true;
69
+ initial-value: oklch(0.45 0.15 25);
70
+ }
71
+
72
+ /**
73
+ * Outline shorthand of a rejected tab.
74
+ * @group State / Error
75
+ */
76
+ @property --cngx-mat-tab-error-outline {
77
+ syntax: '*';
78
+ inherits: false;
79
+ initial-value: 2px solid currentColor;
80
+ }
81
+
82
+ /**
83
+ * Outline offset of the rejected-tab outline.
84
+ * @group State / Error
85
+ */
86
+ @property --cngx-mat-tab-error-outline-offset {
87
+ syntax: '<length>';
88
+ inherits: false;
89
+ initial-value: 1px;
90
+ }
91
+
92
+ /**
93
+ * Font-weight bump of a rejected tab.
94
+ * @group State / Error
95
+ */
96
+ @property --cngx-mat-tab-error-font-weight {
97
+ syntax: '<number>';
98
+ inherits: false;
99
+ initial-value: 600;
100
+ }
101
+
102
+ /**
103
+ * Inset of the `has-errors` glyph from the tab edges.
104
+ * @group State / HasErrors
105
+ */
106
+ @property --cngx-mat-tab-has-errors-glyph-offset {
107
+ syntax: '<length>';
108
+ inherits: false;
109
+ initial-value: 4px;
110
+ }
111
+
112
+ /**
113
+ * Larger inset when the tab is BOTH rejected and carries form
114
+ * errors - keeps the two signals visually distinct.
115
+ * @group State / HasErrors
116
+ */
117
+ @property --cngx-mat-tab-has-errors-glyph-offset-stacked {
118
+ syntax: '<length>';
119
+ inherits: false;
120
+ initial-value: 6px;
121
+ }
122
+
123
+ /**
124
+ * Diameter of the `has-errors` glyph disc.
125
+ * @group State / HasErrors
126
+ */
127
+ @property --cngx-mat-tab-has-errors-glyph-size {
128
+ syntax: '<length>';
129
+ inherits: false;
130
+ initial-value: 16px;
131
+ }
132
+
133
+ /**
134
+ * Background of the `has-errors` glyph disc. Falls back to
135
+ * `--mat-sys-error`.
136
+ * @group State / HasErrors
137
+ */
138
+ @property --cngx-mat-tab-has-errors-color {
139
+ syntax: '<color>';
140
+ inherits: false;
141
+ initial-value: oklch(0.45 0.15 25);
142
+ }
143
+
144
+ /**
145
+ * Glyph color inside the `has-errors` disc. Falls back to
146
+ * `--mat-sys-on-error`.
147
+ * @group State / HasErrors
148
+ */
149
+ @property --cngx-mat-tab-has-errors-glyph-color {
150
+ syntax: '<color>';
151
+ inherits: true;
152
+ initial-value: oklch(1 0 0);
153
+ }
154
+
155
+ /**
156
+ * Font-weight of the `has-errors` glyph (`!`).
157
+ * @group State / HasErrors
158
+ */
159
+ @property --cngx-mat-tab-has-errors-font-weight {
160
+ syntax: '<number>';
161
+ inherits: false;
162
+ initial-value: 700;
163
+ }
164
+
165
+ /**
166
+ * Stacking-context order of the trailing-edge overflow wrapper.
167
+ * @group Layout
168
+ */
169
+ @property --cngx-mat-tabs-more-z {
170
+ syntax: '<number>';
171
+ inherits: false;
172
+ initial-value: 2;
173
+ }
174
+
175
+ /**
176
+ * Background of the trailing-edge overflow wrapper. Falls back to
177
+ * `--mat-app-background-color`.
178
+ * @group Surface
179
+ */
180
+ @property --cngx-mat-tabs-more-bg {
181
+ syntax: '<color>';
182
+ inherits: true;
183
+ initial-value: oklch(1 0 0);
184
+ }
185
+
186
+ /**
187
+ * Drop-shadow of the trailing-edge overflow wrapper.
188
+ * @group Surface
189
+ */
190
+ @property --cngx-mat-tabs-more-shadow {
191
+ syntax: '*';
192
+ inherits: true;
193
+ initial-value: -8px 0 8px -4px oklch(0 0 0 / 0.1);
194
+ }
46
195
 
47
- .mat-mdc-tab-disabled.cngx-mat-tab--error {
48
196
  /*
49
- * A disabled-and-rejected tab keeps the rejection signal but
50
- * fades to disambiguate it from a healthy disabled tab. Material
51
- * itself dims disabled tabs via the `--mat-tab-header-disabled-*`
52
- * tokens; this overlay multiplies the dimming.
197
+ * Default-theme palette pass. The `cngx-mat-tabs-more` molecule
198
+ * sits over the Material tab header - its background needs to
199
+ * match the page surface so the gradient fades into "nothing"
200
+ * rather than into white-on-dark. Stays under the Material-bridge
201
+ * namespace (no `--cngx-color-*` delegation) per the file-header
202
+ * contract; consumers can still override `--cngx-mat-tabs-more-bg`
203
+ * to point at `--mat-app-background-color` once Material's M3
204
+ * tokens are wired.
53
205
  */
54
- opacity: 0.7;
55
- }
206
+ :root {
207
+ --cngx-mat-tabs-more-bg: oklch(1 0 0);
208
+ --cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.1);
209
+ }
56
210
 
57
- /*
58
- * Per-tab form-error aggregation badge. Distinct semantic from
59
- * `--error` — `--error` means "your last commit was refused";
60
- * `--has-errors` means "this tab contains form-validation errors
61
- * right now". The two coexist (different sources, different
62
- * lifecycles, different remediation paths) and a tab can carry both
63
- * simultaneously.
64
- *
65
- * Three-tier fallback per CSS var: consumer override → Material
66
- * design token → hard-coded value. The badge glyph is a `::before`
67
- * pseudo-element so it stacks cleanly with Material's own focus
68
- * ring and ripple — Material's button uses neither `::before` nor
69
- * `::after` for its core visuals.
70
- *
71
- * No animation: same `tabs-accepted-debt §3` rationale as
72
- * `--error` — pulse-on-edge is deferred to a future shared
73
- * `createPulseOnEdge` factory.
74
- */
75
- .cngx-mat-tab--has-errors {
76
- position: relative;
77
- }
211
+ @media (prefers-color-scheme: dark) {
212
+ :root:not([data-color-scheme='light']):not(.light) {
213
+ --cngx-mat-tabs-more-bg: oklch(0.2 0.01 250);
214
+ --cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.45);
215
+ }
216
+ }
78
217
 
79
- /*
80
- * Specificity is `.mat-mdc-tab.cngx-mat-tab--has-errors` (0,2,1)
81
- * to beat Material's own `.mat-focus-indicator::before` (0,1,1)
82
- * which sets `inset: 0` on the same pseudo-element. Without the
83
- * boost, the `top` / `inset-inline-end` declarations get collapsed
84
- * to 0 by Material's later-cascade rule and the badge sits dead-
85
- * centred under the focus ring instead of at the trailing-top
86
- * corner. Right + transform fall back for older inset-inline-end
87
- * support.
88
- */
89
- .mat-mdc-tab.cngx-mat-tab--has-errors::before {
90
- content: '!';
91
- position: absolute;
92
- top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
93
- right: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
94
- inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
95
- inset-inline-start: auto;
96
- bottom: auto;
97
- display: inline-flex;
98
- align-items: center;
99
- justify-content: center;
100
- width: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
101
- height: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
102
- margin: 0;
103
- border: 0;
104
- border-radius: 50%;
105
- background: var(
106
- --cngx-mat-tab-has-errors-color,
107
- var(--mat-sys-error, #c62828)
108
- );
109
- color: var(
110
- --cngx-mat-tab-has-errors-glyph-color,
111
- var(--mat-sys-on-error, #ffffff)
112
- );
113
- font-size: calc(var(--cngx-mat-tab-has-errors-glyph-size, 16px) * 0.75);
114
- font-weight: var(--cngx-mat-tab-has-errors-font-weight, 700);
115
- line-height: 1;
116
- pointer-events: none;
117
- z-index: 1;
118
- }
218
+ :root[data-color-scheme='dark'],
219
+ :root.dark {
220
+ --cngx-mat-tabs-more-bg: oklch(0.2 0.01 250);
221
+ --cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.45);
222
+ }
119
223
 
120
- /*
121
- * Co-occurrence: when a tab is BOTH rejected and carries form
122
- * errors, the rejection outline already draws focus to the edges;
123
- * shift the has-errors badge slightly inward so the two signals
124
- * read as distinct rather than visually merging.
125
- */
126
- .mat-mdc-tab.cngx-mat-tab--error.cngx-mat-tab--has-errors::before {
127
- top: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
128
- right: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
129
- inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
224
+ :root[data-color-scheme='light'],
225
+ :root.light {
226
+ --cngx-mat-tabs-more-bg: oklch(1 0 0);
227
+ --cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.1);
228
+ }
130
229
  }
131
230
 
132
- /*
133
- * Trailing-edge skin for the dynamically-mounted `<cngx-tab-overflow>`
134
- * molecule. `[cngxMatTabs]` programmatically appends the molecule
135
- * into `.mat-mdc-tab-header` and adds the `cngx-mat-tabs-more` class
136
- * via `Renderer2` (`mat-tabs.directive.ts`'s afterNextRender block).
137
- *
138
- * Layout: flex item alongside `.mat-mdc-tab-label-container`. Material's
139
- * `.mat-mdc-tab-header` is itself a flex container, so the More
140
- * affordance flows naturally as a sibling of the label-container —
141
- * the label-container shrinks to fit, the More button takes its
142
- * natural width, and the trailing tab is no longer occluded by an
143
- * absolutely-positioned overlay. If consumers opt back into
144
- * Material's pagination (see the auto-hide rule below), the
145
- * pagination-after arrow becomes a third flex sibling and the
146
- * available width is split across all three; the IntersectionObserver
147
- * picks up the new layout automatically.
148
- *
149
- * Three-tier fallback per CSS var: consumer override → Material
150
- * design token → hard-coded value.
151
- */
152
- .cngx-mat-tabs-more {
153
- flex: 0 0 auto;
154
- align-self: stretch;
155
- display: flex;
156
- align-items: center;
157
- z-index: var(--cngx-mat-tabs-more-z, 2);
231
+ @layer cngx.components {
232
+ /*
233
+ * Specificity bump to `.mat-mdc-tab.cngx-mat-tab--error` (0,2,0) is
234
+ * load-bearing - Material 21's `.mdc-tab` rule (0,1,0) sets
235
+ * `outline: none` to suppress the browser's default focus outline,
236
+ * and ships those styles inline via the component decorator. Since
237
+ * the component-scoped CSS is injected into `<head>` AFTER the
238
+ * `angular.json` global styles when the component first renders,
239
+ * a same-specificity rule loses the cascade.
240
+ */
241
+ .mat-mdc-tab.cngx-mat-tab--error {
242
+ color: var(--cngx-mat-tab-error-color, var(--mat-sys-error, oklch(0.45 0.15 25)));
243
+ outline: var(--cngx-mat-tab-error-outline, 2px solid currentColor);
244
+ outline-offset: var(--cngx-mat-tab-error-outline-offset, 1px);
245
+ font-weight: var(--cngx-mat-tab-error-font-weight, 600);
246
+ }
247
+
248
+ .mat-mdc-tab-disabled.cngx-mat-tab--error {
249
+ /*
250
+ * A disabled-and-rejected tab keeps the rejection signal but
251
+ * fades to disambiguate it from a healthy disabled tab.
252
+ */
253
+ opacity: 0.7;
254
+ }
158
255
 
159
256
  /*
160
- * Drive the molecule's own component-API cascade variables. The
161
- * `<cngx-tab-overflow>` :host CSS defaults `--cngx-tab-overflow-bg`
162
- * to `transparent` (sensible for the cngx-native variant that sits
163
- * in a flow-positioned strip wrapper); the Material variant gives
164
- * the More button an opaque surface so it reads as a distinct
165
- * affordance against Material's strip background even when the
166
- * popover panel is closed. The component's :host rule reads these
167
- * variables, so resolution happens at the right specificity tier
168
- * without us shouting through a higher-specificity selector.
169
- */
170
- --cngx-tab-overflow-bg: var(
171
- --cngx-mat-tabs-more-bg,
172
- var(--mat-app-background-color, #ffffff)
173
- );
174
- --cngx-tab-overflow-button-bg: var(
175
- --cngx-mat-tabs-more-bg,
176
- var(--mat-app-background-color, #ffffff)
177
- );
178
-
179
- box-shadow: var(
180
- --cngx-mat-tabs-more-shadow,
181
- -8px 0 8px -4px rgba(0, 0, 0, 0.1)
182
- );
183
- }
257
+ * Per-tab form-error aggregation badge. Distinct semantic from
258
+ * `--error` - `--error` means "your last commit was refused";
259
+ * `--has-errors` means "this tab contains form-validation errors
260
+ * right now". The two coexist and a tab can carry both
261
+ * simultaneously.
262
+ */
263
+ .cngx-mat-tab--has-errors {
264
+ position: relative;
265
+ }
184
266
 
185
- /*
186
- * Collapse the wrapper to zero layout space when the inner trigger
187
- * button is hidden (= no clipped tabs). Without this, the molecule's
188
- * `display: inline-flex` :host rule keeps reserving width for an
189
- * empty wrapper — the label-container would shrink even when no
190
- * overflow exists.
191
- */
192
- .cngx-mat-tabs-more:has(.cngx-tab-overflow__trigger[hidden]) {
193
- display: none;
194
- }
267
+ /*
268
+ * Specificity is `.mat-mdc-tab.cngx-mat-tab--has-errors` (0,2,1)
269
+ * to beat Material's own `.mat-focus-indicator::before` (0,1,1)
270
+ * which sets `inset: 0` on the same pseudo-element.
271
+ */
272
+ .mat-mdc-tab.cngx-mat-tab--has-errors::before {
273
+ content: '!';
274
+ position: absolute;
275
+ top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
276
+ right: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
277
+ inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
278
+ inset-inline-start: auto;
279
+ bottom: auto;
280
+ display: inline-flex;
281
+ align-items: center;
282
+ justify-content: center;
283
+ width: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
284
+ height: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
285
+ margin: 0;
286
+ border: 0;
287
+ border-radius: 50%;
288
+ background: var(--cngx-mat-tab-has-errors-color, var(--mat-sys-error, oklch(0.45 0.15 25)));
289
+ color: var(--cngx-mat-tab-has-errors-glyph-color, var(--mat-sys-on-error, oklch(1 0 0)));
290
+ font-size: calc(var(--cngx-mat-tab-has-errors-glyph-size, 16px) * 0.75);
291
+ font-weight: var(--cngx-mat-tab-has-errors-font-weight, 700);
292
+ line-height: 1;
293
+ pointer-events: none;
294
+ z-index: 1;
295
+ }
195
296
 
196
- /*
197
- * Material's pagination arrows (`<` / `>`) remain visible alongside
198
- * the More button: both are flex siblings of `.mat-mdc-tab-label-container`
199
- * inside `.mat-mdc-tab-header`, so the available width is split across
200
- * all of them and the IntersectionObserver picks up the new container
201
- * width automatically. Consumers who want to hide Material's
202
- * pagination (More button as the only overflow affordance) can do so
203
- * with a one-line theme-level override:
204
- *
205
- * .mat-mdc-tab-header:has(cngx-tab-overflow)
206
- * .mat-mdc-tab-header-pagination {
207
- * display: none;
208
- * }
209
- */
297
+ /*
298
+ * Co-occurrence: when a tab is BOTH rejected and carries form
299
+ * errors, the rejection outline already draws focus to the edges;
300
+ * shift the has-errors badge slightly inward so the two signals
301
+ * read as distinct rather than visually merging.
302
+ */
303
+ .mat-mdc-tab.cngx-mat-tab--error.cngx-mat-tab--has-errors::before {
304
+ top: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
305
+ right: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
306
+ inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
307
+ }
210
308
 
211
- /*
212
- * SR-only utility for the per-tab error descriptor span
213
- * (`<span class="cngx-sr-only" id="${handle.id}-errors">` mounted by
214
- * the aggregator-decoration effect). The span carries the consumer-
215
- * supplied `aggregator.announcement()` phrase; AT reads it through
216
- * the patched `aria-describedby`, sighted users see only the badge
217
- * glyph. `@cngx/ui/mat-tabs` ships this utility inside its own
218
- * stylesheet so consumers importing only `mat-tabs.css` (per the
219
- * README) do not paint the announcement inline next to the tab
220
- * label. Mirrors the rule in `@cngx/common/tabs/styles/tabs-base.css`
221
- * for the cngx-native variant.
222
- */
223
- .cngx-sr-only {
224
- position: absolute;
225
- width: 1px;
226
- height: 1px;
227
- margin: -1px;
228
- padding: 0;
229
- overflow: hidden;
230
- clip: rect(0, 0, 0, 0);
231
- white-space: nowrap;
232
- border: 0;
309
+ /*
310
+ * Trailing-edge skin for the dynamically-mounted `<cngx-tab-overflow>`
311
+ * molecule. `[cngxMatTabs]` programmatically appends the molecule
312
+ * into `.mat-mdc-tab-header` and adds the `cngx-mat-tabs-more` class.
313
+ */
314
+ .cngx-mat-tabs-more {
315
+ flex: 0 0 auto;
316
+ align-self: stretch;
317
+ display: flex;
318
+ align-items: center;
319
+ z-index: var(--cngx-mat-tabs-more-z, 2);
320
+
321
+ /*
322
+ * Drive the molecule's own component-API cascade variables.
323
+ */
324
+ --cngx-tab-overflow-bg: var(
325
+ --cngx-mat-tabs-more-bg,
326
+ var(--mat-app-background-color, oklch(1 0 0))
327
+ );
328
+ --cngx-tab-overflow-button-bg: var(
329
+ --cngx-mat-tabs-more-bg,
330
+ var(--mat-app-background-color, oklch(1 0 0))
331
+ );
332
+
333
+ box-shadow: var(--cngx-mat-tabs-more-shadow, -8px 0 8px -4px oklch(0 0 0 / 0.1));
334
+ }
335
+
336
+ /*
337
+ * Collapse the wrapper to zero layout space when the inner trigger
338
+ * button is hidden (= no clipped tabs).
339
+ */
340
+ .cngx-mat-tabs-more:has(.cngx-tab-overflow__trigger[hidden]) {
341
+ display: none;
342
+ }
343
+
344
+ /*
345
+ * SR-only utility for the per-tab error descriptor span mounted by
346
+ * the aggregator-decoration effect.
347
+ */
348
+ .cngx-sr-only {
349
+ position: absolute;
350
+ width: 1px;
351
+ height: 1px;
352
+ margin: -1px;
353
+ padding: 0;
354
+ overflow: hidden;
355
+ clip: rect(0, 0, 0, 0);
356
+ white-space: nowrap;
357
+ border: 0;
358
+ }
233
359
  }
@@ -42,42 +42,42 @@ export class ExampleComponent {
42
42
 
43
43
  `CngxMatPaginator` is a Material Design paginator component that wraps the Material `mat-paginator` element and wires it to a `CngxPaginate` directive. It provides:
44
44
 
45
- - **Type-safe integration** — Explicit `[cngxPaginateRef]` input (no ancestor injection)
46
- - **Automatic state sync** — Page index, page size, and total count are automatically synchronized
47
- - **Page size selector** — Customizable page size options via `[pageSizeOptions]`
48
- - **Disabled state** — Paginator disables when `CngxPaginate.isBusy()` is true
45
+ - **Type-safe integration** - Explicit `[cngxPaginateRef]` input (no ancestor injection)
46
+ - **Automatic state sync** - Page index, page size, and total count are automatically synchronized
47
+ - **Page size selector** - Customizable page size options via `[pageSizeOptions]`
48
+ - **Disabled state** - Paginator disables when `CngxPaginate.isBusy()` is true
49
49
 
50
- The component requires an explicit reference to the `CngxPaginate` directive instance — no hidden ancestor injection, no implicit wiring.
50
+ The component requires an explicit reference to the `CngxPaginate` directive instance - no hidden ancestor injection, no implicit wiring.
51
51
 
52
52
  ## Accessibility
53
53
 
54
54
  `CngxMatPaginator` delegates accessibility to Material's `mat-paginator` component. The Material paginator is fully accessible with:
55
55
 
56
- - **ARIA labels** — Paginator navigation and page size controls are properly labeled
57
- - **Keyboard navigation** — Tab order and keyboard shortcuts for page navigation
58
- - **Disabled state** — When `isBusy()` is true, controls are disabled and announced to screen readers
56
+ - **ARIA labels** - Paginator navigation and page size controls are properly labeled
57
+ - **Keyboard navigation** - Tab order and keyboard shortcuts for page navigation
58
+ - **Disabled state** - When `isBusy()` is true, controls are disabled and announced to screen readers
59
59
 
60
60
  ## Composition
61
61
 
62
62
  `CngxMatPaginator` composes:
63
63
 
64
- - **Material paginator** — `mat-paginator` component from `@angular/material/paginator`
65
- - **CngxPaginate directive** — Manages pagination state (page index, page size, total)
66
- - **Event handling** — Subscribes to Material paginator's `page` event and updates directive state
64
+ - **Material paginator** - `mat-paginator` component from `@angular/material/paginator`
65
+ - **CngxPaginate directive** - Manages pagination state (page index, page size, total)
66
+ - **Event handling** - Subscribes to Material paginator's `page` event and updates directive state
67
67
 
68
68
  ## How It Works
69
69
 
70
- 1. **Setup** — Consumer applies `cngxPaginate` on a container element and assigns a template reference
71
- 2. **Data binding** — Consumer passes `[total]="items.length"` to the directive
72
- 3. **Component wire-up** — `CngxMatPaginator` binds to the directive via `[cngxPaginateRef]`
73
- 4. **State sync** — Component reads `ref.pageIndex()`, `ref.pageSize()`, `ref.total()` and binds to Material's `mat-paginator`
74
- 5. **User interaction** — When user changes page or page size, Material's `page` event fires
75
- 6. **State update** — `CngxMatPaginator.handlePage()` calls `ref.setPageSize()` and `ref.setPage()` to update directive state
76
- 7. **Data refresh** — Consumer reactively filters/slices data based on directive signals
70
+ 1. **Setup** - Consumer applies `cngxPaginate` on a container element and assigns a template reference
71
+ 2. **Data binding** - Consumer passes `[total]="items.length"` to the directive
72
+ 3. **Component wire-up** - `CngxMatPaginator` binds to the directive via `[cngxPaginateRef]`
73
+ 4. **State sync** - Component reads `ref.pageIndex()`, `ref.pageSize()`, `ref.total()` and binds to Material's `mat-paginator`
74
+ 5. **User interaction** - When user changes page or page size, Material's `page` event fires
75
+ 6. **State update** - `CngxMatPaginator.handlePage()` calls `ref.setPageSize()` and `ref.setPage()` to update directive state
76
+ 7. **Data refresh** - Consumer reactively filters/slices data based on directive signals
77
77
 
78
78
  ## Material Theming
79
79
 
80
- `CngxMatPaginator` uses the standard Material `mat-paginator` component, which inherits theming from your Material theme automatically. No additional theme configuration needed — include the Material theme in your global stylesheet.
80
+ `CngxMatPaginator` uses the standard Material `mat-paginator` component, which inherits theming from your Material theme automatically. No additional theme configuration needed - include the Material theme in your global stylesheet.
81
81
 
82
82
  ```scss
83
83
  @use '@angular/material' as mat;