@cngx/ui 0.0.1-rc.0 → 0.1.0-rc.1
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.
- package/README.md +22 -48
- package/action-button/README.md +9 -11
- package/empty-state/README.md +11 -26
- package/feedback/README.md +3 -3
- package/fesm2022/cngx-ui-action-button.mjs +30 -26
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +26 -21
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +498 -261
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +32 -5
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +119 -297
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +455 -120
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-material.mjs +14 -3
- package/fesm2022/cngx-ui-material.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +22 -3
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +107 -28
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +61 -20
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +14 -5
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +659 -163
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +306 -55
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +2 -1
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/layout/README.md +9 -44
- package/mat-stepper/README.md +37 -17
- package/mat-tabs/README.md +13 -13
- package/mat-tabs/styles/mat-tabs.css +357 -213
- package/material/README.md +19 -19
- package/overlay/README.md +11 -11
- package/package.json +7 -6
- package/sidenav/README.md +4 -19
- package/skeleton/README.md +3 -17
- package/speak/README.md +15 -15
- package/stepper/README.md +213 -5
- package/tabs/README.md +22 -4
- package/theming/system-tokens.css +29 -0
- package/types/cngx-ui-action-button.d.ts +28 -13
- package/types/cngx-ui-empty-state.d.ts +21 -9
- package/types/cngx-ui-feedback.d.ts +437 -121
- package/types/cngx-ui-layout.d.ts +38 -8
- package/types/cngx-ui-mat-stepper.d.ts +100 -134
- package/types/cngx-ui-mat-tabs.d.ts +291 -84
- package/types/cngx-ui-material.d.ts +12 -1
- package/types/cngx-ui-overlay.d.ts +25 -4
- package/types/cngx-ui-sidenav.d.ts +106 -12
- package/types/cngx-ui-skeleton.d.ts +62 -8
- package/types/cngx-ui-speak.d.ts +10 -2
- package/types/cngx-ui-stepper.d.ts +390 -57
- package/types/cngx-ui-tabs.d.ts +182 -18
- package/types/cngx-ui.d.ts +1 -0
- package/speak/speak-button-theme.scss +0 -78
|
@@ -1,233 +1,377 @@
|
|
|
1
|
-
|
|
2
|
-
* @
|
|
1
|
+
/**
|
|
2
|
+
* @overview
|
|
3
|
+
* Material-themed sticky-error skin for `[cngxMatTabs]` and the native
|
|
4
|
+
* `[cngxMatTabNav]` bridge. The directives apply modifier classes onto
|
|
5
|
+
* Material's `<button>.mat-mdc-tab` elements (tab group) or
|
|
6
|
+
* `<a>.mat-mdc-tab-link` elements (nav bar) and the trailing-edge
|
|
7
|
+
* molecule wrapper; this stylesheet paints them. Tokens stay under the
|
|
8
|
+
* Material-bridge namespace (`--cngx-mat-tab-*` / `--cngx-mat-tabs-
|
|
9
|
+
* more-*`) - no `--cngx-color-*` fallbacks because the Material
|
|
10
|
+
* design system owns the canonical theme. Shipped as a standalone
|
|
11
|
+
* stylesheet asset (consumer imports once in their global
|
|
12
|
+
* stylesheet) because Angular only allows `styleUrl` on
|
|
13
|
+
* `@Component`, not on `@Directive`.
|
|
3
14
|
*
|
|
4
|
-
*
|
|
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()`.
|
|
15
|
+
* **State modifiers**
|
|
9
16
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
17
|
+
* - `.cngx-mat-tab--error` - rejected commit; tinted color, outline
|
|
18
|
+
* ring, font-weight bump. Specificity bump `.mat-mdc-tab.cngx-
|
|
19
|
+
* mat-tab--error` is load-bearing - Material 21's `.mdc-tab` sets
|
|
20
|
+
* `outline: none` at (0,1,0)
|
|
21
|
+
* - `.cngx-mat-tab--error` + `.mat-mdc-tab-disabled` - fades the
|
|
22
|
+
* rejection signal so it does not pass for a healthy disabled tab
|
|
23
|
+
* - `.cngx-mat-tab--has-errors` - form-validation errors present;
|
|
24
|
+
* renders a `::before` red disc with an `!` glyph at the trailing
|
|
25
|
+
* corner. Distinct semantic from `--error` and the two coexist
|
|
26
|
+
* - `.cngx-mat-tab--error.cngx-mat-tab--has-errors` - co-occurrence;
|
|
27
|
+
* shifts the has-errors glyph inward via
|
|
28
|
+
* `--cngx-mat-tab-has-errors-glyph-offset-stacked` so the two
|
|
29
|
+
* signals do not merge
|
|
13
30
|
*
|
|
14
|
-
*
|
|
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.
|
|
31
|
+
* **Trailing-edge overflow**
|
|
21
32
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
33
|
+
* `.cngx-mat-tabs-more` wraps the dynamically-mounted
|
|
34
|
+
* `<cngx-tab-overflow>` molecule that `[cngxMatTabs]` appends into
|
|
35
|
+
* `.mat-mdc-tab-header`. The wrapper:
|
|
36
|
+
*
|
|
37
|
+
* - drives the molecule's component-API cascade vars
|
|
38
|
+
* (`--cngx-tab-overflow-bg`, `--cngx-tab-overflow-button-bg`) so
|
|
39
|
+
* the trigger fades into the page surface
|
|
40
|
+
* - collapses to zero layout space when the inner trigger button is
|
|
41
|
+
* hidden (= no clipped tabs) via `:has()`
|
|
42
|
+
*
|
|
43
|
+
* **Material wiring**
|
|
44
|
+
*
|
|
45
|
+
* Every `--cngx-mat-tab-*` token is `@property`-registered with a literal
|
|
46
|
+
* oklch initial value, so a registered value always wins over an inline
|
|
47
|
+
* `var()` fallback - this stylesheet therefore carries no `--mat-sys-*`
|
|
48
|
+
* fallbacks of its own. The Material alignment is delivered by the
|
|
49
|
+
* `@cngx/themes/material/tabs-theme` bridge (`@include tabs.theme($theme)`),
|
|
50
|
+
* which sets the colour tokens on `.mat-mdc-tab-group`:
|
|
51
|
+
*
|
|
52
|
+
* - `--cngx-mat-tab-error-color` <- `--mat-sys-error`
|
|
53
|
+
* - `--cngx-mat-tab-has-errors-color` <- `--mat-sys-error`
|
|
54
|
+
* - `--cngx-mat-tab-has-errors-glyph-color` <- `--mat-sys-on-error`
|
|
55
|
+
* - `--cngx-mat-tabs-more-bg` <- `--mat-sys-surface`
|
|
56
|
+
*
|
|
57
|
+
* Imported standalone (no bridge), the tokens keep the literal defaults
|
|
58
|
+
* declared below.
|
|
59
|
+
*
|
|
60
|
+
* **Dark mode**
|
|
61
|
+
*
|
|
62
|
+
* Three hooks deepen the trailing-edge wrapper background and its
|
|
63
|
+
* gradient-fade shadow so the molecule blends into a dark page
|
|
64
|
+
* surface rather than into a white-on-dark seam:
|
|
65
|
+
*
|
|
66
|
+
* - `prefers-color-scheme: dark`
|
|
67
|
+
* - `[data-color-scheme="dark"]`
|
|
68
|
+
* - `.dark` class
|
|
26
69
|
*/
|
|
27
70
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
@layer cngx.tokens {
|
|
72
|
+
/**
|
|
73
|
+
* Text + outline color of a rejected tab. Wired to `--mat-sys-error`
|
|
74
|
+
* by the `@cngx/themes/material/tabs-theme` bridge; standalone it keeps
|
|
75
|
+
* the literal default below.
|
|
76
|
+
* @group State / Error
|
|
77
|
+
*/
|
|
78
|
+
@property --cngx-mat-tab-error-color {
|
|
79
|
+
syntax: '<color>';
|
|
80
|
+
inherits: true;
|
|
81
|
+
initial-value: oklch(0.45 0.15 25);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Outline shorthand of a rejected tab.
|
|
86
|
+
* @group State / Error
|
|
87
|
+
*/
|
|
88
|
+
@property --cngx-mat-tab-error-outline {
|
|
89
|
+
syntax: '*';
|
|
90
|
+
inherits: false;
|
|
91
|
+
initial-value: 2px solid currentColor;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Outline offset of the rejected-tab outline.
|
|
96
|
+
* @group State / Error
|
|
97
|
+
*/
|
|
98
|
+
@property --cngx-mat-tab-error-outline-offset {
|
|
99
|
+
syntax: '<length>';
|
|
100
|
+
inherits: false;
|
|
101
|
+
initial-value: 1px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Font-weight bump of a rejected tab.
|
|
106
|
+
* @group State / Error
|
|
107
|
+
*/
|
|
108
|
+
@property --cngx-mat-tab-error-font-weight {
|
|
109
|
+
syntax: '<number>';
|
|
110
|
+
inherits: false;
|
|
111
|
+
initial-value: 600;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Inset of the `has-errors` glyph from the tab edges.
|
|
116
|
+
* @group State / HasErrors
|
|
117
|
+
*/
|
|
118
|
+
@property --cngx-mat-tab-has-errors-glyph-offset {
|
|
119
|
+
syntax: '<length>';
|
|
120
|
+
inherits: false;
|
|
121
|
+
initial-value: 4px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Larger inset when the tab is BOTH rejected and carries form
|
|
126
|
+
* errors - keeps the two signals visually distinct.
|
|
127
|
+
* @group State / HasErrors
|
|
128
|
+
*/
|
|
129
|
+
@property --cngx-mat-tab-has-errors-glyph-offset-stacked {
|
|
130
|
+
syntax: '<length>';
|
|
131
|
+
inherits: false;
|
|
132
|
+
initial-value: 6px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Diameter of the `has-errors` glyph disc.
|
|
137
|
+
* @group State / HasErrors
|
|
138
|
+
*/
|
|
139
|
+
@property --cngx-mat-tab-has-errors-glyph-size {
|
|
140
|
+
syntax: '<length>';
|
|
141
|
+
inherits: false;
|
|
142
|
+
initial-value: 16px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Background of the `has-errors` glyph disc. Wired to `--mat-sys-error`
|
|
147
|
+
* by the `@cngx/themes/material/tabs-theme` bridge; standalone it keeps
|
|
148
|
+
* the literal default below. Inherits so a host-level override reaches
|
|
149
|
+
* the `::before` glyph.
|
|
150
|
+
* @group State / HasErrors
|
|
151
|
+
*/
|
|
152
|
+
@property --cngx-mat-tab-has-errors-color {
|
|
153
|
+
syntax: '<color>';
|
|
154
|
+
inherits: true;
|
|
155
|
+
initial-value: oklch(0.45 0.15 25);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Glyph color inside the `has-errors` disc. Wired to `--mat-sys-on-error`
|
|
160
|
+
* by the `@cngx/themes/material/tabs-theme` bridge; standalone it keeps
|
|
161
|
+
* the literal default below.
|
|
162
|
+
* @group State / HasErrors
|
|
163
|
+
*/
|
|
164
|
+
@property --cngx-mat-tab-has-errors-glyph-color {
|
|
165
|
+
syntax: '<color>';
|
|
166
|
+
inherits: true;
|
|
167
|
+
initial-value: oklch(1 0 0);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Font-weight of the `has-errors` glyph (`!`).
|
|
172
|
+
* @group State / HasErrors
|
|
173
|
+
*/
|
|
174
|
+
@property --cngx-mat-tab-has-errors-font-weight {
|
|
175
|
+
syntax: '<number>';
|
|
176
|
+
inherits: false;
|
|
177
|
+
initial-value: 700;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Stacking-context order of the trailing-edge overflow wrapper.
|
|
182
|
+
* @group Layout
|
|
183
|
+
*/
|
|
184
|
+
@property --cngx-mat-tabs-more-z {
|
|
185
|
+
syntax: '<number>';
|
|
186
|
+
inherits: false;
|
|
187
|
+
initial-value: 2;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Background of the trailing-edge overflow wrapper. Wired to
|
|
192
|
+
* `--mat-sys-surface` by the `@cngx/themes/material/tabs-theme` bridge;
|
|
193
|
+
* standalone it keeps the `:root` palette below (light + dark).
|
|
194
|
+
* @group Surface
|
|
195
|
+
*/
|
|
196
|
+
@property --cngx-mat-tabs-more-bg {
|
|
197
|
+
syntax: '<color>';
|
|
198
|
+
inherits: true;
|
|
199
|
+
initial-value: oklch(1 0 0);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Drop-shadow of the trailing-edge overflow wrapper.
|
|
204
|
+
* @group Surface
|
|
205
|
+
*/
|
|
206
|
+
@property --cngx-mat-tabs-more-shadow {
|
|
207
|
+
syntax: '*';
|
|
208
|
+
inherits: true;
|
|
209
|
+
initial-value: -8px 0 8px -4px oklch(0 0 0 / 0.1);
|
|
210
|
+
}
|
|
46
211
|
|
|
47
|
-
.mat-mdc-tab-disabled.cngx-mat-tab--error {
|
|
48
212
|
/*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
213
|
+
* Standalone palette pass. The `cngx-mat-tabs-more` molecule sits over
|
|
214
|
+
* the Material tab header - its background needs to match the page
|
|
215
|
+
* surface so the gradient fades into "nothing" rather than into
|
|
216
|
+
* white-on-dark. These values apply when the stylesheet is imported on
|
|
217
|
+
* its own; the `@cngx/themes/material/tabs-theme` bridge supersedes them
|
|
218
|
+
* by setting `--cngx-mat-tabs-more-bg` to `--mat-sys-surface` on the tab
|
|
219
|
+
* group, a nearer ancestor of the wrapper, so it wins by inheritance.
|
|
220
|
+
* Stays under the Material-bridge namespace (no `--cngx-color-*`
|
|
221
|
+
* delegation) per the file-header contract.
|
|
53
222
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
223
|
+
:root {
|
|
224
|
+
--cngx-mat-tabs-more-bg: oklch(1 0 0);
|
|
225
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.1);
|
|
226
|
+
}
|
|
56
227
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
}
|
|
228
|
+
@media (prefers-color-scheme: dark) {
|
|
229
|
+
:root:not([data-color-scheme='light']):not(.light) {
|
|
230
|
+
--cngx-mat-tabs-more-bg: oklch(0.2 0.01 250);
|
|
231
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.45);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
78
234
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
}
|
|
235
|
+
:root[data-color-scheme='dark'],
|
|
236
|
+
:root.dark {
|
|
237
|
+
--cngx-mat-tabs-more-bg: oklch(0.2 0.01 250);
|
|
238
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.45);
|
|
239
|
+
}
|
|
119
240
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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);
|
|
241
|
+
:root[data-color-scheme='light'],
|
|
242
|
+
:root.light {
|
|
243
|
+
--cngx-mat-tabs-more-bg: oklch(1 0 0);
|
|
244
|
+
--cngx-mat-tabs-more-shadow: -8px 0 8px -4px oklch(0 0 0 / 0.1);
|
|
245
|
+
}
|
|
130
246
|
}
|
|
131
247
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
248
|
+
@layer cngx.components {
|
|
249
|
+
/*
|
|
250
|
+
* Specificity bump to `.mat-mdc-tab.cngx-mat-tab--error` (0,2,0) is
|
|
251
|
+
* load-bearing - Material 21's `.mdc-tab` rule (0,1,0) sets
|
|
252
|
+
* `outline: none` to suppress the browser's default focus outline,
|
|
253
|
+
* and ships those styles inline via the component decorator. Since
|
|
254
|
+
* the component-scoped CSS is injected into `<head>` AFTER the
|
|
255
|
+
* `angular.json` global styles when the component first renders,
|
|
256
|
+
* a same-specificity rule loses the cascade.
|
|
257
|
+
*
|
|
258
|
+
* `.mat-mdc-tab-link` carries the same decoration for the native
|
|
259
|
+
* `[cngxMatTabNav]` bridge - the link element is also (0,1,0), so the
|
|
260
|
+
* doubled selector wins identically.
|
|
261
|
+
*/
|
|
262
|
+
.mat-mdc-tab.cngx-mat-tab--error,
|
|
263
|
+
.mat-mdc-tab-link.cngx-mat-tab--error {
|
|
264
|
+
color: var(--cngx-mat-tab-error-color, oklch(0.45 0.15 25));
|
|
265
|
+
outline: var(--cngx-mat-tab-error-outline, 2px solid currentColor);
|
|
266
|
+
outline-offset: var(--cngx-mat-tab-error-outline-offset, 1px);
|
|
267
|
+
font-weight: var(--cngx-mat-tab-error-font-weight, 600);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.mat-mdc-tab-disabled.cngx-mat-tab--error {
|
|
271
|
+
/*
|
|
272
|
+
* A disabled-and-rejected tab keeps the rejection signal but
|
|
273
|
+
* fades to disambiguate it from a healthy disabled tab.
|
|
274
|
+
*/
|
|
275
|
+
opacity: 0.7;
|
|
276
|
+
}
|
|
158
277
|
|
|
159
278
|
/*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
}
|
|
279
|
+
* Per-tab form-error aggregation badge. Distinct semantic from
|
|
280
|
+
* `--error` - `--error` means "your last commit was refused";
|
|
281
|
+
* `--has-errors` means "this tab contains form-validation errors
|
|
282
|
+
* right now". The two coexist and a tab can carry both
|
|
283
|
+
* simultaneously.
|
|
284
|
+
*/
|
|
285
|
+
.cngx-mat-tab--has-errors {
|
|
286
|
+
position: relative;
|
|
287
|
+
}
|
|
184
288
|
|
|
185
|
-
/*
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
289
|
+
/*
|
|
290
|
+
* Specificity is `.mat-mdc-tab.cngx-mat-tab--has-errors` (0,2,1)
|
|
291
|
+
* to beat Material's own `.mat-focus-indicator::before` (0,1,1)
|
|
292
|
+
* which sets `inset: 0` on the same pseudo-element.
|
|
293
|
+
*/
|
|
294
|
+
.mat-mdc-tab.cngx-mat-tab--has-errors::before,
|
|
295
|
+
.mat-mdc-tab-link.cngx-mat-tab--has-errors::before {
|
|
296
|
+
content: '!';
|
|
297
|
+
position: absolute;
|
|
298
|
+
top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
299
|
+
right: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
300
|
+
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
301
|
+
inset-inline-start: auto;
|
|
302
|
+
bottom: auto;
|
|
303
|
+
display: inline-flex;
|
|
304
|
+
align-items: center;
|
|
305
|
+
justify-content: center;
|
|
306
|
+
width: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
|
|
307
|
+
height: var(--cngx-mat-tab-has-errors-glyph-size, 16px);
|
|
308
|
+
margin: 0;
|
|
309
|
+
border: 0;
|
|
310
|
+
border-radius: 50%;
|
|
311
|
+
background: var(--cngx-mat-tab-has-errors-color, oklch(0.45 0.15 25));
|
|
312
|
+
color: var(--cngx-mat-tab-has-errors-glyph-color, oklch(1 0 0));
|
|
313
|
+
font-size: calc(var(--cngx-mat-tab-has-errors-glyph-size, 16px) * 0.75);
|
|
314
|
+
font-weight: var(--cngx-mat-tab-has-errors-font-weight, 700);
|
|
315
|
+
line-height: 1;
|
|
316
|
+
pointer-events: none;
|
|
317
|
+
z-index: 1;
|
|
318
|
+
}
|
|
195
319
|
|
|
196
|
-
/*
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
* }
|
|
209
|
-
*/
|
|
320
|
+
/*
|
|
321
|
+
* Co-occurrence: when a tab is BOTH rejected and carries form
|
|
322
|
+
* errors, the rejection outline already draws focus to the edges;
|
|
323
|
+
* shift the has-errors badge slightly inward so the two signals
|
|
324
|
+
* read as distinct rather than visually merging.
|
|
325
|
+
*/
|
|
326
|
+
.mat-mdc-tab.cngx-mat-tab--error.cngx-mat-tab--has-errors::before,
|
|
327
|
+
.mat-mdc-tab-link.cngx-mat-tab--error.cngx-mat-tab--has-errors::before {
|
|
328
|
+
top: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
329
|
+
right: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
330
|
+
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset-stacked, 6px);
|
|
331
|
+
}
|
|
210
332
|
|
|
211
|
-
/*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
333
|
+
/*
|
|
334
|
+
* Trailing-edge skin for the dynamically-mounted `<cngx-tab-overflow>`
|
|
335
|
+
* molecule. `[cngxMatTabs]` programmatically appends the molecule
|
|
336
|
+
* into `.mat-mdc-tab-header` and adds the `cngx-mat-tabs-more` class.
|
|
337
|
+
*/
|
|
338
|
+
.cngx-mat-tabs-more {
|
|
339
|
+
flex: 0 0 auto;
|
|
340
|
+
align-self: stretch;
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
z-index: var(--cngx-mat-tabs-more-z, 2);
|
|
344
|
+
|
|
345
|
+
/*
|
|
346
|
+
* Drive the molecule's own component-API cascade variables.
|
|
347
|
+
*/
|
|
348
|
+
--cngx-tab-overflow-bg: var(--cngx-mat-tabs-more-bg, oklch(1 0 0));
|
|
349
|
+
--cngx-tab-overflow-button-bg: var(--cngx-mat-tabs-more-bg, oklch(1 0 0));
|
|
350
|
+
|
|
351
|
+
box-shadow: var(--cngx-mat-tabs-more-shadow, -8px 0 8px -4px oklch(0 0 0 / 0.1));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/*
|
|
355
|
+
* Collapse the wrapper to zero layout space when the inner trigger
|
|
356
|
+
* button is hidden (= no clipped tabs).
|
|
357
|
+
*/
|
|
358
|
+
.cngx-mat-tabs-more:has(.cngx-tab-overflow__trigger[hidden]) {
|
|
359
|
+
display: none;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/*
|
|
363
|
+
* SR-only utility for the per-tab error descriptor span mounted by
|
|
364
|
+
* the aggregator-decoration effect.
|
|
365
|
+
*/
|
|
366
|
+
.cngx-sr-only {
|
|
367
|
+
position: absolute;
|
|
368
|
+
width: 1px;
|
|
369
|
+
height: 1px;
|
|
370
|
+
margin: -1px;
|
|
371
|
+
padding: 0;
|
|
372
|
+
overflow: hidden;
|
|
373
|
+
clip: rect(0, 0, 0, 0);
|
|
374
|
+
white-space: nowrap;
|
|
375
|
+
border: 0;
|
|
376
|
+
}
|
|
233
377
|
}
|
package/material/README.md
CHANGED
|
@@ -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**
|
|
46
|
-
- **Automatic state sync**
|
|
47
|
-
- **Page size selector**
|
|
48
|
-
- **Disabled state**
|
|
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
|
|
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**
|
|
57
|
-
- **Keyboard navigation**
|
|
58
|
-
- **Disabled state**
|
|
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**
|
|
65
|
-
- **CngxPaginate directive**
|
|
66
|
-
- **Event handling**
|
|
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**
|
|
71
|
-
2. **Data binding**
|
|
72
|
-
3. **Component wire-up**
|
|
73
|
-
4. **State sync**
|
|
74
|
-
5. **User interaction**
|
|
75
|
-
6. **State update**
|
|
76
|
-
7. **Data refresh**
|
|
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
|
|
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;
|